X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fclient.cpp;h=29e68d894e1a1acaa4610b8ddff8d6134c4e4967;hb=1956aab57bf98ce072ed86f34785e5d7abba35a0;hp=2500b27334264df32bcf4b9f6570f50e572957e7;hpb=0ff076706c3d353ec9b098b1eca270195288774e;p=quassel.git diff --git a/src/client/client.cpp b/src/client/client.cpp index 2500b273..29e68d89 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -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...")); @@ -319,9 +323,10 @@ void Client::syncToCore(const QVariant &coreState) { foreach(QVariant networkid, networkids) { networkConnected(networkid.toUInt()); } - + instance()->connectedToCore = true; updateCoreConnectionProgress(); + } void Client::updateCoreConnectionProgress() { @@ -375,12 +380,12 @@ void Client::updateCoreConnectionProgress() { } emit coreConnectionProgress(1,1); - emit connected(); + emit connected(); // FIXME EgS: This caused the double backlog... but... we shouldn't be calling this whole function all the time... foreach(NetworkInfo *net, networkInfos()) { disconnect(net, 0, this, SLOT(updateCoreConnectionProgress())); } - + // signalProxy()->dumpProxyStats(); } @@ -415,7 +420,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; } @@ -430,10 +442,13 @@ void Client::networkConnected(uint netid) { //Buffer *b = buffer(id); //b->setActive(true); + // FIXME EgS: do we really need to call updateCoreConnectionProgress whenever a new network is connected? NetworkInfo *netinfo = new NetworkInfo(netid, signalProxy(), this); - connect(netinfo, SIGNAL(initDone()), this, SLOT(updateCoreConnectionProgress())); - connect(netinfo, SIGNAL(ircUserInitDone()), this, SLOT(updateCoreConnectionProgress())); - connect(netinfo, SIGNAL(ircChannelInitDone()), this, SLOT(updateCoreConnectionProgress())); + if(!isConnected()) { + connect(netinfo, SIGNAL(initDone()), this, SLOT(updateCoreConnectionProgress())); + connect(netinfo, SIGNAL(ircUserInitDone()), this, SLOT(updateCoreConnectionProgress())); + connect(netinfo, SIGNAL(ircChannelInitDone()), this, SLOT(updateCoreConnectionProgress())); + } connect(netinfo, SIGNAL(destroyed()), this, SLOT(networkInfoDestroyed())); _networkInfo[netid] = netinfo; }