]> git.sur5r.net Git - bacula/bacula/commitdiff
Always allow keyboard input
authorKern Sibbald <kern@sibbald.com>
Sat, 23 Jun 2007 14:56:32 +0000 (14:56 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 23 Jun 2007 14:56:32 +0000 (14:56 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5073 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/mainwin.cpp
bacula/src/qt-console/pages.cpp
bacula/src/qt-console/pages.h
bacula/src/qt-console/restore/restoretree.cpp

index 277ded583b733675b4fe2333ff50023254a4dae9..0dcf4f60158fba25f555548e476938437ba313ae 100644 (file)
@@ -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.");
    }
index f5de2823841de8fbb7ad4993ed7848a363956e5a..1e37bd8d677089b8f934d7bb351ab5b01b7e344d 100644 (file)
@@ -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("<font color=\"blue\">");
    displayhtml += command + "</font>\n";
index 6f9fb4716afb147e0eb11796c6c2cdf1c62c9c1b..483911f469e59e9cf026a3cc34dd44df42f5fb5e 100644 (file)
@@ -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 */
index 0b8573960fb6cba947bca7a4f0bf8e7f356cb34b..a987ac792366dfd01c514dbaeb7d2542fb8283c0 100644 (file)
@@ -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));