Client::signalProxy()->attachSignal(this, SIGNAL(requestBacklog(BufferInfo, QVariant, QVariant)));
+ // let's hope here that nothing in disconnectedFromCore() needs user interaction/event loop...
+ connect(QApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(disconnectedFromCore()));
+
connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), this, SLOT(clientNetworkCreated(NetworkId)));
connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), this, SLOT(clientNetworkRemoved(NetworkId)));
//ui.bufferWidget->init();
// restore mainwin state
restoreState(s.value("MainWinState").toByteArray());
- disconnectedFromCore(); // Disable menus and stuff
+ setDisconnectedState(); // Disable menus and stuff
showCoreConnectionDlg(true); // autoconnect if appropriate
// attach the BufferWidget to the BufferModel and the default selection
break;
dock = qobject_cast<BufferViewDock *>(action->parent());
- if(dock && actionData.toInt() != bufferViewConfigId) {
+ if(dock && actionData.toInt() == bufferViewConfigId) {
removeAction(action);
dock->deleteLater();
}
foreach(BufferInfo id, Client::allBufferInfos()) {
Client::backlogManager()->requestBacklog(id.bufferId(), 500, -1);
}
+ setConnectedState();
+}
+void MainWin::setConnectedState() {
ui.menuViews->setEnabled(true);
//ui.menuCore->setEnabled(true);
ui.actionConnectCore->setEnabled(false);
dock->deleteLater();
}
}
+ restoreState(s.value("MainWinState").toByteArray());
+ setDisconnectedState();
+}
+void MainWin::setDisconnectedState() {
ui.menuViews->setEnabled(false);
//ui.menuCore->setEnabled(false);
ui.actionDisconnectCore->setEnabled(false);