From: Marcus Eggenberger Date: Wed, 14 Jan 2009 20:02:50 +0000 (+0100) Subject: fixes #484 - issues with ssl status indicator X-Git-Tag: 0.4.0~217 X-Git-Url: https://git.quassel-irc.org/?a=commitdiff_plain;h=236dda81632fa792e788d45b0f4f31b973823f7f;p=quassel.git fixes #484 - issues with ssl status indicator --- diff --git a/src/client/client.cpp b/src/client/client.cpp index 41ceb1ed..92be56ef 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -345,10 +345,6 @@ void Client::createDefaultNetworks() { } } -void Client::setSecuredConnection() { - emit securedConnection(); -} - void Client::disconnectFromCore() { if(!isConnected()) return; diff --git a/src/client/client.h b/src/client/client.h index 684cb581..ea30bcd4 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -129,7 +129,6 @@ signals: void showConfigWizard(const QVariantMap &coredata); void connected(); - void securedConnection(); void disconnected(); void coreConnectionStateChanged(bool); @@ -188,8 +187,6 @@ private slots: void createDefaultBufferView(); void createDefaultIdentity(); void createDefaultNetworks(); - void setSecuredConnection(); - private: Client(QObject *parent = 0); diff --git a/src/client/clientsyncer.cpp b/src/client/clientsyncer.cpp index 51b51f17..fb8bebc2 100644 --- a/src/client/clientsyncer.cpp +++ b/src/client/clientsyncer.cpp @@ -123,10 +123,10 @@ void ClientSyncer::connectToCore(const QVariantMap &conn) { #ifdef HAVE_SSL QSslSocket *sock = new QSslSocket(Client::instance()); + connect(sock, SIGNAL(encrypted()), this, SIGNAL(encrypted())); #else if(conn["useSsl"].toBool()) { emit connectionError(tr("This client is built without SSL Support!
Disable the usage of SSL in the account settings.")); - emit encrypted(false); return; } QTcpSocket *sock = new QTcpSocket(Client::instance()); @@ -229,11 +229,8 @@ void ClientSyncer::clientInitAck(const QVariantMap &msg) { Q_ASSERT(sslSocket); connect(sslSocket, SIGNAL(sslErrors(const QList &)), this, SLOT(sslErrors(const QList &))); sslSocket->startClientEncryption(); - emit encrypted(true); - Client::instance()->setSecuredConnection(); } else { emit connectionError(tr("The Quassel Core you are trying to connect to does not support SSL!
If you want to connect anyways, disable the usage of SSL in the account settings.")); - emit encrypted(false); disconnectFromCore(); return; } diff --git a/src/client/clientsyncer.h b/src/client/clientsyncer.h index e8cee5ab..ea65d48f 100644 --- a/src/client/clientsyncer.h +++ b/src/client/clientsyncer.h @@ -61,7 +61,7 @@ signals: void coreSetupSuccess(); void coreSetupFailed(const QString &error); - void encrypted(bool); + void encrypted(); // relaying encrypted signal of the encapsulated SslSocket void startInternalCore(ClientSyncer *syncer); void connectToInternalCore(SignalProxy *proxy); diff --git a/src/qtui/coreconnectdlg.cpp b/src/qtui/coreconnectdlg.cpp index 2e2c0949..f44ba0f4 100644 --- a/src/qtui/coreconnectdlg.cpp +++ b/src/qtui/coreconnectdlg.cpp @@ -88,7 +88,6 @@ CoreConnectDlg::CoreConnectDlg(bool autoconnect, QWidget *parent) 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())); @@ -96,6 +95,7 @@ CoreConnectDlg::CoreConnectDlg(bool autoconnect, QWidget *parent) connect(clientSyncer, SIGNAL(sessionProgress(quint32, quint32)), this, SLOT(coreSessionProgress(quint32, quint32))); connect(clientSyncer, SIGNAL(networksProgress(quint32, quint32)), this, SLOT(coreNetworksProgress(quint32, quint32))); connect(clientSyncer, SIGNAL(syncFinished()), this, SLOT(syncFinished())); + connect(clientSyncer, SIGNAL(encrypted()), ui.secureConnection, SLOT(show())); connect(ui.user, SIGNAL(textChanged(const QString &)), this, SLOT(setLoginWidgetStates())); connect(ui.password, SIGNAL(textChanged(const QString &)), this, SLOT(setLoginWidgetStates())); @@ -263,13 +263,6 @@ 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(); diff --git a/src/qtui/coreconnectdlg.h b/src/qtui/coreconnectdlg.h index 6376d9f7..cac4721e 100644 --- a/src/qtui/coreconnectdlg.h +++ b/src/qtui/coreconnectdlg.h @@ -64,7 +64,6 @@ private slots: void initPhaseError(const QString &error); void initPhaseMsg(const QString &msg); void initPhaseSocketState(QAbstractSocket::SocketState); - void encrypted(bool); /*** Phase Two: Login ***/ void startLogin(); diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index dda747d3..78f8d383 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -464,7 +464,6 @@ void MainWin::setupStatusBar() { connect(Client::signalProxy(), SIGNAL(lagUpdated(int)), this, SLOT(updateLagIndicator(int))); // SSL indicator - connect(Client::instance(), SIGNAL(securedConnection()), this, SLOT(securedConnection())); sslLabel->setPixmap(QPixmap()); statusBar()->addPermanentWidget(sslLabel); sslLabel->hide(); @@ -553,8 +552,11 @@ void MainWin::setConnectedState() { if(!Client::internalCore()) statusBar()->showMessage(tr("Connected to core.")); - if(sslLabel->width() == 0) + if(Client::signalProxy()->isSecure()) { + sslLabel->setPixmap(SmallIcon("security-high")); + } else { sslLabel->setPixmap(SmallIcon("security-low")); + } sslLabel->setVisible(!Client::internalCore()); coreLagLabel->setVisible(!Client::internalCore()); @@ -582,12 +584,6 @@ void MainWin::updateLagIndicator(int lag) { coreLagLabel->setText(text); } - -void MainWin::securedConnection() { - // todo: make status bar entry - sslLabel->setPixmap(SmallIcon("security-high")); -} - void MainWin::disconnectedFromCore() { // save core specific layout and remove bufferviews; saveLayout(); diff --git a/src/qtui/mainwin.h b/src/qtui/mainwin.h index c293a909..e3fdb615 100644 --- a/src/qtui/mainwin.h +++ b/src/qtui/mainwin.h @@ -86,7 +86,6 @@ class MainWin void connectedToCore(); void setConnectedState(); void updateLagIndicator(int lag = -1); - void securedConnection(); void disconnectedFromCore(); void setDisconnectedState(); void systrayActivated(QSystemTrayIcon::ActivationReason);