The Monolithic build behaves now like a regular IRC client.
[quassel.git] / src / qtui / mainwin.cpp
index 431dacd..4957c90 100644 (file)
@@ -41,6 +41,7 @@
 #include "chatmonitorview.h"
 #include "chatview.h"
 #include "client.h"
 #include "chatmonitorview.h"
 #include "chatview.h"
 #include "client.h"
+#include "clientsyncer.h"
 #include "clientbacklogmanager.h"
 #include "coreinfodlg.h"
 #include "coreconnectdlg.h"
 #include "clientbacklogmanager.h"
 #include "coreinfodlg.h"
 #include "coreconnectdlg.h"
@@ -175,7 +176,11 @@ void MainWin::init() {
   setDisconnectedState();  // Disable menus and stuff
 
   show();
   setDisconnectedState();  // Disable menus and stuff
 
   show();
-  showCoreConnectionDlg(true); // autoconnect if appropriate
+  if(Quassel::runMode() != Quassel::Monolithic) {
+    showCoreConnectionDlg(true); // autoconnect if appropriate
+  } else {
+    startInternalCore();
+  }
 }
 
 MainWin::~MainWin() {
 }
 
 MainWin::~MainWin() {
@@ -618,6 +623,13 @@ void MainWin::setDisconnectedState() {
   updateIcon();
 }
 
   updateIcon();
 }
 
+void MainWin::startInternalCore() {
+  ClientSyncer *syncer = new ClientSyncer();
+  Client::registerClientSyncer(syncer);
+  connect(syncer, SIGNAL(syncFinished()), syncer, SLOT(deleteLater()), Qt::QueuedConnection);
+  syncer->useInternalCore();
+}
+
 void MainWin::showCoreConnectionDlg(bool autoConnect) {
   CoreConnectDlg(autoConnect, this).exec();
 }
 void MainWin::showCoreConnectionDlg(bool autoConnect) {
   CoreConnectDlg(autoConnect, this).exec();
 }