X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fnetworkssettingspage.cpp;h=f422ebb56f149a0c16aa7a77e5c677ab92d9cfc4;hp=011328d5ebe0a8e596a33d54a70722f212a632d7;hb=a8dd070641e70ff96fc2077df63cc5fabe3f7785;hpb=05b9069b0df2cbfd71bd138ccde2c95378f11e89 diff --git a/src/qtui/settingspages/networkssettingspage.cpp b/src/qtui/settingspages/networkssettingspage.cpp index 011328d5..f422ebb5 100644 --- a/src/qtui/settingspages/networkssettingspage.cpp +++ b/src/qtui/settingspages/networkssettingspage.cpp @@ -869,12 +869,30 @@ ServerEditDlg::ServerEditDlg(const Network::Server &server, QWidget *parent) : Q ui.port->setValue(server.port); ui.password->setText(server.password); ui.useSSL->setChecked(server.useSsl); + ui.sslVersion->setCurrentIndex(server.sslVersion); ui.useProxy->setChecked(server.useProxy); ui.proxyType->setCurrentIndex(server.proxyType == QNetworkProxy::Socks5Proxy ? 0 : 1); ui.proxyHost->setText(server.proxyHost); ui.proxyPort->setValue(server.proxyPort); ui.proxyUsername->setText(server.proxyUser); ui.proxyPassword->setText(server.proxyPass); + + // This is a dirty hack to display the core->IRC SSL protocol dropdown + // only if the core won't use autonegotiation to determine the best + // protocol. When autonegotiation was introduced, it would have been + // a good idea to use the CoreFeatures enum to accomplish this. + // However, since multiple versions have been released since then, that + // is no longer possible. Instead, we rely on the fact that the + // Datastream protocol was introduced in the same version (0.10) as SSL + // autonegotiation. Because of that, we can display the dropdown only + // if the Legacy protocol is in use. If any other RemotePeer protocol + // is in use, that means a newer protocol is in use and therefore the + // core will use autonegotiation. + if (Client::coreConnection()->peer()->protocol() != Protocol::LegacyProtocol) { + ui.label_3->hide(); + ui.sslVersion->hide(); + } + on_host_textChanged(); } @@ -882,6 +900,7 @@ ServerEditDlg::ServerEditDlg(const Network::Server &server, QWidget *parent) : Q Network::Server ServerEditDlg::serverData() const { Network::Server server(ui.host->text().trimmed(), ui.port->value(), ui.password->text(), ui.useSSL->isChecked()); + server.sslVersion = ui.sslVersion->currentIndex(); server.useProxy = ui.useProxy->isChecked(); server.proxyType = ui.proxyType->currentIndex() == 0 ? QNetworkProxy::Socks5Proxy : QNetworkProxy::HttpProxy; server.proxyHost = ui.proxyHost->text();