From e5ece846f8ed683a7ab99979d97f90e56f7f3816 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 4 Aug 2009 11:29:24 +0200 Subject: [PATCH] bat: Go to the media info panel when double-click on job page or media list --- bacula/src/qt-console/bat.pro.in | 2 +- bacula/src/qt-console/job/job.cpp | 20 ++++++++++--------- bacula/src/qt-console/job/job.h | 1 + bacula/src/qt-console/medialist/medialist.cpp | 3 ++- bacula/technotes | 2 ++ 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/bacula/src/qt-console/bat.pro.in b/bacula/src/qt-console/bat.pro.in index fefd61410e..45b4d55505 100644 --- a/bacula/src/qt-console/bat.pro.in +++ b/bacula/src/qt-console/bat.pro.in @@ -147,7 +147,7 @@ SOURCES += help/help.cpp # Media info dialog HEADERS += mediainfo/mediainfo.h -HEADERS += mediainfo/mediainfo.cpp +SOURCES += mediainfo/mediainfo.cpp ## Status Dir HEADERS += status/dirstat.h diff --git a/bacula/src/qt-console/job/job.cpp b/bacula/src/qt-console/job/job.cpp index 5c8568ba1e..f95ae5b613 100644 --- a/bacula/src/qt-console/job/job.cpp +++ b/bacula/src/qt-console/job/job.cpp @@ -26,18 +26,10 @@ 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) { @@ -53,12 +45,22 @@ Job::Job(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem) 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", diff --git a/bacula/src/qt-console/job/job.h b/bacula/src/qt-console/job/job.h index 9074c237a5..2b3d046489 100644 --- a/bacula/src/qt-console/job/job.h +++ b/bacula/src/qt-console/job/job.h @@ -42,6 +42,7 @@ public: public slots: void populateAll(); void deleteJob(); + void showInfoVolume(QListWidgetItem *); private slots: diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index c3315e9a18..d956a4d7c0 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -285,7 +285,8 @@ void MediaList::showJobs() */ void MediaList::viewVolume() { - MediaInfo* view = new MediaInfo(mainWin->getFromHash(this), m_currentVolumeId); + QTreeWidgetItem *parentItem = mainWin->getFromHash(this); + MediaInfo* view = new MediaInfo(parentItem, m_currentVolumeName); connect(view, SIGNAL(destroyed()), this, SLOT(populateTree())); } diff --git a/bacula/technotes b/bacula/technotes index c61981288f..769f961a08 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -2,6 +2,8 @@ General: +04Aug09 +ebl bat: Go to the media info panel when double-click on job page or media list 03Aug09 ebl Add new media info panel to bat 02Aug09 -- 2.39.5