]> git.sur5r.net Git - bacula/bacula/commitdiff
add refresh and delete event
authorEric Bollengier <eric@eb.homelinux.org>
Sat, 1 Aug 2009 17:11:03 +0000 (19:11 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Mon, 3 Aug 2009 14:16:00 +0000 (16:16 +0200)
bacula/src/qt-console/job/job.cpp
bacula/src/qt-console/job/job.h
bacula/src/qt-console/job/job.ui

index aa4ff3be8c678764837c30ad5aa344fdcde7b873..5c8568ba1e2c632f2bd2185725d350cf634c6ad8 100644 (file)
@@ -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";
 
index 2597ab36f8ceeffbd5261f7f990d25fa7be074e9..9074c237a55ec2617f8d8e637670e1b420211806 100644 (file)
@@ -40,6 +40,8 @@ public:
    Job(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem);
 
 public slots:
+   void populateAll();
+   void deleteJob();
 
 private slots:
 
index b20fc09dba77cfc9bcbab072553e300be5591b72..b6e27a48a334b454bdce1a88d4904bc13fd0e9c5 100644 (file)
@@ -5,7 +5,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>855</width>
+    <width>857</width>
     <height>757</height>
    </rect>
   </property>
      <rect>
       <x>10</x>
       <y>20</y>
-      <width>231</width>
+      <width>247</width>
       <height>151</height>
      </rect>
     </property>
        <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
 &lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
 p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'DejaVu Sans'; font-size:10pt; font-weight:400; font-style:normal;">
-&lt;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;">&lt;/p>&lt;/body>&lt;/html></string>
+&lt;/style>&lt;/head>&lt;body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
+&lt;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;">&lt;/p>&lt;/body>&lt;/html></string>
       </property>
      </widget>
     </item>
    </layout>
-   <zorder>textJobLog</zorder>
   </widget>
   <widget class="QWidget" name="layoutWidget" >
    <property name="geometry" >
     <rect>
      <x>10</x>
      <y>10</y>
-     <width>661</width>
+     <width>776</width>
      <height>31</height>
     </rect>
    </property>
    <layout class="QHBoxLayout" name="horizontalLayout" >
     <item>
-     <widget class="QPushButton" name="pushButton" >
+     <widget class="QPushButton" name="pbDelete" >
       <property name="text" >
        <string>Delete</string>
       </property>
@@ -488,7 +487,7 @@ p, li { white-space: pre-wrap; }
      </widget>
     </item>
     <item>
-     <widget class="QPushButton" name="pushButton_8" >
+     <widget class="QPushButton" name="pbErrors" >
       <property name="toolTip" >
        <string>View errors for this Job</string>
       </property>
@@ -505,7 +504,7 @@ p, li { white-space: pre-wrap; }
      </widget>
     </item>
     <item>
-     <widget class="QPushButton" name="pushButton_3" >
+     <widget class="QPushButton" name="pbMedia" >
       <property name="text" >
        <string>Media</string>
       </property>
@@ -519,7 +518,7 @@ p, li { white-space: pre-wrap; }
      </widget>
     </item>
     <item>
-     <widget class="QPushButton" name="pushButton_5" >
+     <widget class="QPushButton" name="pbHistory" >
       <property name="text" >
        <string>History</string>
       </property>
@@ -533,7 +532,7 @@ p, li { white-space: pre-wrap; }
      </widget>
     </item>
     <item>
-     <widget class="QPushButton" name="pushButton_2" >
+     <widget class="QPushButton" name="pbRun" >
       <property name="sizePolicy" >
        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
         <horstretch>0</horstretch>
@@ -553,7 +552,7 @@ p, li { white-space: pre-wrap; }
      </widget>
     </item>
     <item>
-     <widget class="QPushButton" name="pushButton_6" >
+     <widget class="QPushButton" name="pbDoc" >
       <property name="text" >
        <string>Read doc</string>
       </property>
@@ -563,7 +562,7 @@ p, li { white-space: pre-wrap; }
      </widget>
     </item>
     <item>
-     <widget class="QPushButton" name="pushButton_7" >
+     <widget class="QPushButton" name="pbFileSet" >
       <property name="text" >
        <string>FileSet</string>
       </property>
@@ -577,7 +576,7 @@ p, li { white-space: pre-wrap; }
      </widget>
     </item>
     <item>
-     <widget class="QPushButton" name="pushButton_4" >
+     <widget class="QPushButton" name="pbStats" >
       <property name="text" >
        <string>Stats</string>
       </property>
@@ -590,6 +589,20 @@ p, li { white-space: pre-wrap; }
       </property>
      </widget>
     </item>
+    <item>
+     <widget class="QPushButton" name="pbRefresh" >
+      <property name="text" >
+       <string>Refresh</string>
+      </property>
+      <property name="icon" >
+       <iconset resource="../main.qrc" >
+        <normaloff>:/images/view-refresh.png</normaloff>:/images/view-refresh.png</iconset>
+      </property>
+      <property name="flat" >
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
    </layout>
   </widget>
  </widget>