]> git.sur5r.net Git - bacula/bacula/commitdiff
Add new form to see job details
authorEric Bollengier <eric@eb.homelinux.org>
Sat, 1 Aug 2009 12:02:36 +0000 (12:02 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Sat, 1 Aug 2009 12:02:36 +0000 (12:02 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@9149 91ce42f0-d328-0410-95d8-f526ca767f89

17 files changed:
bacula/src/qt-console/bat.pro.in
bacula/src/qt-console/images/A.png [new file with mode: 0644]
bacula/src/qt-console/images/R.png [new file with mode: 0644]
bacula/src/qt-console/images/T.png [new file with mode: 0644]
bacula/src/qt-console/images/f.png [new file with mode: 0644]
bacula/src/qt-console/images/inflag0.png [new file with mode: 0644]
bacula/src/qt-console/images/inflag1.png [new file with mode: 0644]
bacula/src/qt-console/images/inflag2.png [new file with mode: 0644]
bacula/src/qt-console/images/purge.png [new file with mode: 0644]
bacula/src/qt-console/images/zoom.png [new file with mode: 0644]
bacula/src/qt-console/job/job.cpp [new file with mode: 0644]
bacula/src/qt-console/job/job.h [new file with mode: 0644]
bacula/src/qt-console/job/job.ui [new file with mode: 0644]
bacula/src/qt-console/joblist/joblist.cpp
bacula/src/qt-console/joblist/joblist.h
bacula/src/qt-console/joblist/joblist.ui
bacula/src/qt-console/main.qrc

index 6fc22b7ff024ac8ef454730ae013f17e798499ac..ba9d773fed63d11aa658e0e85ee8e039ac2d1405 100644 (file)
@@ -50,7 +50,7 @@ FORMS += run/run.ui run/runcmd.ui run/estimate.ui run/prune.ui
 FORMS += select/select.ui select/textinput.ui
 FORMS += medialist/medialist.ui mediaedit/mediaedit.ui joblist/joblist.ui
 FORMS += clients/clients.ui storage/storage.ui fileset/fileset.ui
-FORMS += joblog/joblog.ui jobs/jobs.ui
+FORMS += joblog/joblog.ui jobs/jobs.ui job/job.ui
 FORMS += help/help.ui
 FORMS += status/dirstat.ui
 FORMS += status/clientstat.ui
@@ -123,6 +123,10 @@ SOURCES += fileset/fileset.cpp
 HEADERS += joblog/joblog.h
 SOURCES += joblog/joblog.cpp
 
+## Job
+HEADERS += job/job.h
+SOURCES += job/job.cpp
+
 ## Jobs
 HEADERS += jobs/jobs.h
 SOURCES += jobs/jobs.cpp
diff --git a/bacula/src/qt-console/images/A.png b/bacula/src/qt-console/images/A.png
new file mode 100644 (file)
index 0000000..89c2124
Binary files /dev/null and b/bacula/src/qt-console/images/A.png differ
diff --git a/bacula/src/qt-console/images/R.png b/bacula/src/qt-console/images/R.png
new file mode 100644 (file)
index 0000000..166c220
Binary files /dev/null and b/bacula/src/qt-console/images/R.png differ
diff --git a/bacula/src/qt-console/images/T.png b/bacula/src/qt-console/images/T.png
new file mode 100644 (file)
index 0000000..d92d88d
Binary files /dev/null and b/bacula/src/qt-console/images/T.png differ
diff --git a/bacula/src/qt-console/images/f.png b/bacula/src/qt-console/images/f.png
new file mode 100644 (file)
index 0000000..89c2124
Binary files /dev/null and b/bacula/src/qt-console/images/f.png differ
diff --git a/bacula/src/qt-console/images/inflag0.png b/bacula/src/qt-console/images/inflag0.png
new file mode 100644 (file)
index 0000000..6478554
Binary files /dev/null and b/bacula/src/qt-console/images/inflag0.png differ
diff --git a/bacula/src/qt-console/images/inflag1.png b/bacula/src/qt-console/images/inflag1.png
new file mode 100644 (file)
index 0000000..e061e7f
Binary files /dev/null and b/bacula/src/qt-console/images/inflag1.png differ
diff --git a/bacula/src/qt-console/images/inflag2.png b/bacula/src/qt-console/images/inflag2.png
new file mode 100644 (file)
index 0000000..dbff845
Binary files /dev/null and b/bacula/src/qt-console/images/inflag2.png differ
diff --git a/bacula/src/qt-console/images/purge.png b/bacula/src/qt-console/images/purge.png
new file mode 100644 (file)
index 0000000..9ba7c53
Binary files /dev/null and b/bacula/src/qt-console/images/purge.png differ
diff --git a/bacula/src/qt-console/images/zoom.png b/bacula/src/qt-console/images/zoom.png
new file mode 100644 (file)
index 0000000..1ac4864
Binary files /dev/null and b/bacula/src/qt-console/images/zoom.png differ
diff --git a/bacula/src/qt-console/job/job.cpp b/bacula/src/qt-console/job/job.cpp
new file mode 100644 (file)
index 0000000..aa4ff3b
--- /dev/null
@@ -0,0 +1,287 @@
+/*
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2007-2009 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of Kern Sibbald.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
+/*
+ *   Version $Id$
+ *
+ *  Job Class
+ *
+ *   Dirk Bartley, March 2007
+ *
+ */ 
+
+#include "bat.h"
+#include "job.h"
+#include "util/fmtwidgetitem.h"
+
+Job::Job(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem)
+{
+   setupUi(this);
+   m_closeable = true;
+   pgInitialize(tr("Job"), parentTreeWidgetItem);
+   QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
+   thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/joblog.png")));
+   m_cursor = new QTextCursor(textJobLog->document());
+
+   m_jobId = jobId;
+   getFont();
+   populateText();
+   populateForm();
+   populateVolumes();
+   dockPage();
+   setCurrent();
+}
+
+void Job::getFont()
+{
+   QFont font = textJobLog->font();
+
+   QString dirname;
+   m_console->getDirResName(dirname);
+   QSettings settings(dirname, "bat");
+   settings.beginGroup("Console");
+   font.setFamily(settings.value("consoleFont", "Courier").value<QString>());
+   font.setPointSize(settings.value("consolePointSize", 10).toInt());
+   font.setFixedPitch(settings.value("consoleFixedPitch", true).toBool());
+   settings.endGroup();
+   textJobLog->setFont(font);
+}
+
+/*
+ * Populate the text in the window
+ */
+void Job::populateText()
+{
+   QString query;
+   query = "SELECT Time, LogText FROM Log WHERE JobId='" + m_jobId + "' order by Time";
+
+   /* This could be a log item */
+   if (mainWin->m_sqlDebug) {
+      Pmsg1(000, "Log query cmd : %s\n", query.toUtf8().data());
+   }
+  
+   QStringList results;
+   if (m_console->sql_cmd(query, results)) {
+
+      if (!results.size()) {
+         QMessageBox::warning(this, tr("Bat"),
+            tr("There were no results!\n"
+              "It is possible you may need to add \"catalog = all\" "
+              "to the Messages resource for this job.\n"), QMessageBox::Ok);
+        return;
+      } 
+
+      QString jobstr("JobId "); /* FIXME: should this be translated ? */
+      jobstr += m_jobId;
+
+      QString htmlbuf("<html><body><pre>");
+  
+      /* Iterate through the lines of results. */
+      QString field;
+      QStringList fieldlist;
+      QString lastTime;
+      QString lastSvc;
+      foreach (QString resultline, results) {
+         fieldlist = resultline.split("\t");
+        
+        if (fieldlist.size() < 2)
+           continue;
+
+        QString curTime = fieldlist[0].trimmed();
+
+        field = fieldlist[1].trimmed();
+        int colon = field.indexOf(":");
+        if (colon > 0) {
+           /* string is like <service> <jobId xxxx>: ..." 
+            * we split at ':' then remove the jobId xxxx string (always the same) */ 
+           QString curSvc(field.left(colon).replace(jobstr,"").trimmed());
+           if (curSvc == lastSvc  && curTime == lastTime) {
+              curTime.clear();
+              curSvc.clear(); 
+           } else {
+              lastTime = curTime;
+              lastSvc = curSvc;
+           }
+//         htmlbuf += "<td>" + curTime + "</td>";
+           htmlbuf += "\n" + curSvc + " ";
+
+           /* rest of string is marked as pre-formatted (here trimming should
+            * be avoided, to preserve original formatting) */
+           QString msg(field.mid(colon+2));
+           if (msg.startsWith( tr("Error:")) ) { /* FIXME: should really be translated ? */
+              /* error msg, use a specific class */
+              htmlbuf += "</pre><pre class=err>" + msg + "</pre><pre>";
+           } else {
+              htmlbuf += msg ;
+           }
+        } else {
+           /* non standard string, place as-is */
+           if (curTime == lastTime) {
+              curTime.clear();
+           } else {
+              lastTime = curTime;
+           }
+//         htmlbuf += "<td>" + curTime + "</td>";
+           htmlbuf += "\n" + field ;
+        }
+  
+      } /* foreach resultline */
+
+      htmlbuf += "</pre></body></html>";
+
+      /* full text ready. Here a custom sheet is used to align columns */
+      QString logSheet(".err {color:#FF0000;}");
+      textJobLog->document()->setDefaultStyleSheet(logSheet);
+      textJobLog->document()->setHtml(htmlbuf); 
+      textJobLog->moveCursor(QTextCursor::Start);
+
+   } /* if results from query */
+  
+}
+
+// Need to use the fmtwidgetitem helper instead
+QString convertBytesSI(qint64 qfld)
+{
+   static const qint64 KB = Q_INT64_C(1000);
+   static const qint64 MB = (KB * KB);
+   static const qint64 GB = (MB * KB);
+   static const qint64 TB = (GB * KB);
+   static const qint64 PB = (TB * KB);
+   static const qint64 EB = (PB * KB);
+
+   /* note: division is integer, so to have some decimals we divide for a
+      smaller unit (e.g. GB for a TB number and so on) */
+   char suffix;
+   if (qfld >= EB) {
+      qfld /= PB; 
+      suffix = 'E';
+   }
+   else if (qfld >= PB) {
+      qfld /= TB; 
+      suffix = 'P';
+   }
+   else if (qfld >= TB) {
+      qfld /= GB; 
+      suffix = 'T';
+   }
+   else if (qfld >= GB) {
+      qfld /= MB;
+      suffix = 'G';
+   }
+   else if (qfld >= MB) {
+      qfld /= KB;
+      suffix = 'M';
+   }
+   else if (qfld >= KB) {
+      suffix = 'k'; /* SI uses lowercase k */
+   }
+   else  {
+      /* plain bytes, no need to reformat */
+      return QString("%1 B").arg(qfld); 
+   }
+
+   /* having divided for a smaller unit, now we can safely convert to double and
+      use the extra room for decimals */
+   return QString("%1 %2B").arg(qfld / 1000.0, 0, 'f', 2).arg(suffix);
+}
+
+/*
+ * Populate the text in the window
+ */
+void Job::populateForm()
+{
+   QString stat;
+   char buf[256];
+   QString query = 
+      "SELECT JobId, Job.Name, Level, Client.Name, Pool.Name, FileSet, SchedTime, StartTime, EndTime, "
+      "EndTime - StartTime AS Duration, JobBytes, JobFiles, JobErrors, JobStatus, PurgedFiles "
+      "FROM Job JOIN Client USING (ClientId) LEFT JOIN Pool USING (PoolId) "
+      "LEFT JOIN FileSet USING (FileSetId)"
+      "WHERE JobId=" + m_jobId; 
+   QStringList results;
+   if (m_console->sql_cmd(query, results)) {
+      QString resultline;
+      QStringList fieldlist;
+
+      foreach (resultline, results) { // should have only one result
+         fieldlist = resultline.split("\t");
+         QStringListIterator fld(fieldlist);
+         label_JobId->setText(fld.next());
+         label_Name->setText(fld.next());
+         
+         label_Level->setText(job_level_to_str(fld.next()[0].toAscii()));
+
+         label_Client->setText(fld.next());
+         label_Pool->setText(fld.next());
+         label_FileSet->setText(fld.next());
+         label_SchedTime->setText(fld.next());
+         label_StartTime->setText(fld.next());
+         label_EndTime->setText(fld.next());
+         label_Duration->setText(fld.next());
+
+         label_JobBytes->setText(convertBytesSI(fld.next().toULongLong()));
+         label_JobFiles->setText(fld.next());
+         label_JobErrors->setText(fld.next());
+
+         stat=fld.next();
+         label_JobStatus->setPixmap(QPixmap(":/images/" + stat + ".png"));
+         jobstatus_to_ascii_gui(stat[0].toAscii(), buf, sizeof(buf));
+         stat = buf;
+         label_JobStatus->setToolTip(stat);
+
+         chkbox_PurgedFiles->setCheckState(fld.next().toInt()?Qt::Checked:Qt::Unchecked);
+      }
+   }
+}
+  
+void Job::populateVolumes()
+{
+
+   QString query = 
+      "SELECT DISTINCT VolumeName, InChanger, Slot "
+      "FROM Job JOIN JobMedia USING (JobId) JOIN Media USING (MediaId) "
+      "WHERE JobId=" + m_jobId + " ORDER BY VolumeName "; 
+   Pmsg1(000, "Query cmd : %s\n",query.toUtf8().data());
+         
+
+   QStringList results;
+   if (m_console->sql_cmd(query, results)) {
+      QString resultline;
+      QStringList fieldlist;
+      list_Volume->clear();
+      foreach (resultline, results) { // should have only one result
+         fieldlist = resultline.split("\t");
+         QStringListIterator fld(fieldlist);
+//         QListWidgetItem(QIcon(":/images/inchanger" + fld.next() + ".png"), 
+//                         fld.next(), list_Volume);
+         list_Volume->addItem(fld.next());
+      }
+   }
+}
+
+//QListWidgetItem ( const QIcon & icon, const QString & text, QListWidget * parent = 0, int type = Type )
diff --git a/bacula/src/qt-console/job/job.h b/bacula/src/qt-console/job/job.h
new file mode 100644 (file)
index 0000000..2597ab3
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef _JOB_H_
+#define _JOB_H_
+/*
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of Kern Sibbald.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
+
+#include <QtGui>
+#include "ui_job.h"
+#include "console.h"
+
+class Job : public Pages, public Ui::JobForm
+{
+   Q_OBJECT 
+
+public:
+   Job(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem);
+
+public slots:
+
+private slots:
+
+private:
+   void populateText();
+   void populateForm();
+   void populateVolumes();
+
+   void getFont();
+   QTextCursor *m_cursor;
+   QString m_jobId;
+};
+
+#endif /* _JOB_H_ */
diff --git a/bacula/src/qt-console/job/job.ui b/bacula/src/qt-console/job/job.ui
new file mode 100644 (file)
index 0000000..b20fc09
--- /dev/null
@@ -0,0 +1,600 @@
+<ui version="4.0" >
+ <class>JobForm</class>
+ <widget class="QWidget" name="JobForm" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>855</width>
+    <height>757</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Form</string>
+  </property>
+  <widget class="QGroupBox" name="groupBox" >
+   <property name="geometry" >
+    <rect>
+     <x>10</x>
+     <y>40</y>
+     <width>231</width>
+     <height>181</height>
+    </rect>
+   </property>
+   <property name="sizePolicy" >
+    <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+     <horstretch>0</horstretch>
+     <verstretch>0</verstretch>
+    </sizepolicy>
+   </property>
+   <property name="title" >
+    <string>Basic Information</string>
+   </property>
+   <widget class="QWidget" name="layoutWidget" >
+    <property name="geometry" >
+     <rect>
+      <x>10</x>
+      <y>20</y>
+      <width>211</width>
+      <height>152</height>
+     </rect>
+    </property>
+    <layout class="QFormLayout" name="formLayout" >
+     <property name="labelAlignment" >
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+     </property>
+     <property name="formAlignment" >
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+     </property>
+     <item row="0" column="0" >
+      <widget class="QLabel" name="label" >
+       <property name="text" >
+        <string>JobId:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1" >
+      <widget class="QLabel" name="label_JobId" >
+       <property name="text" >
+        <string>2</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0" >
+      <widget class="QLabel" name="label_2" >
+       <property name="text" >
+        <string>Job Name:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1" >
+      <widget class="QLabel" name="label_Name" >
+       <property name="text" >
+        <string>Test</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="0" >
+      <widget class="QLabel" name="label_3" >
+       <property name="text" >
+        <string>Level:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1" >
+      <widget class="QLabel" name="label_Level" >
+       <property name="text" >
+        <string>VirtualFull</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="0" >
+      <widget class="QLabel" name="label_28" >
+       <property name="text" >
+        <string>Client:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="1" >
+      <widget class="QLabel" name="label_Client" >
+       <property name="text" >
+        <string>client-fd</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+     <item row="4" column="0" >
+      <widget class="QLabel" name="label_7" >
+       <property name="text" >
+        <string>FileSet:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="4" column="1" >
+      <widget class="QLabel" name="label_FileSet" >
+       <property name="text" >
+        <string>TheFileSet</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+     <item row="5" column="0" >
+      <widget class="QLabel" name="label_11" >
+       <property name="text" >
+        <string>Pool:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="5" column="1" >
+      <widget class="QLabel" name="label_Pool" >
+       <property name="text" >
+        <string>ThePool</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+  </widget>
+  <widget class="QGroupBox" name="groupBox_2" >
+   <property name="geometry" >
+    <rect>
+     <x>680</x>
+     <y>40</y>
+     <width>171</width>
+     <height>181</height>
+    </rect>
+   </property>
+   <property name="sizePolicy" >
+    <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+     <horstretch>0</horstretch>
+     <verstretch>0</verstretch>
+    </sizepolicy>
+   </property>
+   <property name="title" >
+    <string>Volume Used</string>
+   </property>
+   <layout class="QHBoxLayout" name="horizontalLayout_3" >
+    <item>
+     <widget class="QListWidget" name="list_Volume" >
+      <item>
+       <property name="text" >
+        <string>Vol0001</string>
+       </property>
+       <property name="icon" >
+        <iconset resource="../main.qrc" >
+         <normaloff>:/images/inflag1.png</normaloff>:/images/inflag1.png</iconset>
+       </property>
+      </item>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QGroupBox" name="groupBox_3" >
+   <property name="geometry" >
+    <rect>
+     <x>420</x>
+     <y>40</y>
+     <width>251</width>
+     <height>181</height>
+    </rect>
+   </property>
+   <property name="sizePolicy" >
+    <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+     <horstretch>0</horstretch>
+     <verstretch>0</verstretch>
+    </sizepolicy>
+   </property>
+   <property name="title" >
+    <string>Times</string>
+   </property>
+   <widget class="QWidget" name="layoutWidget" >
+    <property name="geometry" >
+     <rect>
+      <x>10</x>
+      <y>20</y>
+      <width>231</width>
+      <height>151</height>
+     </rect>
+    </property>
+    <layout class="QFormLayout" name="formLayout_3" >
+     <property name="fieldGrowthPolicy" >
+      <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+     </property>
+     <property name="labelAlignment" >
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+     </property>
+     <property name="formAlignment" >
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+     </property>
+     <item row="0" column="0" >
+      <widget class="QLabel" name="label_26" >
+       <property name="text" >
+        <string>Sched Time:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1" >
+      <widget class="QLabel" name="label_SchedTime" >
+       <property name="text" >
+        <string>2009-07-31 00:10:00</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0" >
+      <widget class="QLabel" name="label_5" >
+       <property name="text" >
+        <string>Start Time:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1" >
+      <widget class="QLabel" name="label_StartTime" >
+       <property name="text" >
+        <string>2009-07-31 00:10:00</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="0" >
+      <widget class="QLabel" name="label_19" >
+       <property name="text" >
+        <string>End Time:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1" >
+      <widget class="QLabel" name="label_EndTime" >
+       <property name="text" >
+        <string>2009-07-31 00:20:00</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="0" >
+      <widget class="QLabel" name="label_4" >
+       <property name="text" >
+        <string>Duration:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="1" >
+      <widget class="QLabel" name="label_Duration" >
+       <property name="text" >
+        <string>00:10:00</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+  </widget>
+  <widget class="QGroupBox" name="groupBox_4" >
+   <property name="geometry" >
+    <rect>
+     <x>250</x>
+     <y>40</y>
+     <width>161</width>
+     <height>181</height>
+    </rect>
+   </property>
+   <property name="sizePolicy" >
+    <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+     <horstretch>0</horstretch>
+     <verstretch>0</verstretch>
+    </sizepolicy>
+   </property>
+   <property name="minimumSize" >
+    <size>
+     <width>160</width>
+     <height>0</height>
+    </size>
+   </property>
+   <property name="title" >
+    <string>Status</string>
+   </property>
+   <widget class="QWidget" name="layoutWidget" >
+    <property name="geometry" >
+     <rect>
+      <x>10</x>
+      <y>20</y>
+      <width>141</width>
+      <height>151</height>
+     </rect>
+    </property>
+    <layout class="QFormLayout" name="formLayout_2" >
+     <property name="fieldGrowthPolicy" >
+      <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
+     </property>
+     <property name="labelAlignment" >
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+     </property>
+     <property name="formAlignment" >
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+     </property>
+     <item row="0" column="0" >
+      <widget class="QLabel" name="label_8" >
+       <property name="text" >
+        <string>Files:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1" >
+      <widget class="QLabel" name="label_JobFiles" >
+       <property name="text" >
+        <string>1,924</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0" >
+      <widget class="QLabel" name="label_9" >
+       <property name="text" >
+        <string>Bytes:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="0" >
+      <widget class="QLabel" name="label_10" >
+       <property name="text" >
+        <string>Errors:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="2" column="1" >
+      <widget class="QLabel" name="label_JobErrors" >
+       <property name="text" >
+        <string>0</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="0" >
+      <widget class="QLabel" name="label_6" >
+       <property name="text" >
+        <string>Status:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="3" column="1" >
+      <widget class="QLabel" name="label_JobStatus" >
+       <property name="text" >
+        <string/>
+       </property>
+       <property name="pixmap" >
+        <pixmap resource="../main.qrc" >:/images/T.png</pixmap>
+       </property>
+       <property name="scaledContents" >
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+     <item row="4" column="0" >
+      <widget class="QLabel" name="label_25" >
+       <property name="text" >
+        <string>Purged:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="4" column="1" >
+      <widget class="QCheckBox" name="chkbox_PurgedFiles" >
+       <property name="enabled" >
+        <bool>false</bool>
+       </property>
+       <property name="text" >
+        <string/>
+       </property>
+       <property name="checkable" >
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1" >
+      <widget class="QLabel" name="label_JobBytes" >
+       <property name="text" >
+        <string>109 MB</string>
+       </property>
+       <property name="textInteractionFlags" >
+        <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+  </widget>
+  <widget class="QGroupBox" name="groupBox_5" >
+   <property name="geometry" >
+    <rect>
+     <x>10</x>
+     <y>220</y>
+     <width>841</width>
+     <height>531</height>
+    </rect>
+   </property>
+   <property name="sizePolicy" >
+    <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+     <horstretch>0</horstretch>
+     <verstretch>0</verstretch>
+    </sizepolicy>
+   </property>
+   <property name="title" >
+    <string>Logs</string>
+   </property>
+   <layout class="QVBoxLayout" name="verticalLayout" >
+    <item>
+     <widget class="QTextEdit" name="textJobLog" >
+      <property name="html" >
+       <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>
+      </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>
+     <height>31</height>
+    </rect>
+   </property>
+   <layout class="QHBoxLayout" name="horizontalLayout" >
+    <item>
+     <widget class="QPushButton" name="pushButton" >
+      <property name="text" >
+       <string>Delete</string>
+      </property>
+      <property name="icon" >
+       <iconset resource="../main.qrc" >
+        <normaloff>:/images/purge.png</normaloff>:/images/purge.png</iconset>
+      </property>
+      <property name="flat" >
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButton_8" >
+      <property name="toolTip" >
+       <string>View errors for this Job</string>
+      </property>
+      <property name="text" >
+       <string>Errors</string>
+      </property>
+      <property name="icon" >
+       <iconset resource="../main.qrc" >
+        <normaloff>:/images/zoom.png</normaloff>:/images/zoom.png</iconset>
+      </property>
+      <property name="flat" >
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButton_3" >
+      <property name="text" >
+       <string>Media</string>
+      </property>
+      <property name="icon" >
+       <iconset resource="../main.qrc" >
+        <normaloff>:/images/zoom.png</normaloff>:/images/zoom.png</iconset>
+      </property>
+      <property name="flat" >
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButton_5" >
+      <property name="text" >
+       <string>History</string>
+      </property>
+      <property name="icon" >
+       <iconset resource="../main.qrc" >
+        <normaloff>:/images/zoom.png</normaloff>:/images/zoom.png</iconset>
+      </property>
+      <property name="flat" >
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButton_2" >
+      <property name="sizePolicy" >
+       <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="text" >
+       <string>Run again</string>
+      </property>
+      <property name="icon" >
+       <iconset resource="../main.qrc" >
+        <normaloff>:/images/R.png</normaloff>:/images/R.png</iconset>
+      </property>
+      <property name="flat" >
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButton_6" >
+      <property name="text" >
+       <string>Read doc</string>
+      </property>
+      <property name="flat" >
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButton_7" >
+      <property name="text" >
+       <string>FileSet</string>
+      </property>
+      <property name="icon" >
+       <iconset resource="../main.qrc" >
+        <normaloff>:/images/zoom.png</normaloff>:/images/zoom.png</iconset>
+      </property>
+      <property name="flat" >
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QPushButton" name="pushButton_4" >
+      <property name="text" >
+       <string>Stats</string>
+      </property>
+      <property name="icon" >
+       <iconset resource="../main.qrc" >
+        <normaloff>:/images/zoom.png</normaloff>:/images/zoom.png</iconset>
+      </property>
+      <property name="flat" >
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+ </widget>
+ <resources>
+  <include location="../main.qrc" />
+ </resources>
+ <connections/>
+</ui>
index a1f9b9a4cf5fecdc030e9558b67e27a589ab9405..a52119d3f50cef2a2d23fc12b60a07a3defc205b 100644 (file)
@@ -36,6 +36,7 @@
 #include <QTableWidgetItem>
 #include "joblist.h"
 #include "restore.h"
+#include "job/job.h"
 #include "joblog/joblog.h"
 #ifdef HAVE_QWT
 #include "jobgraphs/jobplot.h"
@@ -408,6 +409,7 @@ void JobList::createConnections()
 #endif
    /* for the selectionChanged to maintain m_currentJob and a delete selection */
    connect(mp_tableWidget, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged()));
+   connect(mp_tableWidget, SIGNAL(itemDoubleClicked()), this, SLOT(showInfoForJob()));
 
    /* Do what is required for the local context sensitive menu */
 
@@ -423,6 +425,7 @@ void JobList::createConnections()
    connect(actionRestoreFromJob, SIGNAL(triggered()), this, SLOT(preRestoreFromJob()));
    connect(actionRestoreFromTime, SIGNAL(triggered()), this, SLOT(preRestoreFromTime()));
    connect(actionShowLogForJob, SIGNAL(triggered()), this, SLOT(showLogForJob()));
+   connect(actionShowInfoForJob, SIGNAL(triggered()), this, SLOT(showInfoForJob()));
    connect(actionCancelJob, SIGNAL(triggered()), this, SLOT(consoleCancelJob()));
    connect(actionListJobTotals, SIGNAL(triggered()), this, SLOT(consoleListJobTotals()));
    connect(m_splitter, SIGNAL(splitterMoved(int, int)), this, SLOT(splitterMoved(int, int)));
@@ -530,6 +533,15 @@ void JobList::showLogForJob()
    new JobLog(m_currentJob, pageSelectorTreeWidgetItem);
 }
 
