X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fcoreconnectdlg.cpp;h=909592e06392047c283d33a8c09e2a3c0fe74824;hp=3510926dc59f37092d9c1bffc87ac999c7308267;hb=ea13d09349df9851908e617c25223646bb165a0a;hpb=d637a77754d0138f47b10378463d87ef5a98214f diff --git a/src/qtui/coreconnectdlg.cpp b/src/qtui/coreconnectdlg.cpp index 3510926d..909592e0 100644 --- a/src/qtui/coreconnectdlg.cpp +++ b/src/qtui/coreconnectdlg.cpp @@ -20,6 +20,7 @@ #include #include +#include #include "coreconnectdlg.h" @@ -62,6 +63,7 @@ CoreConnectDlg::CoreConnectDlg(QWidget *parent, bool autoconnect) : QDialog(pare connect(clientSyncer, SIGNAL(socketStateChanged(QAbstractSocket::SocketState)),this, SLOT(initPhaseSocketState(QAbstractSocket::SocketState))); connect(clientSyncer, SIGNAL(connectionError(const QString &)), this, SLOT(initPhaseError(const QString &))); connect(clientSyncer, SIGNAL(connectionMsg(const QString &)), this, SLOT(initPhaseMsg(const QString &))); + connect(clientSyncer, SIGNAL(encrypted(bool)), this, SLOT(encrypted(bool))); connect(clientSyncer, SIGNAL(startLogin()), this, SLOT(startLogin())); connect(clientSyncer, SIGNAL(loginFailed(const QString &)), this, SLOT(loginFailed(const QString &))); connect(clientSyncer, SIGNAL(loginSuccess()), this, SLOT(startSync())); @@ -208,6 +210,7 @@ void CoreConnectDlg::on_accountButtonBox_accepted() { /*** Phase One: initializing the core connection ***/ void CoreConnectDlg::connectToCore() { + ui.secureConnection->hide(); ui.connectIcon->setPixmap(QPixmap::fromImage(QImage(":/22x22/actions/network-disconnect"))); ui.connectLabel->setText(tr("Connect to %1").arg(accountData["Host"].toString())); ui.coreInfoLabel->setText(""); @@ -223,6 +226,7 @@ void CoreConnectDlg::connectToCore() { void CoreConnectDlg::initPhaseError(const QString &error) { doingAutoConnect = false; + ui.secureConnection->hide(); ui.connectIcon->setPixmap(QPixmap::fromImage(QImage(":/22x22/status/dialog-error"))); //ui.connectLabel->setBrush(QBrush("red")); ui.connectLabel->setText(tr("
Connection to %1 failed!
").arg(accountData["Host"].toString())); @@ -238,6 +242,13 @@ void CoreConnectDlg::initPhaseMsg(const QString &msg) { ui.coreInfoLabel->setText(msg); } +void CoreConnectDlg::encrypted(bool useSsl) { + if(useSsl) + ui.secureConnection->show(); + else + ui.secureConnection->hide(); +} + void CoreConnectDlg::initPhaseSocketState(QAbstractSocket::SocketState state) { QString s; QString host = accountData["Host"].toString(); @@ -448,19 +459,35 @@ void CoreConnectDlg::syncFinished() { /***************************************************************************************** * CoreAccountEditDlg *****************************************************************************************/ - -CoreAccountEditDlg::CoreAccountEditDlg(AccountId id, const QVariantMap &acct, const QStringList &_existing, QWidget *parent) : QDialog(parent) { +CoreAccountEditDlg::CoreAccountEditDlg(AccountId id, const QVariantMap &acct, const QStringList &_existing, QWidget *parent) + : QDialog(parent) +{ ui.setupUi(this); existing = _existing; - account = acct; if(id.isValid()) { existing.removeAll(acct["AccountName"].toString()); ui.host->setText(acct["Host"].toString()); ui.port->setValue(acct["Port"].toUInt()); ui.useInternal->setChecked(acct["UseInternal"].toBool()); ui.accountName->setText(acct["AccountName"].toString()); +#ifndef QT_NO_OPENSSL + ui.useSsl->setChecked(acct["useSsl"].toBool()); +#else + ui.useSsl->setChecked(false); + ui.useSsl->setEnabled(false); +#endif + ui.useProxy->setChecked(acct["useProxy"].toBool()); + ui.proxyHost->setText(acct["proxyHost"].toString()); + ui.proxyPort->setValue(acct["proxyPort"].toUInt()); + ui.proxyType->setCurrentIndex(acct["proxyType"].toInt() == QNetworkProxy::Socks5Proxy ? 0 : 1); + ui.proxyUser->setText(acct["proxyUser"].toString()); + ui.proxyPassword->setText(acct["proxyPassword"].toString()); } else { setWindowTitle(tr("Add Core Account")); +#ifdef QT_NO_OPENSSL + ui.useSsl->setChecked(false); + ui.useSsl->setEnabled(false); +#endif } } @@ -469,6 +496,13 @@ QVariantMap CoreAccountEditDlg::accountData() { account["Host"] = ui.host->text().trimmed(); account["Port"] = ui.port->value(); account["UseInternal"] = ui.useInternal->isChecked(); + account["useSsl"] = ui.useSsl->isChecked(); + account["useProxy"] = ui.useProxy->isChecked(); + account["proxyHost"] = ui.proxyHost->text().trimmed(); + account["proxyPort"] = ui.proxyPort->value(); + account["proxyType"] = ui.proxyType->currentIndex() == 0 ? QNetworkProxy::Socks5Proxy : QNetworkProxy::HttpProxy; + account["proxyUser"] = ui.proxyUser->text().trimmed(); + account["proxyPassword"] = ui.proxyPassword->text().trimmed(); return account; }