]> git.sur5r.net Git - bacula/bacula/commitdiff
Add feature in pages to have a console command that does not set the console
authorDirk H Bartley <dbartley@schupan.com>
Sat, 13 Jun 2009 15:30:42 +0000 (15:30 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Sat, 13 Jun 2009 15:30:42 +0000 (15:30 +0000)
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
bacula/src/qt-console/pages.cpp
bacula/src/qt-console/pages.h

index 0a838e44a53431054d0502c757d0ed13fe6b45f1..38dc8aea3e45fc50ae963ba3bdee3067f6aa99f6 100644 (file)
@@ -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();
 }
 
 /*
index 2767a584ee40a06d9a4710a4a473c6027dca6680..d9027b85812b13bca785562555cea9adf405e371 100644 (file)
@@ -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("<font color=\"blue\">");
    displayhtml += command + "</font>\n";
    m_console->display_html(displayhtml);
index 1af475f2bf3a12e95817698219690c7ab2640f32..4aec85e6ecd94768a47a44fdff8b52bc6c3a2900 100644 (file)
@@ -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 &);