Ok, the long awaited config wizard is here (at least in a very basic state). There...
[quassel.git] / src / client / client.cpp
index 1d44fd6..28df087 100644 (file)
@@ -247,6 +247,10 @@ void Client::disconnectFromCore() {
   }
 }
 
+void Client::setCoreConfiguration(const QVariantMap &settings) {
+  writeDataToDevice(socket, settings);
+}
+
 void Client::coreSocketConnected() {
   connect(this, SIGNAL(recvPartialItem(uint, uint)), this, SIGNAL(coreConnectionProgress(uint, uint)));
   emit coreConnectionMsg(tr("Synchronizing to core..."));
@@ -354,7 +358,6 @@ void Client::updateCoreConnectionProgress() {
       if(! channel->initialized())
        numChannelsWaiting++;
     }
-
   }
 
   if(numNetsWaiting > 0) {
@@ -377,6 +380,12 @@ void Client::updateCoreConnectionProgress() {
 
   emit coreConnectionProgress(1,1);
   emit connected();
+
+  foreach(NetworkInfo *net, networkInfos()) {
+    disconnect(net, 0, this, SLOT(updateCoreConnectionProgress()));
+  }
+  
+  // signalProxy()->dumpProxyStats();
 }
 
 void Client::recvSessionData(const QString &key, const QVariant &data) {
@@ -410,7 +419,14 @@ void Client::coreHasData() {
   QVariant item;
   if(readDataFromDevice(socket, blockSize, item)) {
     emit recvPartialItem(1,1);
-    recvCoreState(item);
+    QVariantMap msg = item.toMap();
+    if (!msg["StartWizard"].toBool()) {
+      recvCoreState(msg["Reply"]);
+    } else {
+      qWarning("Core not configured!");
+      qDebug() << "Available storage providers: " << msg["StorageProviders"].toStringList();
+      emit showConfigWizard(msg);
+    }
     blockSize = 0;
     return;
   }