MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
{
+ app->setOverrideCursor(QCursor(Qt::WaitCursor));
m_isClosing = false;
+ m_waitState = false;
+ m_doConnect = false;
m_dtformat = "yyyy-MM-dd HH:mm:ss";
mainWin = this;
setupUi(this); /* Setup UI defined by main.ui (designer) */
createPages();
- resetFocus();
-
- connectSignals();
+ resetFocus(); /* lineEdit->setFocus() */
#ifndef HAVE_QWT
actionJobPlot->setEnabled(false);
readSettings();
- foreach(Console *console, m_consoleHash) {
+ foreach(Console *console, m_consoleHash)
console->connect_dir();
- }
m_currentConsole = (Console*)getFromHash(m_firstItem);
- m_currentConsole->setCurrent();
- connectConsoleSignals();
+ QTimer::singleShot(750, this, SLOT(popLists()));
if (m_miscDebug) {
QString directoryResourceName;
m_currentConsole->getDirResName(directoryResourceName);
}
}
+void MainWin::popLists()
+{
+ foreach(Console *console, m_consoleHash)
+ console->populateLists(true);
+ app->restoreOverrideCursor();
+ m_doConnect = true;
+ connectConsoleSignals();
+ connectSignals();
+ m_currentConsole->setCurrent();
+}
+
void MainWin::createPages()
{
DIRRES *dir;
connect(actionToggleDock, SIGNAL(triggered()), this, SLOT(toggleDockContextWindow()));
connect(actionClosePage, SIGNAL(triggered()), this, SLOT(closePage()));
connect(actionPreferences, SIGNAL(triggered()), this, SLOT(setPreferences()));
+ connect(actionRepopLists, SIGNAL(triggered()), this, SLOT(repopLists()));
}
void MainWin::disconnectSignals()
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()));
}
/*
*/
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();
}
/*
*/
void MainWin::waitExit()
{
+ m_waitState = false;
+ if (mainWin->m_connDebug)
+ Pmsg0(000, "Exiting Wait State\n");
app->restoreOverrideCursor();
- connectSignals();
+ if (m_waitTreeItem != treeWidget->currentItem())
+ treeWidget->setCurrentItem(m_waitTreeItem);
+ if (m_doConnect) {
+ connectSignals();
+ connectConsoleSignals();
+ }
}
void MainWin::connectConsoleSignals()
disconnect(actionSelectFont, SIGNAL(triggered()), console, SLOT(set_font()));
}
+void MainWin::repopLists()
+{
+ m_currentConsole->populateLists(false);
+}
+
/*
* Reimplementation of QWidget closeEvent virtual function
*/
QString cmdStr = lineEdit->text(); /* Get the text */
lineEdit->clear(); /* clear the lineEdit box */
if (m_currentConsole->is_connected()) {
- /* Use consoleInput to allow typing anything */
- m_currentConsole->consoleInput(cmdStr);
+ /* Use consoleCommand to allow typing anything */
+ m_currentConsole->consoleCommand(cmdStr);
} else {
set_status(tr("Director not connected. Click on connect button."));
}
{
return m_currentConsole;
}
+
/* Quick function to return the tree item for the director */
QTreeWidgetItem *MainWin::currentTopItem()
{