}
}
+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..."));
foreach(QVariant networkid, networkids) {
networkConnected(networkid.toUInt());
}
-
+
instance()->connectedToCore = true;
updateCoreConnectionProgress();
+
}
void Client::updateCoreConnectionProgress() {
if(! channel->initialized())
numChannelsWaiting++;
}
-
}
if(numNetsWaiting > 0) {
}
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();
}
void Client::recvSessionData(const QString &key, const QVariant &data) {
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;
}
//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;
}