From 8ce5c3019aa835ff1e0e2fda1db89e9f36ec5e4c Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Sun, 22 Apr 2007 19:43:11 +0000 Subject: [PATCH] Auto select console tree widget of current console when a command is entered in the console command line entry LineEdit box. Display and dress up the context sensitive command when a popup menu is pressed causing a console command to be entered. I'd almost prefer to see if there is a way to have the command entered be BOLD or something to bring it out. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4598 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/TODO | 5 +++++ bacula/src/qt-console/clients/clients.cpp | 2 +- bacula/src/qt-console/fileset/fileset.cpp | 2 +- bacula/src/qt-console/mainwin.cpp | 3 +++ bacula/src/qt-console/pages.cpp | 4 ++++ bacula/src/qt-console/storage/storage.cpp | 2 +- 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bacula/src/qt-console/TODO b/bacula/src/qt-console/TODO index 5aa5cb6399..7939e91702 100644 --- a/bacula/src/qt-console/TODO +++ b/bacula/src/qt-console/TODO @@ -51,6 +51,11 @@ global one defined in the mainWin class (if I remember right). ============================================================ DONE: ============================================================ +If the console command line entry docked widget gets the focus, make +m_currentConsole the top widget by setting the treewidgetitem selected. +Did this in MainWin::input_line almost better to let the person see +whatever they want until they hit enter. + Set Window titles to reflect what director it is. Must:: get page selector to follow undocked windows. Otherwise diff --git a/bacula/src/qt-console/clients/clients.cpp b/bacula/src/qt-console/clients/clients.cpp index c4089d57c4..c78cd37635 100644 --- a/bacula/src/qt-console/clients/clients.cpp +++ b/bacula/src/qt-console/clients/clients.cpp @@ -204,7 +204,7 @@ void Clients::showJobs() void Clients::consoleStatusClient() { QString cmd("status client="); - cmd += m_currentlyselected += "\n"; + cmd += m_currentlyselected; consoleCommand(cmd); } diff --git a/bacula/src/qt-console/fileset/fileset.cpp b/bacula/src/qt-console/fileset/fileset.cpp index eb2337ed42..395d0bd6fa 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -189,7 +189,7 @@ void FileSet::createContextMenu() void FileSet::consoleStatusFileSet() { QString cmd("status fileset="); - cmd += m_currentlyselected += "\n"; + cmd += m_currentlyselected; consoleCommand(cmd); // m_console->write_dir(cmd.toUtf8().data()); // m_console->displayToPrompt(); diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index 300510d90c..0f94ba6e79 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -453,6 +453,9 @@ void MainWin::input_line() } m_cmd_history.append(cmdStr); m_cmd_last = -1; + if (treeWidget->currentItem() != getFromHash(m_currentConsole)){ + treeWidget->setCurrentItem(getFromHash(m_currentConsole)); + } } diff --git a/bacula/src/qt-console/pages.cpp b/bacula/src/qt-console/pages.cpp index 907e551498..1ef945f892 100644 --- a/bacula/src/qt-console/pages.cpp +++ b/bacula/src/qt-console/pages.cpp @@ -213,6 +213,10 @@ void Pages::treeWidgetName(QString &name) */ void Pages::consoleCommand(QString &command) { + m_console->display_text("Context sensitive command :\n\n"); + m_console->display_text("**** "); + m_console->display_text(command + " ****\n"); + m_console->display_text("Director Response :\n\n"); m_console->write_dir(command.toUtf8().data()); m_console->displayToPrompt(); /* Bring this directors console to the front of the stack */ diff --git a/bacula/src/qt-console/storage/storage.cpp b/bacula/src/qt-console/storage/storage.cpp index 2001bcad08..8a8f7f06c0 100644 --- a/bacula/src/qt-console/storage/storage.cpp +++ b/bacula/src/qt-console/storage/storage.cpp @@ -189,7 +189,7 @@ void Storage::createContextMenu() void Storage::consoleStatusStorage() { QString cmd("status storage="); - cmd += m_currentlyselected += "\n"; + cmd += m_currentlyselected; consoleCommand(cmd); // m_console->write_dir(cmd.toUtf8().data()); // m_console->displayToPrompt(); -- 2.39.5