]> git.sur5r.net Git - bacula/bacula/commitdiff
Added update volume from pool. Works like a charm.
authorDirk H Bartley <dbartley@schupan.com>
Fri, 8 Jun 2007 01:36:50 +0000 (01:36 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Fri, 8 Jun 2007 01:36:50 +0000 (01:36 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4997 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/medialist/medialist.cpp
bacula/src/qt-console/medialist/medialist.h
bacula/src/qt-console/medialist/medialist.ui

index 8922abbe5996d538106a54a1cdb9d9b23c5d9a7e..fa475d1b6a5b3dce860ae0821aec6e4819385f1d 100644 (file)
@@ -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();
+}
index 47fed38ee55c62d1ab8e663a35c5ca8c8dc6aace..f72549efa7efbb62ebc6b10a7b1b1e5e424b18bf 100644 (file)
@@ -60,6 +60,7 @@ private slots:
    void pruneVolume();
    void relabelVolume();
    void allVolumesFromPool();
+   void volumeFromPool();
 
 private:
    void createContextMenu();
index 6f0020b240f407fa11d0ba8322ec506179f2aa00..422fe8dceb5dc5f6f546dafde714ae5d5a47de77 100644 (file)
     <string>Update all Volumes From Pool</string>
    </property>
   </action>
+  <action name="actionVolumeFromPool" >
+   <property name="icon" >
+    <iconset resource="../main.qrc" >:/images/cartridge-edit.svg</iconset>
+   </property>
+   <property name="text" >
+    <string>Volume From Pool</string>
+   </property>
+  </action>
  </widget>
  <resources>
   <include location="../main.qrc" />