cleanups (WiP)
[quassel.git] / src / qtui / coreconnectdlg.cpp
index 7490cb4..dfbf9db 100644 (file)
@@ -28,7 +28,7 @@
 #include "clientsyncer.h"
 #include "coreconfigwizard.h"
 
-CoreConnectDlg::CoreConnectDlg(QWidget *parent, bool autoconnect)
+CoreConnectDlg::CoreConnectDlg(bool autoconnect, QWidget *parent)
   : QDialog(parent)
 {
   ui.setupUi(this);
@@ -39,8 +39,6 @@ CoreConnectDlg::CoreConnectDlg(QWidget *parent, bool autoconnect)
   clientSyncer = new ClientSyncer(this);
   wizard = 0;
 
-  setAttribute(Qt::WA_DeleteOnClose);
-
   doingAutoConnect = false;
 
   ui.stackedWidget->setCurrentWidget(ui.accountPage);
@@ -76,8 +74,6 @@ CoreConnectDlg::CoreConnectDlg(QWidget *parent, bool autoconnect)
   connect(clientSyncer, SIGNAL(startCoreSetup(const QVariantList &)), this, SLOT(startCoreConfig(const QVariantList &)));
   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(channelsProgress(quint32, quint32)), this, SLOT(coreChannelsProgress(quint32, quint32)));
-  connect(clientSyncer, SIGNAL(ircUsersProgress(quint32, quint32)), this, SLOT(coreIrcUsersProgress(quint32, quint32)));
   connect(clientSyncer, SIGNAL(syncFinished()), this, SLOT(syncFinished()));
 
   connect(ui.user, SIGNAL(textChanged(const QString &)), this, SLOT(setLoginWidgetStates()));
@@ -396,10 +392,6 @@ void CoreConnectDlg::startSync() {
   ui.sessionProgress->setValue(0);
   ui.networksProgress->setRange(0, 1);
   ui.networksProgress->setValue(0);
-  ui.channelsProgress->setRange(0, 1);
-  ui.channelsProgress->setValue(0);
-  ui.ircUsersProgress->setRange(0, 1);
-  ui.ircUsersProgress->setValue(0);
 
   ui.stackedWidget->setCurrentWidget(ui.syncPage);
   // clean up old page
@@ -428,31 +420,6 @@ void CoreConnectDlg::coreNetworksProgress(quint32 val, quint32 max) {
   }
 }
 
-void CoreConnectDlg::coreChannelsProgress(quint32 val, quint32 max) {
-  if(max == 0) {
-    ui.channelsProgress->setFormat("0/0");
-    ui.channelsProgress->setRange(0, 1);
-    ui.channelsProgress->setValue(1);
-  } else {
-    ui.channelsProgress->setFormat("%v/%m");
-    ui.channelsProgress->setRange(0, max);
-    ui.channelsProgress->setValue(val);
-  }
-}
-
-void CoreConnectDlg::coreIrcUsersProgress(quint32 val, quint32 max) {
-  if(max == 0) {
-    ui.ircUsersProgress->setFormat("0/0");
-    ui.ircUsersProgress->setRange(0, 1);
-    ui.ircUsersProgress->setValue(1);
-  } else {
-    if(val % 100) return;
-    ui.ircUsersProgress->setFormat("%v/%m");
-    ui.ircUsersProgress->setRange(0, max);
-    ui.ircUsersProgress->setValue(val);
-  }
-}
-
 void CoreConnectDlg::syncFinished() {
   if(!wizard) accept();
   else {
@@ -476,7 +443,7 @@ CoreAccountEditDlg::CoreAccountEditDlg(AccountId id, const QVariantMap &acct, co
     ui.port->setValue(acct["Port"].toUInt());
     ui.useInternal->setChecked(acct["UseInternal"].toBool());
     ui.accountName->setText(acct["AccountName"].toString());
-#ifndef QT_NO_OPENSSL
+#ifdef HAVE_SSL
     ui.useSsl->setChecked(acct["useSsl"].toBool());
 #else
     ui.useSsl->setChecked(false);
@@ -490,11 +457,19 @@ CoreAccountEditDlg::CoreAccountEditDlg(AccountId id, const QVariantMap &acct, co
     ui.proxyPassword->setText(acct["proxyPassword"].toString());
   } else {
     setWindowTitle(tr("Add Core Account"));
-#ifdef QT_NO_OPENSSL
+#ifndef HAVE_SSL
     ui.useSsl->setChecked(false);
     ui.useSsl->setEnabled(false);
 #endif
   }
+
+#ifndef BUILD_MONO
+  // if we don't have a mono build we hide the option to use the internal connection and force the setting to use remote host
+  ui.useInternal->setChecked(false);
+  ui.useInternal->hide();
+  ui.useRemote->hide();
+  ui.labelUseBuiltinCore->hide();
+#endif
 }
 
 QVariantMap CoreAccountEditDlg::accountData() {