+
+ // 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();
+ }
+
+ // Whenever useSSL is toggled, update the port number if not changed from the default
+ connect(ui.useSSL, SIGNAL(toggled(bool)), SLOT(updateSslPort(bool)));
+ // Do NOT call updateSslPort when loading settings, otherwise port settings may be overriden.
+ // If useSSL is later changed to be checked by default, change port's default value, too.
+
+ if (Client::coreFeatures() & Quassel::VerifyServerSSL) {
+ // Synchronize requiring SSL with the use SSL checkbox
+ ui.sslVerify->setEnabled(ui.useSSL->isChecked());
+ connect(ui.useSSL, SIGNAL(toggled(bool)), ui.sslVerify, SLOT(setEnabled(bool)));
+ } else {
+ // Core isn't new enough to allow requiring SSL; disable checkbox and uncheck
+ ui.sslVerify->setEnabled(false);
+ ui.sslVerify->setChecked(false);
+ // Split up the message to allow re-using translations:
+ // [Original tool-tip]
+ // [Bold 'does not support feature' message]
+ // [Specific version needed and feature details]
+ ui.sslVerify->setToolTip(QString("%1<br/><b>%2</b><br/>%3").arg(
+ ui.sslVerify->toolTip(),
+ tr("Your Quassel core does not support this feature"),
+ tr("You need a Quassel core v0.13.0 or newer in order to "
+ "verify connection security.")));
+ }
+