+ connect(actionRepopLists, SIGNAL(triggered()), this, SLOT(repopLists()));
+}
+
+void MainWin::disconnectSignals()
+{
+ /* Connect signals to slots */
+ disconnect(lineEdit, SIGNAL(returnPressed()), this, SLOT(input_line()));
+ disconnect(actionAbout_bat, SIGNAL(triggered()), this, SLOT(about()));
+ disconnect(actionBat_Help, SIGNAL(triggered()), this, SLOT(help()));
+ disconnect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(treeItemClicked(QTreeWidgetItem *, int)));
+ disconnect(treeWidget, SIGNAL( currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
+ disconnect(stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(stackItemChanged(int)));
+ disconnect(actionQuit, SIGNAL(triggered()), app, SLOT(closeAllWindows()));
+ disconnect(actionLabel, SIGNAL(triggered()), this, SLOT(labelButtonClicked()));
+ disconnect(actionRun, SIGNAL(triggered()), this, SLOT(runButtonClicked()));
+ disconnect(actionEstimate, SIGNAL(triggered()), this, SLOT(estimateButtonClicked()));
+ disconnect(actionBrowse, SIGNAL(triggered()), this, SLOT(browseButtonClicked()));
+ disconnect(actionStatusDirPage, SIGNAL(triggered()), this, SLOT(statusPageButtonClicked()));
+#ifdef HAVE_QWT
+ disconnect(actionJobPlot, SIGNAL(triggered()), this, SLOT(jobPlotButtonClicked()));
+#endif
+ disconnect(actionRestore, SIGNAL(triggered()), this, SLOT(restoreButtonClicked()));
+ disconnect(actionUndock, SIGNAL(triggered()), this, SLOT(undockWindowButton()));
+ disconnect(actionToggleDock, SIGNAL(triggered()), this, SLOT(toggleDockContextWindow()));
+ disconnect(actionClosePage, SIGNAL(triggered()), this, SLOT(closePage()));
+ disconnect(actionPreferences, SIGNAL(triggered()), this, SLOT(setPreferences()));
+ disconnect(actionRepopLists, SIGNAL(triggered()), this, SLOT(repopLists()));
+}
+
+/*
+ * Enter wait state
+ */
+void MainWin::waitEnter()
+{
+ if (m_waitState){
+ if (mainWin->m_connDebug)
+ Pmsg0(000, "Should Never Get Here DANGER DANGER, for now I'll return\n");
+ return;
+ }
+ m_waitState = true;
+ if (mainWin->m_connDebug)
+ Pmsg0(000, "Entering Wait State\n");
+ app->setOverrideCursor(QCursor(Qt::WaitCursor));
+ disconnectSignals();
+ disconnectConsoleSignals(m_currentConsole);
+ m_waitTreeItem = treeWidget->currentItem();
+}
+
+/*
+ * Leave wait state
+ */
+void MainWin::waitExit()
+{
+ m_waitState = false;
+ if (mainWin->m_connDebug)
+ Pmsg0(000, "Exiting Wait State\n");
+ app->restoreOverrideCursor();
+ if (m_waitTreeItem != treeWidget->currentItem())
+ treeWidget->setCurrentItem(m_waitTreeItem);
+ if (m_doConnect) {
+ connectSignals();
+ connectConsoleSignals();
+ }
+}
+
+void MainWin::connectConsoleSignals()
+{
+ connect(actionConnect, SIGNAL(triggered()), m_currentConsole, SLOT(connect_dir()));
+ connect(actionSelectFont, SIGNAL(triggered()), m_currentConsole, SLOT(set_font()));
+ connect(actionStatusDir, SIGNAL(triggered()), m_currentConsole, SLOT(status_dir()));
+ connect(actionMessages, SIGNAL(triggered()), m_currentConsole, SLOT(messages()));
+}
+
+void MainWin::disconnectConsoleSignals(Console *console)
+{
+ disconnect(actionConnect, SIGNAL(triggered()), console, SLOT(connect_dir()));
+ disconnect(actionStatusDir, SIGNAL(triggered()), console, SLOT(status_dir()));
+ disconnect(actionMessages, SIGNAL(triggered()), console, SLOT(messages()));
+ disconnect(actionSelectFont, SIGNAL(triggered()), console, SLOT(set_font()));
+}
+
+void MainWin::repopLists()
+{
+ m_currentConsole->populateLists(false);