]> git.sur5r.net Git - bacula/bacula/commitdiff
bat: Add a re-run button on job info page, that allows to
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 13 Aug 2009 15:36:32 +0000 (17:36 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 13 Aug 2009 15:36:32 +0000 (17:36 +0200)
     run the selected job with the same properties (level, pool,
     etc...)

bacula/src/qt-console/job/job.cpp
bacula/src/qt-console/job/job.h
bacula/src/qt-console/job/job.ui
bacula/src/qt-console/run/run.cpp
bacula/src/qt-console/run/run.h
bacula/technotes

index f5f2f7fb3c9e2e116ffb2c8535cfb84ecfa9f7f1..42d51b21c03854a85287ce6d88b42821b77cc48b 100644 (file)
@@ -30,6 +30,7 @@
 #include "job.h"
 #include "util/fmtwidgetitem.h"
 #include "mediainfo/mediainfo.h"
+#include "run/run.h"
 
 Job::Job(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem)
 {
@@ -45,6 +46,7 @@ Job::Job(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem)
 
    connect(pbRefresh, SIGNAL(clicked()), this, SLOT(populateAll()));
    connect(pbDelete, SIGNAL(clicked()), this, SLOT(deleteJob()));
+   connect(pbRun, SIGNAL(clicked()), this, SLOT(rerun()));
    connect(list_Volume, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(showInfoVolume(QListWidgetItem *)));
 
    populateAll();
@@ -52,6 +54,16 @@ Job::Job(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem)
    setCurrent();
 }
 
+void Job::rerun()
+{
+   new runPage(label_Name->text(),
+               label_Level->text(),
+               label_Pool->text(),
+               QString(""),              // storage
+               label_Client->text(),
+               label_FileSet->text());
+}
+
 void Job::showInfoVolume(QListWidgetItem *item)
 {
    QString s= item->text();
index 2b3d04648995c9b427f800ffe749a56946494a89..45dcdb86e2d3276d4350df046aa94c5e5617c1ff 100644 (file)
@@ -43,6 +43,7 @@ public slots:
    void populateAll();
    void deleteJob();
    void showInfoVolume(QListWidgetItem *);
+   void rerun();
 
 private slots:
 
index 4a74afca01b811947523acc622ee6a6da7270172..169c8d26379dc2b3af75c38ad55262bb871b890b 100644 (file)
@@ -87,9 +87,6 @@
        </item>
        <item>
         <widget class="QPushButton" name="pbRun" >
-         <property name="enabled" >
-          <bool>false</bool>
-         </property>
          <property name="sizePolicy" >
           <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
            <horstretch>0</horstretch>
index beccbce818a0d1223b48a6f0a93396de89f127a5..714aac3f3574926494116048bbbe8e2f5131edb2 100644 (file)
 #include "bat.h"
 #include "run.h"
 
+
+runPage::runPage()
+{
+   init();
+   show();
+}
+
+runPage::runPage(const QString &defJob)
+{
+   init();
+   if (defJob != "")
+      jobCombo->setCurrentIndex(jobCombo->findText(defJob, Qt::MatchExactly));
+   show();
+}
+
+
+runPage::runPage(const QString &defJob, const QString &level, 
+                 const QString &pool, const QString &storage,
+                 const QString &client, const QString &fileset)
+{
+   init();
+   jobCombo->setCurrentIndex(jobCombo->findText(defJob, Qt::MatchExactly));
+   job_name_change(0);
+   filesetCombo->setCurrentIndex(filesetCombo->findText(fileset,
+                                                        Qt::MatchExactly));
+   levelCombo->setCurrentIndex(levelCombo->findText(level, Qt::MatchExactly));
+   clientCombo->setCurrentIndex(clientCombo->findText(client,Qt::MatchExactly));
+   poolCombo->setCurrentIndex(poolCombo->findText(pool, Qt::MatchExactly));
+
+   if (storage != "") {         // TODO: enable storage
+      storageCombo->setCurrentIndex(storageCombo->findText(storage, 
+                                                           Qt::MatchExactly));
+   }
+   show();
+}
+
+
 /*
  * Setup all the combo boxes and display the dialog
  */
-runPage::runPage(const QString &defJob)
+void runPage::init()
 {
    QDateTime dt;
 
@@ -75,9 +112,6 @@ runPage::runPage(const QString &defJob)
    // or in the midle of the page
 //   dockPage();
    setCurrent();
-   this->show();
-   if (defJob != "")
-      jobCombo->setCurrentIndex(jobCombo->findText(defJob, Qt::MatchExactly));
 }
 
 void runPage::okButtonPushed()
index a666f7653cff1e60c498d33a691e62b9dd5d4534..85d3e2730b76c827fbac48e5f0da94423279dc80 100644 (file)
@@ -41,14 +41,24 @@ class runPage : public Pages, public Ui::runForm
    Q_OBJECT 
 
 public:
+   runPage();
+
    runPage(const QString &defJob);
 
+   runPage(const QString &defJob, 
+           const QString &level,
+           const QString &pool,
+           const QString &storage,
+           const QString &client,
+           const QString &fileset);
+
 public slots:
    void okButtonPushed();
    void cancelButtonPushed();
    void job_name_change(int index);
 
 private:
+   void init();
    int m_conn;
 };
 
index 920951baa484030db223f25874b8f5d677742321..30590f5d0f3bf326473ba4fdf21d8b0d71710c67 100644 (file)
@@ -3,6 +3,9 @@
 General:
 
 13Aug09
+ebl  bat: Add a re-run button on job info page, that allows to
+          run the selected job with the same properties (level, pool, 
+          etc...)
 ebl  bat: tweak the run job window to make it a bit more sexy
 12Aug09
 kes  Make new big-virtual-changer test. Test concurrency.