pgLab/pglab/SslModeModel.cpp
eelke b09e8a6d4b ConnectionManager overhaul
- connection settings are now changed by seperate component currently called in a seperate window
- old settings pane on the right of the connections had been removed
- new edit config button added between new connection and remove connection
2019-08-24 20:47:32 +02:00

69 lines
1.3 KiB
C++

#include "SslModeModel.h"
SslModeModel::SslModeModel(QObject *parent)
: QAbstractListModel(parent)
{}
int SslModeModel::rowCount(const QModelIndex &) const
{
return 6;
}
int SslModeModel::columnCount(const QModelIndex &) const
{
return ColCount;
}
QVariant SslModeModel::data(const QModelIndex &index, int role) const
{
QVariant v;
if (role == Qt::DisplayRole) {
switch (index.column()) {
case Name:
switch(index.row()) {
case 0:
v = tr("disable");
break;
case 1:
v = tr("allow");
break;
case 2:
v = tr("prefer");
break;
case 3:
v = tr("require");
break;
case 4:
v = tr("verify_ca");
break;
case 5:
v = tr("verify_full");
break;
}
break;
case Description:
switch(index.row()) {
case 0:
v = tr("try a non encrypted connection only");
break;
case 1:
v = tr("try no encryption first then try encrypted");
break;
case 2:
v = tr("try encrypted first then not encrypted");
break;
case 3:
v = tr("require an encrypted connection");
break;
case 4:
v = tr("verify encryption certificate has a valid signature");
break;
case 5:
v = tr("verify encryption certificate has a valid signature and matches the host");
break;
}
break;
}
}
return v;
}