+#ifdef HAVE_SSL
+
+void MainWin::handleSslErrors(const QSslSocket *socket, bool *accepted, bool *permanently) {
+ QString errorString = "<ul>";
+ foreach(const QSslError error, socket->sslErrors())
+ errorString += QString("<li>%1</li>").arg(error.errorString());
+ errorString += "</ul>";
+
+ QMessageBox box(QMessageBox::Warning,
+ tr("Untrusted Security Certificate"),
+ tr("<b>The SSL certificate provided by the core at %1 is untrusted for the following reasons:</b>").arg(socket->peerName()),
+ QMessageBox::Cancel, this);
+ box.setInformativeText(errorString);
+ box.addButton(tr("Continue"), QMessageBox::AcceptRole);
+ box.setDefaultButton(box.addButton(tr("Show Certificate"), QMessageBox::HelpRole));
+
+ QMessageBox::ButtonRole role;
+ do {
+ box.exec();
+ role = box.buttonRole(box.clickedButton());
+ if(role == QMessageBox::HelpRole) {
+ SslInfoDlg dlg(socket, this);
+ dlg.exec();
+ }
+ } while(role == QMessageBox::HelpRole);
+
+ *accepted = role == QMessageBox::AcceptRole;
+ if(*accepted) {
+ QMessageBox box2(QMessageBox::Warning,
+ tr("Untrusted Security Certificate"),
+ tr("Would you like to accept this certificate forever without being prompted?"),
+ 0, this);
+ box2.setDefaultButton(box2.addButton(tr("Current Session Only"), QMessageBox::NoRole));
+ box2.addButton(tr("Forever"), QMessageBox::YesRole);
+ box2.exec();
+ *permanently = box2.buttonRole(box2.clickedButton()) == QMessageBox::YesRole;
+ }
+}
+
+#endif /* HAVE_SSL */
+
+void MainWin::handleCoreConnectionError(const QString &error) {
+ QMessageBox::critical(this, tr("Core Connection Error"), error, QMessageBox::Ok);
+}
+
+void MainWin::showCoreConnectionDlg() {
+ CoreConnectDlg dlg(this);
+ if(dlg.exec() == QDialog::Accepted) {
+ AccountId accId = dlg.selectedAccount();
+ if(accId.isValid())
+ Client::coreConnection()->connectToCore(accId);
+ }
+}
+
+void MainWin::showCoreConfigWizard(const QVariantList &backends) {
+ CoreConfigWizard *wizard = new CoreConfigWizard(Client::coreConnection(), backends, this);
+
+ wizard->show();