From: Kern Sibbald Date: Sat, 23 Jun 2007 14:56:32 +0000 (+0000) Subject: Always allow keyboard input X-Git-Tag: Release-7.0.0~6088 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=727071fe368ab673fbe10e7b70349c76c7f96296;p=bacula%2Fbacula Always allow keyboard input git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5073 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index 277ded583b..0dcf4f6015 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -422,7 +422,8 @@ void MainWin::input_line() QString cmdStr = lineEdit->text(); /* Get the text */ lineEdit->clear(); /* clear the lineEdit box */ if (m_currentConsole->is_connected()) { - m_currentConsole->consoleCommand(cmdStr); + /* Use consoleInput to allow typing anything */ + m_currentConsole->consoleInput(cmdStr); } else { set_status("Director not connected. Click on connect button."); } diff --git a/bacula/src/qt-console/pages.cpp b/bacula/src/qt-console/pages.cpp index f5de282384..1e37bd8d67 100644 --- a/bacula/src/qt-console/pages.cpp +++ b/bacula/src/qt-console/pages.cpp @@ -207,9 +207,20 @@ void Pages::consoleCommand(QString &command) { /*if (!m_console->is_connectedGui()) return;*/ - if (!m_console->preventInUseConnect()) + if (!m_console->preventInUseConnect()) { return; - /* Bring this directors console to the front of the stack */ + } + consoleInput(command); +} + +/* + * Function to simplify executing a console command, but does not + * check for the connection in use. We need this so that we can + * *always* enter command from the command line. + */ +void Pages::consoleInput(QString &command) +{ + /* Bring this director's console to the front of the stack */ setConsoleCurrent(); QString displayhtml(""); displayhtml += command + "\n"; diff --git a/bacula/src/qt-console/pages.h b/bacula/src/qt-console/pages.h index 6f9fb4716a..483911f469 100644 --- a/bacula/src/qt-console/pages.h +++ b/bacula/src/qt-console/pages.h @@ -70,6 +70,7 @@ public: void setContextMenuDockText(); void setTreeWidgetItemDockColor(); void consoleCommand(QString &); + void consoleInput(QString &); public slots: /* closeEvent is a virtual function inherited from QWidget */ diff --git a/bacula/src/qt-console/restore/restoretree.cpp b/bacula/src/qt-console/restore/restoretree.cpp index 0b8573960f..a987ac7923 100644 --- a/bacula/src/qt-console/restore/restoretree.cpp +++ b/bacula/src/qt-console/restore/restoretree.cpp @@ -237,7 +237,7 @@ bool restoreTree::addDirectory(QString &m_cwd, QString &newdirr) /* no need to check for windows drive if unix */ if (m_winRegExpDrive.indexIn(m_cwd, 0) == 0) { /* this is a windows drive add the base widget */ - QTreeWidgetItem *item = item = new QTreeWidgetItem(directoryTree); + QTreeWidgetItem *item = new QTreeWidgetItem(directoryTree); item->setIcon(0, QIcon(QString::fromUtf8(":images/folder.png"))); item->setText(0, m_cwd); item->setData(0, Qt::UserRole, QVariant(fullpath));