From 1ea83a70d2e075a24b5381b21a2ad88ce93d2393 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 3 Aug 2009 22:58:33 +0200 Subject: [PATCH] Add new mediainfo panel to bat --- bacula/src/qt-console/bat.pro.in | 6 +- bacula/src/qt-console/images/edit.png | Bin 0 -> 1092 bytes bacula/src/qt-console/images/extern.png | Bin 0 -> 901 bytes bacula/src/qt-console/images/intern.png | Bin 0 -> 1079 bytes bacula/src/qt-console/main.qrc | 3 + bacula/src/qt-console/mediainfo/mediainfo.cpp | 47 ++ bacula/src/qt-console/mediainfo/mediainfo.h | 53 ++ bacula/src/qt-console/mediainfo/mediainfo.ui | 634 ++++++++++++++++++ bacula/src/qt-console/medialist/medialist.cpp | 12 + bacula/src/qt-console/medialist/medialist.h | 1 + bacula/technotes | 2 + 11 files changed, 757 insertions(+), 1 deletion(-) create mode 100644 bacula/src/qt-console/images/edit.png create mode 100644 bacula/src/qt-console/images/extern.png create mode 100644 bacula/src/qt-console/images/intern.png create mode 100644 bacula/src/qt-console/mediainfo/mediainfo.cpp create mode 100644 bacula/src/qt-console/mediainfo/mediainfo.h create mode 100644 bacula/src/qt-console/mediainfo/mediainfo.ui 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 0000000000000000000000000000000000000000..36775390f1e8e89e7007e4978a003751acab855d GIT binary patch literal 1092 zcmV-K1iSl*P)~5*A*!^YQ=y03CEi zSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@00XE=L_t(|+O3vfXdG1- z#ea8pHk&l*+HTsiDwroRRr+SzZGu8xHAV0#Mi7GFgQ9}95d@3R>WdHJpJ03lL27YZ z&7+8I)5MxKX*Coot(4-HO(;o7$nMVU%)OrvGdufdlG>slTxJ<&&N<)t?me^cKh)6B zkaa)Ly#&YutTM2XPN$`}w^v3+Ms5J@fZC2g78e(#TrSJMmFv3Vx{kQ6BgJA-3Wb8q z&(BLwPfr2Z18mvReSz0W99dgimD8v5vb?-3A|g{$Q5*o_Pw9UTBnPfy3$ zMNmp1B8UiD`#6qEsZ=7BN&zr1Fo5GY*6{G~$DZfC6WZ8_5ietmXsyNfz3A$Bp17_f z8yg!kK0dzPj7ET@Y9WX^s3{dO1h*xeUvMA5_ccpPMY8+$@!O?2PMr7uJN`~}v zQvjVYf>z+*Doqw4g0d{CuFJ~mDxT}`_!Il_?>>V!m*TatqD-8*rhvV6tJlV8&Yz!- zlm>tx2nvOS4j3&MqcO(t{NPdi<$k=mc8-6yMhN~s&>ri+^QsNNAqj#QL0Jkhb&EuV zo#}_D7W$|z?BLDGO};sKv4;0DaBhnZ3>T&^L`nm|cn7|(85}%{d+P}9rFLGQSY;x= zz}s)U%BP=w4X_S4aRRM5(w9R_sItMTXqy_tuHD_ZH*=J)?cu#scbLd8F!tr=+`e_a z2DJvbTX!%s6Zjn3VTHg-smOEZ`e7>bDMruy&DghB867=FraMDvJyV0K0NUQ_NcZ>k zAqd8pCIWz6ySpj>afs686mR9%nap2h?5i)xWHLOQ&9c67C(;@_$pF6gnVFfb%{?4+ zFi_9)0JwegSw8ylCnod1bNt<76ql9|gaZejLbXI)j6iEm?(m^Vac#GFUX@24eT)|d z_Ok!QPXPG-)JeK_c9G3yNu}CQN?|GM-ULQ#W@l$ZV50Njx-I}e{BoCbXMaXnimuL1 zY&%I?TarW~fl~3Lj$7n=96b1RlX@`*U;F%Z<4=?Ym5M_$X$SMMtmw>WtuaP#Pf)E^ z(OQT01p6Kp%*7akHa^BTB$GCYM4}!WN=5HAI2$L}+}uQK9eAT?QmB+dDTQs@!SArU z+T0qmtFf9UQYaKa3?c?&>Z?(yr4+3)gE%3~CfUA&i@%;_N1F;FK_rT3BPI-L8kDQZ z?;5BP!{vo5)c1IEz4Cw`{d=tsfG1ni)CRi4mHdzYWISL6SosILcm(iR4NM6D0000< KMNUMnLSTZ^3;LP> literal 0 HcmV?d00001 diff --git a/bacula/src/qt-console/images/extern.png b/bacula/src/qt-console/images/extern.png new file mode 100644 index 0000000000000000000000000000000000000000..cfc3b355594745d18660c483d9b8445f2e7ce64e GIT binary patch literal 901 zcmV;01A6?4P)w2nMjQ`lc-VSzs6RJAZc}zO(__3)1?JBMNqpCMOs=A#E2vQ zLu~1$i&jD1h!nc%M%zLKCACBi;z9%=jHa3Vn@KW>$-DFJy~o9SPhUc$DYYB%z=aF% z-tRl-yXQMkF~`_>beoFz7mi#N-o&d4^&jrdyerZA*O9#B0d2sE1Yo>QMBlvGDo`(B zmjrM%a1=P$u_H~}q9)dFYXRWF)kky=7RX)J0H=T>KmbTgPyPpMR)@TkaVhq~$0oB<94T1DBt1(cKE7jB+p^~!hn zsQJ@bb+bJ?QJEFtVgE6%JixbsBQ^90cz#>UYy{ZV68AQWv2DD0p9!Ra3}dfFG@mC6Ie`O!wOsoE|TbE z?ZCI;(hdU0*tlV|Tw(a`lW7DxdSLZ)?oaZ4y&!^yAzWC7x_#-B8fS+{twePy6ecwhJ7i9VE`+KwcU|`V4m^1*zl4fXFGuTsN`{{=O z=YXz%8WqyMcVkSj2xtJl1a^PBCqvd|soT^XR(1Oc#Z)oQ{2cHNFboW-IS#r^~N3wJQBhkBRHOFZh54%j{`nt$F$*4r2lab`phTUAli{34r@X*Nr{ljsu b_dod=n%QKhVGTx300000NkvXXu0mjfP%5c? literal 0 HcmV?d00001 diff --git a/bacula/src/qt-console/images/intern.png b/bacula/src/qt-console/images/intern.png new file mode 100644 index 0000000000000000000000000000000000000000..64b8300d22a4e404b7c3af9b7e17234bc98ec02a GIT binary patch literal 1079 zcmV-71jze|P)Vs%67${g!8w&a&eW*xOM0}_k1QAO~ zOBD^`trijS0!4h#7WJVIMiNX4YLSvleQ2t=XqwA5&E~e*O=fp4$A{esi3U@RZyq=> z-+Xia=lh@Uf95FufjxerQH9T^kGIK<#OQVQ6&o~joqbtny9H0BQvTm5&Ww-Dm;A027c8J6@JNlS;r=iao%I{JWL@8qn}} z6_K_4{OB1u{e5e=eio2-o{GwsPuIxhulLEwH}^?fbFCaZWQX6hF0);6Y6S#W;@v1T zreR=PQEb~{D18ZlUk9$x)bJ7?G;ia;fm(_xZo{%nv{uZ|j4(5kB|bP!)6rfgGQ0t_ z09inVW%2tbx*16HVwwhaG=g1V6R|A-vKg15!2urIdxVQ^&r!Ffl$%RT5D#+rAt zoXOJPeU1BH=mpphbOGqv9aRdz@fJZq1Oi|1Js;1_x$pVZZLQ~vp10W5c#7GPVSH~A zWlo?~3L|PzQEE|8S;VnJHo${<1=`Dv*3s3*<==Zy3bdhfu0wSSrfm|jOb))%K>Y)s zk+{%A`8F4910`U%iki(ac9mBFBhLV@0-05}E+RPwL9mKJ5C}?OBtFL3mLEBHY7eG+ z9V`u|0-d``jiTU=%^_Uzn!gGWfj}WjPzY!+L^Com#<|xoa`MPdw$~L=SRDgjAP^)F zf8lbzLn}t21cO;jt_1C zZovG4$6PW?qGxm^L}od`S8x9Cm*#lnXgO2!)3m>LiRMSQa(j)U_7)*_lL`5giYK^^ zPsRyY7@K1uIs@=YUZyz)kpip4%lZ|F#KP7O0_mHYou>W$TrX5dp|Uaxh6%19ey%ig zNe{>InM^obi>G=1BL|=pNCJUTyQ4~_=bga!gRIgjtqq-2TBQPCUL3wSiPGvGgrK8m z_U?ywmQq+&Kr-ba0i+gvrV<&(#+MlXCBebget?gGv%oBnF&dxPjg!ubWt(nsSu9gr z7RxB5vP-ENWC2m@Ogj_s xflzx^zC&X`31Ek60p@{4zyaKUGyVRj_6L4=uzgbMsd)eZ002ovPDHLkV1lLz;C282 literal 0 HcmV?d00001 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 -- 2.39.5