From a9f64b710534b13114e04f119aecac91471f8165 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sat, 1 Aug 2009 19:11:03 +0200 Subject: [PATCH] add refresh and delete event --- bacula/src/qt-console/job/job.cpp | 37 +++++++++++++++++++++++++--- bacula/src/qt-console/job/job.h | 2 ++ bacula/src/qt-console/job/job.ui | 41 ++++++++++++++++++++----------- 3 files changed, 63 insertions(+), 17 deletions(-) diff --git a/bacula/src/qt-console/job/job.cpp b/bacula/src/qt-console/job/job.cpp index aa4ff3be8c..5c8568ba1e 100644 --- a/bacula/src/qt-console/job/job.cpp +++ b/bacula/src/qt-console/job/job.cpp @@ -50,13 +50,35 @@ Job::Job(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem) m_jobId = jobId; getFont(); - populateText(); - populateForm(); - populateVolumes(); + + connect(pbRefresh, SIGNAL(clicked()), this, SLOT(populateAll())); + connect(pbDelete, SIGNAL(clicked()), this, SLOT(deleteJob())); + + populateAll(); dockPage(); setCurrent(); } +void Job::deleteJob() +{ + if (QMessageBox::warning(this, "Bat", + tr("Are you sure you want to delete?? !!!.\n" +"This delete command is used to delete a Job record and all associated catalog" +" records that were created. This command operates only on the Catalog" +" database and has no effect on the actual data written to a Volume. This" +" command can be dangerous and we strongly recommend that you do not use" +" it unless you know what you are doing. The Job and all its associated" +" records (File and JobMedia) will be deleted from the catalog." + "Press OK to proceed with delete operation.?"), + QMessageBox::Ok | QMessageBox::Cancel) + == QMessageBox::Cancel) { return; } + + QString cmd("delete job jobid="); + cmd += m_jobId; + consoleCommand(cmd, false); + closeStackPage(); +} + void Job::getFont() { QFont font = textJobLog->font(); @@ -72,11 +94,20 @@ void Job::getFont() textJobLog->setFont(font); } +void Job::populateAll() +{ + Pmsg0(0, "populateAll()\n"); + populateText(); + populateForm(); + populateVolumes(); +} + /* * Populate the text in the window */ void Job::populateText() { + textJobLog->clear(); QString query; query = "SELECT Time, LogText FROM Log WHERE JobId='" + m_jobId + "' order by Time"; diff --git a/bacula/src/qt-console/job/job.h b/bacula/src/qt-console/job/job.h index 2597ab36f8..9074c237a5 100644 --- a/bacula/src/qt-console/job/job.h +++ b/bacula/src/qt-console/job/job.h @@ -40,6 +40,8 @@ public: Job(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem); public slots: + void populateAll(); + void deleteJob(); private slots: diff --git a/bacula/src/qt-console/job/job.ui b/bacula/src/qt-console/job/job.ui index b20fc09dba..b6e27a48a3 100644 --- a/bacula/src/qt-console/job/job.ui +++ b/bacula/src/qt-console/job/job.ui @@ -5,7 +5,7 @@ 0 0 - 855 + 857 757 @@ -208,7 +208,7 @@ 10 20 - 231 + 247 151 @@ -455,26 +455,25 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html> +</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"></p></body></html> - textJobLog 10 10 - 661 + 776 31 - + Delete @@ -488,7 +487,7 @@ p, li { white-space: pre-wrap; } - + View errors for this Job @@ -505,7 +504,7 @@ p, li { white-space: pre-wrap; } - + Media @@ -519,7 +518,7 @@ p, li { white-space: pre-wrap; } - + History @@ -533,7 +532,7 @@ p, li { white-space: pre-wrap; } - + 0 @@ -553,7 +552,7 @@ p, li { white-space: pre-wrap; } - + Read doc @@ -563,7 +562,7 @@ p, li { white-space: pre-wrap; } - + FileSet @@ -577,7 +576,7 @@ p, li { white-space: pre-wrap; } - + Stats @@ -590,6 +589,20 @@ p, li { white-space: pre-wrap; } + + + + Refresh + + + + :/images/view-refresh.png:/images/view-refresh.png + + + true + + + -- 2.39.5