/***************************************************************************
- * Copyright (C) 2005-2015 by the Quassel Project *
+ * Copyright (C) 2005-2016 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
ui.setupUi(this);
ui.useSSL->setIcon(QIcon::fromTheme("document-encrypt"));
ui.host->setText(server.host);
+ ui.host->setFocus();
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();
}
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();