+/*
+ * Subroutine to call class to show the log in the database from that job
+ */
+void JobList::showInfoForJob()
+{
+   QTreeWidgetItem* pageSelectorTreeWidgetItem = mainWin->getFromHash(this);
+   new Job(m_currentJob, pageSelectorTreeWidgetItem);
+}
+
 /*
  * Cancel a running job
  */
@@ -643,6 +655,7 @@ void JobList::selectionChanged()
       mp_tableWidget->addAction(actionRestoreFromJob);
       mp_tableWidget->addAction(actionRestoreFromTime);
       mp_tableWidget->addAction(actionShowLogForJob);
+      mp_tableWidget->addAction(actionShowInfoForJob);
    }
    if (m_selectedJobsCount >= 1) {
       mp_tableWidget->addAction(actionDeleteJob);
index db9d0b437ceeec622e1eea379c374faf230b1d1e..44ee63e45d61baed83092435f25abd55b4c9a5d1 100644 (file)
@@ -65,6 +65,7 @@ private slots:
    void preRestoreFromJob();
    void preRestoreFromTime();
    void showLogForJob();
+   void showInfoForJob();
    void consoleCancelJob();
    void graphTable();
    void splitterMoved(int pos, int index);
index 99adbadab0bf73a44f231b45dbf49b1c76bae20f..dd40d2c52fc46f419f4664b409c8ebc3c70503ce 100644 (file)
     <string>Show Log for Job</string>
    </property>
   </action>
+  <action name="actionShowInfoForJob">
+   <property name="icon">
+    <iconset resource="../main.qrc">
+     <normaloff>:/images/joblog.png</normaloff>:/images/joblog.png</iconset>
+   </property>
+   <property name="text">
+    <string>Show Info for Job</string>
+   </property>
+  </action>
   <action name="actionCancelJob">
    <property name="icon">
     <iconset resource="../main.qrc">
index 18e2c7b534ee7c2d9fe342327bd088a270c34a3a..dddeb1a4c266ad3bf5935593535e5d79104ed7e6 100644 (file)
@@ -1,52 +1,61 @@
 <RCC>
-    <qresource prefix="/" >
-        <file>images/applications-graphics.png</file>
-        <file>images/bat.png</file>
-        <file>images/bat_icon.png</file>
-        <file>images/browse.png</file>
-        <file>images/cartridge-edit.png</file>
-        <file>images/cartridge.png</file>
-        <file>images/check.png</file>
-        <file>images/connected.png</file>
-        <file>images/copy.png</file>
-        <file>images/cut.png</file>
-        <file>images/disconnected.png</file>
-        <file>images/edit-cut.png</file>
-        <file>images/edit-delete.png</file>
-        <file>images/emblem-system.png</file>
-        <file>images/estimate-job.png</file>
-        <file>images/folder.png</file>
-        <file>images/folderbothchecked.png</file>
-        <file>images/folderchecked.png</file>
-        <file>images/folderunchecked.png</file>
-        <file>images/go-down.png</file>
-        <file>images/go-up.png</file>
-        <file>images/graph1.png</file>
-        <file>images/help-browser.png</file>
-        <file>images/joblog.png</file>
-        <file>images/label.png</file>
-        <file>images/mail-message-new.png</file>
-        <file>images/mail-message-pending.png</file>
-        <file>images/mark.png</file>
-        <file>images/network-server.png</file>
-        <file>images/new.png</file>
-        <file>images/open.png</file>
-        <file>images/package-x-generic.png</file>
-        <file>images/paste.png</file>
-        <file>images/print.png</file>
-        <file>images/restore.png</file>
-        <file>images/run.png</file>
-        <file>images/save.png</file>
-        <file>images/status-console.png</file>
-        <file>images/status.png</file>
-        <file>images/system-file-manager.png</file>
-        <file>images/unchecked.png</file>
-        <file>images/undo.png</file>
-        <file>images/unmark.png</file>
-        <file>images/up.png</file>
-        <file>images/utilities-terminal.png</file>
-        <file>images/view-refresh.png</file>
-        <file>images/weather-severe-alert.png</file>
-        <file>images/go-jump.png</file>
-    </qresource>
+  <qresource prefix="/" >
+    <file>images/R.png</file>
+    <file>images/T.png</file>
+    <file>images/f.png</file>
+    <file>images/A.png</file>
+    <file>images/inflag2.png</file>
+    <file>images/inflag0.png</file>
+    <file>images/inflag1.png</file>
+    <file>images/purge.png</file>
+    <file>images/zoom.png</file>
+    <file>images/applications-graphics.png</file>
+    <file>images/bat.png</file>
+    <file>images/bat_icon.png</file>
+    <file>images/browse.png</file>
+    <file>images/cartridge-edit.png</file>
+    <file>images/cartridge.png</file>
+    <file>images/check.png</file>
+    <file>images/connected.png</file>
+    <file>images/copy.png</file>
+    <file>images/cut.png</file>
+    <file>images/disconnected.png</file>
+    <file>images/edit-cut.png</file>
+    <file>images/edit-delete.png</file>
+    <file>images/emblem-system.png</file>
+    <file>images/estimate-job.png</file>
+    <file>images/folder.png</file>
+    <file>images/folderbothchecked.png</file>
+    <file>images/folderchecked.png</file>
+    <file>images/folderunchecked.png</file>
+    <file>images/go-down.png</file>
+    <file>images/go-up.png</file>
+    <file>images/graph1.png</file>
+    <file>images/help-browser.png</file>
+    <file>images/joblog.png</file>
+    <file>images/label.png</file>
+    <file>images/mail-message-new.png</file>
+    <file>images/mail-message-pending.png</file>
+    <file>images/mark.png</file>
+    <file>images/network-server.png</file>
+    <file>images/new.png</file>
+    <file>images/open.png</file>
+    <file>images/package-x-generic.png</file>
+    <file>images/paste.png</file>
+    <file>images/print.png</file>
+    <file>images/restore.png</file>
+    <file>images/run.png</file>
+    <file>images/save.png</file>
+    <file>images/status-console.png</file>
+    <file>images/status.png</file>
+    <file>images/system-file-manager.png</file>
+    <file>images/unchecked.png</file>
+    <file>images/undo.png</file>
+    <file>images/unmark.png</file>
+    <file>images/up.png</file>
+    <file>images/utilities-terminal.png</file>
+    <file>images/view-refresh.png</file>
+    <file>images/weather-severe-alert.png</file>
+    <file>images/go-jump.png</file>
+  </qresource>
 </RCC>