return false;
}
+
+/*
+ * Need current connection.
+ */
+bool Console::currentDirComm(int &conn)
+{
+ QHash<int, DirComm*>::const_iterator iter = m_dircommHash.constBegin();
+ while (iter != m_dircommHash.constEnd()) {
+ DirComm *dircomm = iter.value();
+ if (dircomm->m_at_prompt && !dircomm->m_at_main_prompt && dircomm->is_notify_enabled()) {
+ conn = dircomm->m_conn;
+ return true;
+ }
+ ++iter;
+ }
+ return false;
+}
+
/*
* Create a new connection
*/
bool notify(int conn, bool enable); // enables/disables socket notification - returns the previous state
bool is_notify_enabled(int conn) const;
bool availableDirComm(int &conn);
+ bool currentDirComm(int &conn);
void displayToPrompt(int conn);
bool dir_cmd(int conn, const char *cmd, QStringList &results);
void MainWin::waitExit()
{
m_waitState = false;
- if (mainWin->m_connDebug)
- Pmsg0(000, "Exiting Wait State\n");
+ if (mainWin->m_connDebug) Pmsg0(000, "Exiting Wait State\n");
app->restoreOverrideCursor();
if (m_waitTreeItem != treeWidget->currentItem())
treeWidget->setCurrentItem(m_waitTreeItem);
*/
void MainWin::input_line()
{
+ int conn;
QString cmdStr = lineEdit->text(); /* Get the text */
lineEdit->clear(); /* clear the lineEdit box */
if (m_currentConsole->is_connected()) {
- /* Use consoleCommand to allow typing anything */
- m_currentConsole->consoleCommand(cmdStr);
+ if (m_currentConsole->currentDirComm(conn)) {
+ m_currentConsole->consoleCommand(cmdStr, conn);
+ } else {
+ /* Use consoleCommand to allow typing anything */
+ m_currentConsole->consoleCommand(cmdStr);
+ }
} else {
set_status(tr("Director not connected. Click on connect button."));
}