From: Dirk H Bartley Date: Fri, 8 Jun 2007 01:36:50 +0000 (+0000) Subject: Added update volume from pool. Works like a charm. X-Git-Tag: Release-7.0.0~6149 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a08ddd5566a3eb72f872abc090b4ede340829671;p=bacula%2Fbacula Added update volume from pool. Works like a charm. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4997 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index 8922abbe59..fa475d1b6a 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -213,8 +213,9 @@ void MediaList::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetI mp_treeWidget->removeAction(actionDeleteVolume); mp_treeWidget->removeAction(actionPruneVolume); mp_treeWidget->removeAction(actionPurgeVolume); - mp_treeWidget->removeAction(actionRelabelVolume); + mp_treeWidget->removeAction(actionRelabelVolume); mp_treeWidget->removeAction(actionAllVolumesFromPool); + mp_treeWidget->removeAction(actionVolumeFromPool); } int treedepth = currentwidgetitem->data(0, Qt::UserRole).toInt(); @@ -227,6 +228,7 @@ void MediaList::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetI mp_treeWidget->addAction(actionPruneVolume); mp_treeWidget->addAction(actionPurgeVolume); mp_treeWidget->addAction(actionRelabelVolume); + mp_treeWidget->addAction(actionVolumeFromPool); } else if (treedepth == 1) { /* *******FIXME****** * I can't seem to get "All volumes from pool" or "Volume from pool" to work @@ -259,6 +261,7 @@ void MediaList::createContextMenu() connect(actionRefreshMediaList, SIGNAL(triggered()), this, SLOT(populateTree())); connect(actionAllVolumesFromPool, SIGNAL(triggered()), this, SLOT(allVolumesFromPool())); + connect(actionVolumeFromPool, SIGNAL(triggered()), this, SLOT(volumeFromPool())); } /* @@ -346,3 +349,17 @@ void MediaList::allVolumesFromPool() consoleCommand(cmd); populateTree(); } + +/* + * Called from the signal of the context sensitive menu to purge! + */ +void MediaList::volumeFromPool() +{ + QTreeWidgetItem *currentItem = mp_treeWidget->currentItem(); + QTreeWidgetItem *parent = currentItem->parent(); + QString pool = parent->text(0); + QString cmd; + cmd = "update volume=" + m_currentVolumeName + " frompool=" + pool; + consoleCommand(cmd); + populateTree(); +} diff --git a/bacula/src/qt-console/medialist/medialist.h b/bacula/src/qt-console/medialist/medialist.h index 47fed38ee5..f72549efa7 100644 --- a/bacula/src/qt-console/medialist/medialist.h +++ b/bacula/src/qt-console/medialist/medialist.h @@ -60,6 +60,7 @@ private slots: void pruneVolume(); void relabelVolume(); void allVolumesFromPool(); + void volumeFromPool(); private: void createContextMenu(); diff --git a/bacula/src/qt-console/medialist/medialist.ui b/bacula/src/qt-console/medialist/medialist.ui index 6f0020b240..422fe8dceb 100644 --- a/bacula/src/qt-console/medialist/medialist.ui +++ b/bacula/src/qt-console/medialist/medialist.ui @@ -99,6 +99,14 @@ Update all Volumes From Pool + + + :/images/cartridge-edit.svg + + + Volume From Pool + +