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 job/job.ui
-FORMS += help/help.ui
+FORMS += help/help.ui mediainfo/mediainfo.ui
FORMS += status/dirstat.ui
FORMS += status/clientstat.ui
FORMS += status/storstat.ui
HEADERS += help/help.h
SOURCES += help/help.cpp
+# Media info dialog
+HEADERS += mediainfo/mediainfo.h
+SOURCES += mediainfo/mediainfo.cpp
+
## Status Dir
HEADERS += status/dirstat.h
SOURCES += status/dirstat.cpp
FORMS += select/select.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
HEADERS += jobs/jobs.h
SOURCES += jobs/jobs.cpp
+## Job
+HEADERS += job/job.h
+SOURCES += job/job.cpp
+
## RestoreTree
HEADERS += restore/restoretree.h
SOURCES += restore/restoretree.cpp
Switzerland, email:ftf@fsfeurope.org.
*/
-/*
- * Version $Id$
- *
- * Job Class
- *
- * Dirk Bartley, March 2007
- *
- */
-
#include "bat.h"
#include "job.h"
#include "util/fmtwidgetitem.h"
+#include "mediainfo/mediainfo.h"
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()));
+ connect(list_Volume, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(showInfoVolume(QListWidgetItem *)));
+
+ populateAll();
dockPage();
setCurrent();
}
+void Job::showInfoVolume(QListWidgetItem *item)
+{
+ QString s= item->text();
+ QTreeWidgetItem* pageSelectorTreeWidgetItem = mainWin->getFromHash(this);
+
+ MediaInfo *m = new MediaInfo(pageSelectorTreeWidgetItem, s);
+ connect(m, SIGNAL(destroyed()), this, SLOT(populateTree()));
+}
+
+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();
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";
}
-// 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
*/
Job(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem);
public slots:
+ void populateAll();
+ void deleteJob();
+ void showInfoVolume(QListWidgetItem *);
private slots:
<rect>
<x>0</x>
<y>0</y>
- <width>855</width>
- <height>757</height>
+ <width>1064</width>
+ <height>629</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>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QPushButton" name="pbDelete" >
+ <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="pbErrors" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <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="pbMedia" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <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="pbHistory" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <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="pbRun" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <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="pbDoc" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Read doc</string>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbFileSet" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <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="pbStats" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <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>
+ <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>
</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>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
</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>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>230</width>
+ <height>180</height>
+ </size>
+ </property>
+ <property name="baseSize" >
+ <size>
+ <width>230</width>
+ <height>180</height>
+ </size>
+ </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>
</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>
+ <item>
+ <widget class="QGroupBox" name="groupBox_4" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>160</width>
+ <height>180</height>
+ </size>
+ </property>
+ <property name="baseSize" >
+ <size>
+ <width>160</width>
+ <height>180</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>
</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>
+ <item>
+ <widget class="QGroupBox" name="groupBox_3" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>260</width>
+ <height>180</height>
+ </size>
+ </property>
+ <property name="baseSize" >
+ <size>
+ <width>260</width>
+ <height>180</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Times</string>
+ </property>
+ <widget class="QWidget" name="layoutWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>247</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>
</item>
- <item row="3" column="0" >
- <widget class="QLabel" name="label_6" >
- <property name="text" >
- <string>Status:</string>
- </property>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>170</width>
+ <height>181</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>170</width>
+ <height>181</height>
+ </size>
+ </property>
+ <property name="baseSize" >
+ <size>
+ <width>170</width>
+ <height>180</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Volume Used</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <item>
+ <widget class="QListWidget" name="list_Volume" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>149</width>
+ <height>140</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>149</width>
+ <height>140</height>
+ </size>
+ </property>
+ <property name="baseSize" >
+ <size>
+ <width>149</width>
+ <height>140</height>
+ </size>
+ </property>
+ <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>
</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>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
</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><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+ </item>
+ <item>
+ <widget class="QTextEdit" name="textJobLog" >
+ <property name="html" >
+ <string><!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></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>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
<resources>
<include location="../main.qrc" />
connect(actionListFilesOnJob, SIGNAL(triggered()), this, SLOT(consoleListFilesOnJob()));
connect(actionListJobMedia, SIGNAL(triggered()), this, SLOT(consoleListJobMedia()));
- connect(actionListVolumes, SIGNAL(triggered()), this, SLOT(consoleListVolumes()));
connect(actionDeleteJob, SIGNAL(triggered()), this, SLOT(consoleDeleteJob()));
connect(actionPurgeFiles, SIGNAL(triggered()), this, SLOT(consolePurgeFiles()));
connect(actionRestoreFromJob, SIGNAL(triggered()), this, SLOT(preRestoreFromJob()));
if (mainWin->m_longList) { cmd.prepend("l"); }
consoleCommand(cmd);
}
-void JobList::consoleListVolumes()
-{
- QString cmd("list volumes jobid=");
- cmd += m_currentJob;
- if (mainWin->m_longList) { cmd.prepend("l"); }
- consoleCommand(cmd);
-}
+
void JobList::consoleListJobTotals()
{
QString cmd("list jobtotals");
/*
* Subroutine to call class to show the log in the database from that job
*/
-void JobList::showInfoForJob()
+void JobList::showInfoForJob(QTableWidgetItem * item)
{
QTreeWidgetItem* pageSelectorTreeWidgetItem = mainWin->getFromHash(this);
new Job(m_currentJob, pageSelectorTreeWidgetItem);
if (m_selectedJobsCount == 1) {
mp_tableWidget->addAction(actionListFilesOnJob);
mp_tableWidget->addAction(actionListJobMedia);
- mp_tableWidget->addAction(actionListVolumes);
mp_tableWidget->addAction(actionRestoreFromJob);
mp_tableWidget->addAction(actionRestoreFromTime);
mp_tableWidget->addAction(actionShowLogForJob);
private slots:
void consoleListFilesOnJob();
void consoleListJobMedia();
- void consoleListVolumes();
void consoleListJobTotals();
void consoleDeleteJob();
void consolePurgeFiles();
void preRestoreFromJob();
void preRestoreFromTime();
void showLogForJob();
- void showInfoForJob();
+ void showInfoForJob(QTableWidgetItem * item=NULL);
void consoleCancelJob();
void graphTable();
void splitterMoved(int pos, int index);
<RCC>
<qresource prefix="/" >
+ <file>images/edit.png</file>
+ <file>images/extern.png</file>
+ <file>images/intern.png</file>
<file>images/R.png</file>
<file>images/T.png</file>
<file>images/f.png</file>
<rect>
<x>0</x>
<y>0</y>
- <width>882</width>
- <height>689</height>
+ <width>785</width>
+ <height>660</height>
</rect>
</property>
<property name="windowTitle" >
<rect>
<x>0</x>
<y>0</y>
- <width>882</width>
+ <width>785</width>
<height>24</height>
</rect>
</property>
</property>
<property name="minimumSize" >
<size>
- <width>79</width>
- <height>101</height>
+ <width>97</width>
+ <height>157</height>
</size>
</property>
<property name="maximumSize" >
<number>1</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents" >
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="0" column="0" >
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
<widget class="QTreeWidget" name="treeWidget" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
</column>
</widget>
</item>
- </layout>
- </widget>
- </widget>
- <widget class="QDockWidget" name="dockWidget_2" >
- <property name="toolTip" >
- <string>Console Entry</string>
- </property>
- <property name="statusTip" >
- <string>Enter a bacula command</string>
- </property>
- <property name="whatsThis" >
- <string>Console Command entry Dock Widget</string>
- </property>
- <property name="features" >
- <set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
- </property>
- <property name="allowedAreas" >
- <set>Qt::BottomDockWidgetArea|Qt::TopDockWidgetArea</set>
- </property>
- <property name="windowTitle" >
- <string>Console Command Line Entry</string>
- </property>
- <attribute name="dockWidgetArea" >
- <number>8</number>
- </attribute>
- <widget class="QWidget" name="dockWidgetContents_2" >
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="0" column="0" >
- <layout class="QHBoxLayout" >
- <property name="spacing" >
- <number>6</number>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Command:</string>
</property>
- <property name="margin" >
- <number>0</number>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit" >
+ <property name="statusTip" >
+ <string>Click here to enter command</string>
</property>
- <item>
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>Command:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit" >
- <property name="statusTip" >
- <string>Click here to enter command</string>
- </property>
- </widget>
- </item>
- </layout>
+ </widget>
</item>
</layout>
</widget>
--- /dev/null
+/*
+ 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.
+*/
+
+#include "bat.h"
+#include <QAbstractEventDispatcher>
+#include <QTableWidgetItem>
+#include <QMessageBox>
+#include "mediaedit/mediaedit.h"
+#include "relabel/relabel.h"
+#include "run/run.h"
+#include "mediainfo.h"
+#include "util/fmtwidgetitem.h"
+#include "job/job.h"
+
+/*
+ * A constructor
+ */
+MediaInfo::MediaInfo(QTreeWidgetItem *parentWidget, QString &mediaName)
+{
+ setupUi(this);
+ pgInitialize(tr("Media Info"), parentWidget);
+ QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
+ thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/cartridge-edit.png")));
+ m_mediaName = mediaName;
+ connect(pbPrune, SIGNAL(clicked()), this, SLOT(pruneVol()));
+ connect(pbPurge, SIGNAL(clicked()), this, SLOT(purgeVol()));
+ connect(pbDelete, SIGNAL(clicked()), this, SLOT(deleteVol()));
+ connect(pbEdit, SIGNAL(clicked()), this, SLOT(editVol()));
+ connect(tableJob, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(showInfoForJob(QTableWidgetItem *)));
+
+ m_closeable = true;
+ dockPage();
+ setCurrent();
+ populateForm();
+}
+
+/*
+ * Subroutine to call class to show the log in the database from that job
+ */
+void MediaInfo::showInfoForJob(QTableWidgetItem * item)
+{
+ QTreeWidgetItem* pageSelectorTreeWidgetItem = mainWin->getFromHash(this);
+ int row = item->row();
+ QString jobid = tableJob->item(row, 0)->text();
+ Job *j=new Job(jobid, pageSelectorTreeWidgetItem);
+ connect(j, SIGNAL(destroyed()), this, SLOT(populateTree()));
+}
+
+void MediaInfo::pruneVol()
+{
+ prunePage* prune = new prunePage(m_mediaName, "");
+ connect(prune, SIGNAL(destroyed()), this, SLOT(populateTree()));
+}
+
+// TODO: use same functions as in medialist.cpp
+void MediaInfo::purgeVol()
+{
+ if (QMessageBox::warning(this, "Bat",
+ tr("Are you sure you want to purge ?? !!!.\n"
+"The Purge command will delete associated Catalog database records from Jobs and"
+" Volumes without considering the retention period. Purge works only on the"
+" Catalog database and does not affect data written to Volumes. This command can"
+" be dangerous because you can delete catalog records associated with current"
+" backups of files, and we recommend that you do not use it unless you know what"
+" you are doing.\n"
+ "Press OK to proceed with the purge operation?"),
+ QMessageBox::Ok | QMessageBox::Cancel)
+ == QMessageBox::Cancel) { return; }
+
+ QString cmd("purge volume=");
+ cmd += m_mediaName;
+ consoleCommand(cmd);
+}
+
+void MediaInfo::deleteVol()
+{
+ if (QMessageBox::warning(this, "Bat",
+ tr("Are you sure you want to delete?? !!!.\n"
+"This delete command is used to delete a Volume 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. All Jobs and all 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 volume=");
+ cmd += m_mediaName;
+ consoleCommand(cmd);
+}
+
+void MediaInfo::editVol()
+{
+ MediaEdit* edit = new MediaEdit(mainWin->getFromHash(this),
+ m_mediaId);
+ connect(edit, SIGNAL(destroyed()), this, SLOT(populateTree()));
+}
+
+/*
+ * Populate the text in the window
+ */
+void MediaInfo::populateForm()
+{
+ utime_t t;
+ time_t ttime;
+
+ QString stat, LastWritten;
+ struct tm tm;
+ char buf[256];
+ QString query =
+ "SELECT MediaId, VolumeName, Pool.Name, MediaType, FirstWritten,"
+ "LastWritten, VolMounts, VolBytes, Media.Enabled,"
+ "Location.Location, VolStatus, RecyclePool.Name, Media.Recycle, "
+ "VolReadTime, VolWriteTime, Media.VolUseDuration, Media.MaxVolJobs, "
+ "Media.MaxVolFiles, Media.MaxVolBytes, Media.VolRetention,InChanger,Slot "
+ "FROM Media JOIN Pool USING (PoolId) LEFT JOIN Pool AS RecyclePool "
+ "ON (Media.RecyclePoolId = RecyclePool.PoolId) "
+ "LEFT JOIN Location USING (LocationId) "
+ "WHERE Media.VolumeName = '" + m_mediaName + "'";
+
+ 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);
+ m_mediaId = fld.next();
+
+ label_VolumeName->setText(fld.next());
+ label_Pool->setText(fld.next());
+ label_MediaType->setText(fld.next());
+ label_FirstWritten->setText(fld.next());
+ LastWritten = fld.next();
+ label_LastWritten->setText(LastWritten);
+// label_VolFiles->setText(fld.next());
+ label_VolMounts->setText(fld.next());
+ label_VolBytes->setText(convertBytesSI(fld.next().toULongLong()));
+ label_Enabled->setPixmap(QPixmap(":/images/inflag" + fld.next() + ".png"));
+ label_Location->setText(fld.next());
+ label_VolStatus->setText(fld.next());
+ label_RecyclePool->setText(fld.next());
+ chkbox_Recycle->setCheckState(fld.next().toInt()?Qt::Checked:Qt::Unchecked);
+ edit_utime(fld.next().toULongLong(), buf, sizeof(buf));
+ label_VolReadTime->setText(QString(buf));
+
+ edit_utime(fld.next().toULongLong(), buf, sizeof(buf));
+ label_VolWriteTime->setText(QString(buf));
+
+ edit_utime(fld.next().toULongLong(), buf, sizeof(buf));
+ label_VolUseDuration->setText(QString(buf));
+
+ label_MaxVolJobs->setText(fld.next());
+ label_MaxVolFiles->setText(fld.next());
+ label_MaxVolBytes->setText(fld.next());
+
+ stat = fld.next();
+ edit_utime(stat.toULongLong(), buf, sizeof(buf));
+ label_VolRetention->setText(QString(buf));
+
+ t = str_to_utime(LastWritten.toAscii().data());
+ t = t + stat.toULongLong();
+ ttime = t;
+ localtime_r(&ttime, &tm);
+ strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &tm);
+ label_Expire->setText(QString(buf));
+ label_Online->setPixmap(QPixmap(":/images/inflag"+fld.next()+".png"));
+// label_VolFiles->setText(fld.next());
+// label_VolErrors->setText(fld.next());
+
+// stat=fld.next();
+
+// jobstatus_to_ascii_gui(stat[0].toAscii(), buf, sizeof(buf));
+// stat = buf;
+//
+ }
+ }
+
+ query =
+ "SELECT DISTINCT JobId, Name, StartTime, Type, Level, JobFiles,"
+ "JobBytes,JobStatus "
+ "FROM Job JOIN JobMedia USING (JobId) JOIN Media USING (MediaId) "
+ "WHERE Media.VolumeName = '" + m_mediaName + "'";
+
+ results.clear();
+ if (m_console->sql_cmd(query, results)) {
+ QString resultline;
+ QStringList fieldlist;
+ int row = 0;
+ tableJob->setRowCount(results.size());
+ foreach (resultline, results) {
+ fieldlist = resultline.split("\t");
+ QStringListIterator fld(fieldlist);
+ int index=0;
+ TableItemFormatter jobitem(*tableJob, row);
+
+ /* JobId */
+ jobitem.setNumericFld(index++, fld.next());
+
+ /* job name */
+ jobitem.setTextFld(index++, fld.next());
+
+ /* job starttime */
+ jobitem.setTextFld(index++, fld.next(), true);
+
+ /* job type */
+ jobitem.setJobTypeFld(index++, fld.next());
+
+ /* job level */
+ jobitem.setJobLevelFld(index++, fld.next());
+
+ /* job files */
+ jobitem.setNumericFld(index++, fld.next());
+
+ /* job bytes */
+ jobitem.setBytesFld(index++, fld.next());
+
+ /* job status */
+ jobitem.setJobStatusFld(index++, fld.next());
+ row++;
+ }
+ }
+
+ tableJob->resizeColumnsToContents();
+ tableJob->resizeRowsToContents();
+ tableJob->verticalHeader()->hide();
+
+ /* make read only */
+ int rcnt = tableJob->rowCount();
+ int ccnt = tableJob->columnCount();
+ for(int r=0; r < rcnt; r++) {
+ for(int c=0; c < ccnt; c++) {
+ QTableWidgetItem* item = tableJob->item(r, c);
+ if (item) {
+ item->setFlags(Qt::ItemFlags(item->flags() & (~Qt::ItemIsEditable)));
+ }
+ }
+ }
+
+}
--- /dev/null
+#ifndef _MEDIAINFO_H_
+#define _MEDIAINFO_H_
+/*
+ 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$
+ *
+ */
+
+#include <QtGui>
+#include "ui_mediainfo.h"
+#include "console.h"
+#include "pages.h"
+
+class MediaInfo : public Pages, public Ui::mediaInfoForm
+{
+ Q_OBJECT
+
+public:
+ MediaInfo(QTreeWidgetItem *parentWidget, QString &mediaId);
+
+private slots:
+ void pruneVol();
+ void purgeVol();
+ void deleteVol();
+ void editVol();
+ void showInfoForJob(QTableWidgetItem * item);
+
+private:
+ void populateForm();
+ QString m_mediaName;
+ QString m_mediaId;
+};
+
+#endif /* _MEDIAINFO_H_ */
--- /dev/null
+<ui version="4.0" >
+ <class>mediaInfoForm</class>
+ <widget class="QWidget" name="mediaInfoForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>828</width>
+ <height>852</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item>
+ <widget class="QPushButton" name="pbEdit" >
+ <property name="text" >
+ <string>Edit</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../main.qrc" >
+ <normaloff>:/images/edit.png</normaloff>:/images/edit.png</iconset>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbPurge" >
+ <property name="text" >
+ <string>Purge</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="pbDelete" >
+ <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="pbPrune" >
+ <property name="text" >
+ <string>Prune</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../main.qrc" >
+ <normaloff>:/images/edit-cut.png</normaloff>:/images/edit-cut.png</iconset>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbLoad" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Load</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../main.qrc" >
+ <normaloff>:/images/intern.png</normaloff>:/images/intern.png</iconset>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pbUnload" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Unload</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../main.qrc" >
+ <normaloff>:/images/extern.png</normaloff>:/images/extern.png</iconset>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3" >
+ <property name="sizeConstraint" >
+ <enum>QLayout::SetFixedSize</enum>
+ </property>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>251</width>
+ <height>241</height>
+ </size>
+ </property>
+ <property name="baseSize" >
+ <size>
+ <width>251</width>
+ <height>243</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Information</string>
+ </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="1" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Pool:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="label_Pool" >
+ <property name="text" >
+ <string>Default</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>Online:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLabel" name="label_Online" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="pixmap" >
+ <pixmap resource="../main.qrc" >:/images/inflag0.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>Enabled:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLabel" name="label_Enabled" >
+ <property name="text" >
+ <string>yes</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Location:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QLabel" name="label_Location" >
+ <property name="text" >
+ <string>Vault</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>Status:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" >
+ <widget class="QLabel" name="label_VolStatus" >
+ <property name="text" >
+ <string>Append</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" >
+ <widget class="QLabel" name="label_33" >
+ <property name="text" >
+ <string>Media Type:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1" >
+ <widget class="QLabel" name="label_MediaType" >
+ <property name="text" >
+ <string>File</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0" >
+ <widget class="QLabel" name="label_35" >
+ <property name="text" >
+ <string>Recycle Pool:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="1" >
+ <widget class="QLabel" name="label_RecyclePool" >
+ <property name="text" >
+ <string>Scratch</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_17" >
+ <property name="text" >
+ <string>Name:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="label_VolumeName" >
+ <property name="text" >
+ <string>Vol0001</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_3" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>261</width>
+ <height>241</height>
+ </size>
+ </property>
+ <property name="baseSize" >
+ <size>
+ <width>261</width>
+ <height>241</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Statistics</string>
+ </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_6" >
+ <property name="text" >
+ <string>Vol Bytes:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="label_VolBytes" >
+ <property name="text" >
+ <string>19.8 MB</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_11" >
+ <property name="text" >
+ <string>Vol Mounts:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="label_VolMounts" >
+ <property name="text" >
+ <string>10</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_12" >
+ <property name="text" >
+ <string>Recycle count:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLabel" name="label_RecycleCount" >
+ <property name="text" >
+ <string>5</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label_13" >
+ <property name="text" >
+ <string>Read time:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLabel" name="label_VolReadTime" >
+ <property name="text" >
+ <string>10 mins</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="label_14" >
+ <property name="text" >
+ <string>Write time:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QLabel" name="label_VolWriteTime" >
+ <property name="text" >
+ <string>20 mins</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QLabel" name="label_15" >
+ <property name="text" >
+ <string>Errors:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" >
+ <widget class="QLabel" name="label_VolErrors" >
+ <property name="text" >
+ <string>0</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" >
+ <widget class="QLabel" name="label_31" >
+ <property name="text" >
+ <string>Last Written:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1" >
+ <widget class="QLabel" name="label_LastWritten" >
+ <property name="text" >
+ <string>2009-07-05 12:23:00</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0" >
+ <widget class="QLabel" name="label_16" >
+ <property name="text" >
+ <string>First Writtern:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="1" >
+ <widget class="QLabel" name="label_FirstWritten" >
+ <property name="text" >
+ <string>2009-06-05 10:00:00</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_4" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>200</width>
+ <height>241</height>
+ </size>
+ </property>
+ <property name="baseSize" >
+ <size>
+ <width>200</width>
+ <height>241</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Limits</string>
+ </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_9" >
+ <property name="text" >
+ <string>Use duration:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QLabel" name="label_VolUseDuration" >
+ <property name="text" >
+ <string>0</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_10" >
+ <property name="text" >
+ <string>Max jobs:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QLabel" name="label_MaxVolJobs" >
+ <property name="text" >
+ <string>0</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_37" >
+ <property name="text" >
+ <string>Max files:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLabel" name="label_MaxVolFiles" >
+ <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_38" >
+ <property name="text" >
+ <string>Max bytes:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QLabel" name="label_MaxVolBytes" >
+ <property name="text" >
+ <string>0</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="label_41" >
+ <property name="text" >
+ <string>Recycle:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" >
+ <widget class="QCheckBox" name="chkbox_Recycle" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QLabel" name="label_8" >
+ <property name="text" >
+ <string>Retention:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" >
+ <widget class="QLabel" name="label_VolRetention" >
+ <property name="text" >
+ <string>365 days</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" >
+ <widget class="QLabel" name="label_7" >
+ <property name="text" >
+ <string>Expire:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1" >
+ <widget class="QLabel" name="label_Expire" >
+ <property name="text" >
+ <string>2010-08-03 23:10:03</string>
+ </property>
+ <property name="textInteractionFlags" >
+ <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title" >
+ <string>Jobs</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <widget class="QTableWidget" name="tableJob" >
+ <column>
+ <property name="text" >
+ <string>JobId</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>Name</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>Start Time</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>Type</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>Level</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>Files</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>Bytes</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>Status</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="../main.qrc" />
+ </resources>
+ <connections/>
+</ui>
#include <math.h>
#include "medialist.h"
#include "mediaedit/mediaedit.h"
+#include "mediainfo/mediainfo.h"
#include "joblist/joblist.h"
#include "relabel/relabel.h"
#include "run/run.h"
mainWin->createPageJobList(m_currentVolumeName, "", "", "", parentItem);
}
+/*
+ * Called from the signal of the context sensitive menu!
+ */
+void MediaList::viewVolume()
+{
+ QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
+ MediaInfo* view = new MediaInfo(parentItem, m_currentVolumeName);
+ connect(view, SIGNAL(destroyed()), this, SLOT(populateTree()));
+
+}
+
/*
* When the treeWidgetItem in the page selector tree is singleclicked, Make sure
* The tree has been populated.
void MediaList::createContextMenu()
{
mp_treeWidget->setContextMenuPolicy(Qt::ActionsContextMenu);
+ connect(mp_treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(viewVolume()));
connect(actionEditVolume, SIGNAL(triggered()), this, SLOT(editVolume()));
connect(actionListJobsOnVolume, SIGNAL(triggered()), this, SLOT(showJobs()));
connect(actionDeleteVolume, SIGNAL(triggered()), this, SLOT(deleteVolume()));
private slots:
void populateTree();
void showJobs();
+ void viewVolume();
void editVolume();
void deleteVolume();
void purgeVolume();
ItemFormatterBase::BYTES_CONVERSION ItemFormatterBase::cnvFlag(BYTES_CONVERSION_IEC);
-QString ItemFormatterBase::convertBytesIEC(qint64 qfld)
+QString convertBytesIEC(qint64 qfld)
{
static const qint64 KB = Q_INT64_C(1024);
static const qint64 MB = (KB * KB);
return QString("%1 %2iB").arg(qfld / 1000.0, 0, 'f', 2).arg(suffix);
}
-QString ItemFormatterBase::convertBytesSI(qint64 qfld)
+QString convertBytesSI(qint64 qfld)
{
static const qint64 KB = Q_INT64_C(1000);
static const qint64 MB = (KB * KB);
*/
QString convertJobStatus(const QString &sts);
+/* bytes formatted as power-of-two with IEC suffixes (KiB, MiB, and so on) */
+QString convertBytesIEC(qint64 fld);
+
+/* bytes formatted as power-of-ten with SI suffixes (kB, MB, and so on) */
+QString convertBytesSI(qint64 fld);
+
/*
* disable widget updating
*/
/* sets the *optional* value used for sorting */
virtual void setSortValue(int index, const QVariant &value) = 0;
-private:
-
- /* bytes formatted as power-of-two with IEC suffixes (KiB, MiB, and so on) */
- static QString convertBytesIEC(qint64 fld);
-
- /* bytes formatted as power-of-ten with SI suffixes (kB, MB, and so on) */
- static QString convertBytesSI(qint64 fld);
-
private:
static BYTES_CONVERSION cnvFlag;
};
General:
+04Aug09
+ebl bat: Go to the media info panel when double-click on job page or media list
+ebl bat: cleanup job and mediainfo panel
+03Aug09
+ebl Add new media info panel to bat
02Aug09
kes Remove old sqlite3 build from bacula.spec
kes Move bat from bacula.spec to bacula-bat.spec
nice tests/migration-jobspan-test
nice tests/migration-volume-test
nice tests/migration-time-test
-nice tests/multiple-storage-test
+nice tests/multi-storage-test
nice tests/hardlink-test
nice tests/tls-test
nice tests/virtual-changer-test
echo " === Starting $TestName at `date +%R:%S` ===" >> ${working}/log
echo " "
export zstat
+ zstat=0
+ bstat=0
+ rstat=0
+ dstat=0
}
require_root()
stop_bacula()
{
${bin}/bacula stop 2>&1 >/dev/null
- zstat=0
- bstat=0
- rstat=0
- dstat=0
}
check_for_zombie_jobs()