From: Eric Bollengier Date: Thu, 13 Aug 2009 15:36:32 +0000 (+0200) Subject: bat: Add a re-run button on job info page, that allows to X-Git-Tag: Release-5.0.0~333^2~3^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dec3b240cbd1fd04273f869308ced2b57db0277f;p=bacula%2Fbacula bat: Add a re-run button on job info page, that allows to run the selected job with the same properties (level, pool, etc...) --- diff --git a/bacula/src/qt-console/job/job.cpp b/bacula/src/qt-console/job/job.cpp index f5f2f7fb3c..42d51b21c0 100644 --- a/bacula/src/qt-console/job/job.cpp +++ b/bacula/src/qt-console/job/job.cpp @@ -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(); diff --git a/bacula/src/qt-console/job/job.h b/bacula/src/qt-console/job/job.h index 2b3d046489..45dcdb86e2 100644 --- a/bacula/src/qt-console/job/job.h +++ b/bacula/src/qt-console/job/job.h @@ -43,6 +43,7 @@ public slots: void populateAll(); void deleteJob(); void showInfoVolume(QListWidgetItem *); + void rerun(); private slots: diff --git a/bacula/src/qt-console/job/job.ui b/bacula/src/qt-console/job/job.ui index 4a74afca01..169c8d2637 100644 --- a/bacula/src/qt-console/job/job.ui +++ b/bacula/src/qt-console/job/job.ui @@ -87,9 +87,6 @@ - - false - 0 diff --git a/bacula/src/qt-console/run/run.cpp b/bacula/src/qt-console/run/run.cpp index beccbce818..714aac3f35 100644 --- a/bacula/src/qt-console/run/run.cpp +++ b/bacula/src/qt-console/run/run.cpp @@ -37,10 +37,47 @@ #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() diff --git a/bacula/src/qt-console/run/run.h b/bacula/src/qt-console/run/run.h index a666f7653c..85d3e2730b 100644 --- a/bacula/src/qt-console/run/run.h +++ b/bacula/src/qt-console/run/run.h @@ -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; }; diff --git a/bacula/technotes b/bacula/technotes index 920951baa4..30590f5d0f 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -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.