From: Eric Bollengier Date: Mon, 3 Aug 2009 20:58:33 +0000 (+0200) Subject: Add new mediainfo panel to bat X-Git-Tag: Release-5.0.0~339^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1ea83a70d2e075a24b5381b21a2ad88ce93d2393;p=bacula%2Fbacula Add new mediainfo panel to bat --- diff --git a/bacula/src/qt-console/bat.pro.in b/bacula/src/qt-console/bat.pro.in index ba9d773fed..fefd61410e 100644 --- a/bacula/src/qt-console/bat.pro.in +++ b/bacula/src/qt-console/bat.pro.in @@ -51,7 +51,7 @@ 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 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 @@ -145,6 +145,10 @@ qwt { HEADERS += help/help.h SOURCES += help/help.cpp +# Media info dialog +HEADERS += mediainfo/mediainfo.h +HEADERS += mediainfo/mediainfo.cpp + ## Status Dir HEADERS += status/dirstat.h SOURCES += status/dirstat.cpp diff --git a/bacula/src/qt-console/images/edit.png b/bacula/src/qt-console/images/edit.png new file mode 100644 index 0000000000..36775390f1 Binary files /dev/null and b/bacula/src/qt-console/images/edit.png differ diff --git a/bacula/src/qt-console/images/extern.png b/bacula/src/qt-console/images/extern.png new file mode 100644 index 0000000000..cfc3b35559 Binary files /dev/null and b/bacula/src/qt-console/images/extern.png differ diff --git a/bacula/src/qt-console/images/intern.png b/bacula/src/qt-console/images/intern.png new file mode 100644 index 0000000000..64b8300d22 Binary files /dev/null and b/bacula/src/qt-console/images/intern.png differ diff --git a/bacula/src/qt-console/main.qrc b/bacula/src/qt-console/main.qrc index dddeb1a4c2..0f9d56ea16 100644 --- a/bacula/src/qt-console/main.qrc +++ b/bacula/src/qt-console/main.qrc @@ -1,5 +1,8 @@ + images/edit.png + images/extern.png + images/intern.png images/R.png images/T.png images/f.png diff --git a/bacula/src/qt-console/mediainfo/mediainfo.cpp b/bacula/src/qt-console/mediainfo/mediainfo.cpp new file mode 100644 index 0000000000..be37689fe8 --- /dev/null +++ b/bacula/src/qt-console/mediainfo/mediainfo.cpp @@ -0,0 +1,47 @@ +/* + 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 +#include +#include +#include "mediainfo.h" + +/* + * A constructor + */ +MediaInfo::MediaInfo(QTreeWidgetItem *parentWidget, QString &mediaId) +{ + setupUi(this); + pgInitialize(tr("Media Info"), parentWidget); + QTreeWidgetItem* thisitem = mainWin->getFromHash(this); + thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/cartridge-edit.png"))); + m_closeable = true; + dockPage(); + setCurrent(); +} diff --git a/bacula/src/qt-console/mediainfo/mediainfo.h b/bacula/src/qt-console/mediainfo/mediainfo.h new file mode 100644 index 0000000000..6311e86970 --- /dev/null +++ b/bacula/src/qt-console/mediainfo/mediainfo.h @@ -0,0 +1,53 @@ +#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 +#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: + +private: + QString m_mediaName; +}; + +#endif /* _MEDIAINFO_H_ */ diff --git a/bacula/src/qt-console/mediainfo/mediainfo.ui b/bacula/src/qt-console/mediainfo/mediainfo.ui new file mode 100644 index 0000000000..257533e204 --- /dev/null +++ b/bacula/src/qt-console/mediainfo/mediainfo.ui @@ -0,0 +1,634 @@ + + mediaInfoForm + + + + 0 + 0 + 828 + 852 + + + + Form + + + + + + + + Load + + + + :/images/intern.png:/images/intern.png + + + true + + + + + + + Unload + + + + :/images/extern.png:/images/extern.png + + + true + + + + + + + Edit + + + + :/images/edit.png:/images/edit.png + + + true + + + + + + + Purge + + + + :/images/purge.png:/images/purge.png + + + true + + + + + + + Prune + + + + :/images/edit-cut.png:/images/edit-cut.png + + + true + + + + + + + Delete + + + + :/images/purge.png:/images/purge.png + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + QLayout::SetFixedSize + + + + + + 0 + 0 + + + + + 251 + 241 + + + + + 251 + 243 + + + + Information + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Pool: + + + + + + + Online: + + + + + + + + + + :/images/inflag0.png + + + + + + + Enabled: + + + + + + + yes + + + + + + + Location: + + + + + + + Vault + + + + + + + Status: + + + + + + + Append + + + + + + + Media Type: + + + + + + + File + + + + + + + Expire: + + + + + + + 2010-08-03 23:10:03 + + + + + + + Recycle Pool: + + + + + + + Scratch + + + + + + + Default + + + + + label + label_2 + label_3 + label_4 + label_5 + label_7 + label_17 + label_18 + label_19 + label_20 + label_22 + label_33 + label_34 + label_35 + label_36 + label_16 + + + + + + + 0 + 0 + + + + + 261 + 241 + + + + + 261 + 241 + + + + Statistics + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Vol Bytes: + + + + + + + Vol Mounts: + + + + + + + 10 + + + + + + + Recycle count: + + + + + + + 5 + + + + + + + Read time: + + + + + + + 10 mins + + + + + + + Write time: + + + + + + + 20 mins + + + + + + + Errors: + + + + + + + 0 + + + + + + + Last Written: + + + + + + + 2009-07-05 12:23:00 + + + + + + + 19.8 MB + + + + + label_14 + label_15 + label_11 + label_12 + label_13 + label_26 + label_27 + label_28 + label_29 + label_30 + label_6 + label_31 + label_32 + label_21 + + + + + + + 0 + 0 + + + + + 200 + 241 + + + + + 200 + 241 + + + + Limits + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + Max use duration: + + + + + + + 0 + + + + + + + Max jobs: + + + + + + + 0 + + + + + + + Max files: + + + + + + + 0 + + + + + + + Max bytes: + + + + + + + 0 + + + + + + + Recycle: + + + + + + + + + + + + + + Retention: + + + + + + + 365 days + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + Jobs + + + + + + + JobId + + + + + Name + + + + + Start Time + + + + + Type + + + + + Level + + + + + Files + + + + + Bytes + + + + + Status + + + + + + + + + + + + + + diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index f48d287ad8..c3315e9a18 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -41,6 +41,7 @@ #include #include "medialist.h" #include "mediaedit/mediaedit.h" +#include "mediainfo/mediainfo.h" #include "joblist/joblist.h" #include "relabel/relabel.h" #include "run/run.h" @@ -279,6 +280,16 @@ void MediaList::showJobs() mainWin->createPageJobList(m_currentVolumeName, "", "", "", parentItem); } +/* + * Called from the signal of the context sensitive menu! + */ +void MediaList::viewVolume() +{ + MediaInfo* view = new MediaInfo(mainWin->getFromHash(this), m_currentVolumeId); + connect(view, SIGNAL(destroyed()), this, SLOT(populateTree())); + +} + /* * When the treeWidgetItem in the page selector tree is singleclicked, Make sure * The tree has been populated. @@ -333,6 +344,7 @@ void MediaList::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetI 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())); diff --git a/bacula/src/qt-console/medialist/medialist.h b/bacula/src/qt-console/medialist/medialist.h index f51f565e3b..63c2a19f3f 100644 --- a/bacula/src/qt-console/medialist/medialist.h +++ b/bacula/src/qt-console/medialist/medialist.h @@ -54,6 +54,7 @@ public slots: private slots: void populateTree(); void showJobs(); + void viewVolume(); void editVolume(); void deleteVolume(); void purgeVolume(); diff --git a/bacula/technotes b/bacula/technotes index 323db81f12..c61981288f 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -2,6 +2,8 @@ General: +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