properly handling disconnects - this might even fix an antique bug with duplicate...
[quassel.git] / src / qtui / coreconnectdlg.cpp
index 3f6d120..d61a021 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "coreconnectdlg.h"
 
+#include "client.h"
 #include "clientsettings.h"
 #include "clientsyncer.h"
 #include "coreconfigwizard.h"
@@ -43,6 +44,9 @@ CoreConnectDlg::CoreConnectDlg(bool autoconnect, QWidget *parent)
   setWindowFlags(Qt::Sheet);
 
   clientSyncer = new ClientSyncer(this);
+  connect(this, SIGNAL(newClientSyncer(ClientSyncer *)), Client::instance(), SIGNAL(newClientSyncer(ClientSyncer *)));
+  emit newClientSyncer(clientSyncer); // announce the new client syncer via the client.
+
   wizard = 0;
 
   doingAutoConnect = false;
@@ -211,6 +215,18 @@ void CoreConnectDlg::on_accountButtonBox_accepted() {
   connectToCore();
 }
 
+void CoreConnectDlg::on_useInternalCore_clicked() {
+//   // FIXME: this needs to be a qobject_cast - therefore MonolithicApplication needs to be a proper QObject... :/
+//   MonolithicApplication *monoApp = qobject_cast<MonolithicApplication *>(QApplication::instance());
+//   if(monoApp) {
+//     qDebug() << "starting core...";
+//     monoApp->startInternalCore();
+//     monoApp->connectClientSyncer(clientSyncer);
+//   }
+  clientSyncer->useInternalCore();
+  startSync();
+}
+
 /*****************************************************
  * Connecting to the Core
  ****************************************************/