From 7e9897cfc7b530811754187afd2222f3e91429fa Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Sat, 13 Jun 2009 15:30:42 +0000 Subject: [PATCH] Add feature in pages to have a console command that does not set the console current. Then also use that feature in joblist to purge or delete a job. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8897 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/joblist/joblist.cpp | 6 ++++-- bacula/src/qt-console/pages.cpp | 12 ++++++++++-- bacula/src/qt-console/pages.h | 2 ++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index 0a838e44a5..38dc8aea3e 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -486,7 +486,8 @@ void JobList::consoleDeleteJob() QString cmd("delete job jobid="); cmd += m_selectedJobs; - consoleCommand(cmd); + consoleCommand(cmd, false); + populateTable(); } void JobList::consolePurgeFiles() { @@ -505,8 +506,9 @@ void JobList::consolePurgeFiles() foreach(QString job, m_selectedJobsList) { QString cmd("purge files jobid="); cmd += job; - consoleCommand(cmd); + consoleCommand(cmd, false); } + populateTable(); } /* diff --git a/bacula/src/qt-console/pages.cpp b/bacula/src/qt-console/pages.cpp index 2767a584ee..d9027b8581 100644 --- a/bacula/src/qt-console/pages.cpp +++ b/bacula/src/qt-console/pages.cpp @@ -229,6 +229,10 @@ void Pages::treeWidgetName(QString &name) * console to the front of the stack */ void Pages::consoleCommand(QString &command) +{ + consoleCommand(command, true); +} +void Pages::consoleCommand(QString &command, bool setCurrent) { int conn; bool donotify = false; @@ -237,14 +241,18 @@ void Pages::consoleCommand(QString &command) donotify = true; m_console->notify(conn, false); } - consoleCommand(command, conn); + consoleCommand(command, conn, setCurrent); if (donotify) { m_console->notify(conn, true); } } } void Pages::consoleCommand(QString &command, int conn) +{ + consoleCommand(command, conn, true); +} +void Pages::consoleCommand(QString &command, int conn, bool setCurrent) { /* Bring this director's console to the front of the stack */ - setConsoleCurrent(); + if (setCurrent) { setConsoleCurrent(); } QString displayhtml(""); displayhtml += command + "\n"; m_console->display_html(displayhtml); diff --git a/bacula/src/qt-console/pages.h b/bacula/src/qt-console/pages.h index 1af475f2bf..4aec85e6ec 100644 --- a/bacula/src/qt-console/pages.h +++ b/bacula/src/qt-console/pages.h @@ -71,6 +71,8 @@ public: void setTreeWidgetItemDockColor(); void consoleCommand(QString &); void consoleCommand(QString &, int conn); + void consoleCommand(QString &, bool setCurrent); + void consoleCommand(QString &, int conn, bool setCurrent); QString &name() { return m_name; }; void getVolumeList(QStringList &); void getStatusList(QStringList &); -- 2.39.5