*/
bool Console::dir_cmd(int conn, const char *cmd, QStringList &results)
{
+ mainWin->waitEnter();
DirComm *dircomm = m_dircommHash.value(conn);
int stat;
if (stat > 0 && mainWin->m_displayAll) display_text(dircomm->msg());
notify(conn, true);
discardToPrompt(conn);
+ mainWin->waitExit();
return true; /* ***FIXME*** return any command error */
}
Pmsg2(000, "sql_cmd conn %i %s\n", conn, query);
if (donotify)
dircomm->notify(false);
+ mainWin->waitEnter();
pm_strcpy(cmd, ".sql query=\"");
pm_strcat(cmd, query);
if (donotify)
dircomm->notify(true);
discardToPrompt(conn);
+ mainWin->waitExit();
return true; /* ***FIXME*** return any command error */
}
if (dircomm->m_sock) {
mainWin->set_status(_("Processing command ..."));
- QApplication::setOverrideCursor(Qt::WaitCursor);
+ mainWin->waitEnter();
dircomm->write(msg);
+ mainWin->waitExit();
} else {
mainWin->set_status( tr(" Director not connected. Click on connect button."));
mainWin->actionConnect->setIcon(QIcon(":images/disconnected.png"));
int Console::write(int conn, const QString msg)
{
DirComm *dircomm = m_dircommHash.value(conn);
- return dircomm->write(msg);
+ mainWin->waitEnter();
+ int ret = dircomm->write(msg);
+ mainWin->waitExit();
+ return ret;
}
int Console::write(int conn, const char *msg)
{
DirComm *dircomm = m_dircommHash.value(conn);
- return dircomm->write(msg);
+ mainWin->waitEnter();
+ int ret = dircomm->write(msg);
+ mainWin->waitExit();
+ return ret;
}
/* This checks to see if any is connected */
connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(input_line()));
connect(actionAbout_bat, SIGNAL(triggered()), this, SLOT(about()));
connect(actionBat_Help, SIGNAL(triggered()), this, SLOT(help()));
- connect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this,
- SLOT(treeItemClicked(QTreeWidgetItem *, int)));
- connect(treeWidget, SIGNAL(
- currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
- this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
- connect(stackedWidget, SIGNAL(currentChanged(int)),
- this, SLOT(stackItemChanged(int)));
+ connect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(treeItemClicked(QTreeWidgetItem *, int)));
+ connect(treeWidget, SIGNAL( currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
+ connect(stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(stackItemChanged(int)));
connect(actionQuit, SIGNAL(triggered()), app, SLOT(closeAllWindows()));
connect(actionLabel, SIGNAL(triggered()), this, SLOT(labelButtonClicked()));
connect(actionRun, SIGNAL(triggered()), this, SLOT(runButtonClicked()));
connect(actionPreferences, SIGNAL(triggered()), this, SLOT(setPreferences()));
}
+void MainWin::disconnectConnections()
+{
+ /* 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()));
+}
+
+/*
+ * Enter wait state
+ */
+void MainWin::waitEnter()
+{
+ app->setOverrideCursor(QCursor(Qt::WaitCursor));
+ disconnectConnections();
+}
+
+/*
+ * Leave wait state
+ */
+void MainWin::waitExit()
+{
+ app->restoreOverrideCursor();
+ createConnections();
+}
+
/*
* Reimplementation of QWidget closeEvent virtual function
*/