]> git.sur5r.net Git - bacula/bacula/commitdiff
Add Update Slots and update slots scan within storage context.
authorDirk H Bartley <dbartley@schupan.com>
Tue, 29 May 2007 23:13:43 +0000 (23:13 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Tue, 29 May 2007 23:13:43 +0000 (23:13 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4935 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/COMMANDS
bacula/src/qt-console/images/package-x-generic.png [new file with mode: 0644]
bacula/src/qt-console/main.qrc
bacula/src/qt-console/medialist/medialist.cpp
bacula/src/qt-console/medialist/medialist.h
bacula/src/qt-console/medialist/medialist.ui
bacula/src/qt-console/storage/storage.cpp
bacula/src/qt-console/storage/storage.h
bacula/src/qt-console/storage/storage.ui

index 43b86bb33aae0d2e6846c29af24c123b3975d645..6082078d1d81cf7535ce1f904c70e90fd27a8f68 100644 (file)
@@ -27,8 +27,9 @@ I'd say we could choose not to implement this in bat
 unmount [ jobid=<id> | job=<job-name> ]
 Mmmmm
 
-update media, volume, pool, slots
-media/volume still has more work, they are the same after all
+update 
+  /* Attempted, having problems */
+  Volume from Pool All Volumes from Pool
 
 use
 still need to make decisions about how to handle multiple catalogs
@@ -120,3 +121,6 @@ reload
 status
 
 unmount storage=<storage-name> [ drive=\lt{}num\gt{} ]
+
+update volume (via mediaedit)
+  "update slots" "update slots scan" (context of storage)
diff --git a/bacula/src/qt-console/images/package-x-generic.png b/bacula/src/qt-console/images/package-x-generic.png
new file mode 100644 (file)
index 0000000..4311b57
Binary files /dev/null and b/bacula/src/qt-console/images/package-x-generic.png differ
index 55eb8a306250f533eed9a097a46e66f672cde05d..2667db21a9f7ee345b6e1374dbb3c60e2c70554b 100644 (file)
@@ -25,7 +25,7 @@
         <file>images/new.png</file>
         <file>images/next.png</file>
         <file>images/open.png</file>
-        <file>images/package-x-generic.svg</file>
+        <file>images/package-x-generic.png</file>
         <file>images/paste.png</file>
         <file>images/print.png</file>
         <file>images/restore.png</file>
index 027d6cb023c3a00f07da451c109e73c22eeaa86c..d50198a66db145f8201b39c36688c1d7989fc729 100644 (file)
@@ -208,20 +208,18 @@ void MediaList::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetI
    if (m_checkcurwidget) {
       /* The Previous item */
       if (previouswidgetitem) { /* avoid a segfault if first time */
-         int treedepth = previouswidgetitem->data(0, Qt::UserRole).toInt();
-         if (treedepth == 2){
-            mp_treeWidget->removeAction(actionEditVolume);
-            mp_treeWidget->removeAction(actionListJobsOnVolume);
-            mp_treeWidget->removeAction(actionDeleteVolume);
-            mp_treeWidget->removeAction(actionPruneVolume);
-            mp_treeWidget->removeAction(actionPurgeVolume);
-            mp_treeWidget->removeAction(actionRelabelVolume);
-         }
+         mp_treeWidget->removeAction(actionEditVolume);
+         mp_treeWidget->removeAction(actionListJobsOnVolume);
+         mp_treeWidget->removeAction(actionDeleteVolume);
+         mp_treeWidget->removeAction(actionPruneVolume);
+         mp_treeWidget->removeAction(actionPurgeVolume);
+          mp_treeWidget->removeAction(actionRelabelVolume);
+         mp_treeWidget->removeAction(actionAllVolumesFromPool);
       }
 
       int treedepth = currentwidgetitem->data(0, Qt::UserRole).toInt();
+      m_currentVolumeName=currentwidgetitem->text(0);
       if (treedepth == 2){
-         m_currentVolumeName=currentwidgetitem->text(0);
          m_currentVolumeId=currentwidgetitem->text(1);
          mp_treeWidget->addAction(actionEditVolume);
          mp_treeWidget->addAction(actionListJobsOnVolume);
@@ -229,6 +227,12 @@ void MediaList::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetI
          mp_treeWidget->addAction(actionPruneVolume);
          mp_treeWidget->addAction(actionPurgeVolume);
          mp_treeWidget->addAction(actionRelabelVolume);
+      } else if (treedepth == 1) {
+/*  *******FIXME******
+ *  I can't seem to get "All volumes from pool" or "Volume from pool" to work
+ *  in one sentence command.   Works when you do it one step at a time vi console
+         mp_treeWidget->addAction(actionAllVolumesFromPool);
+*/
       }
    }
 }
@@ -254,6 +258,7 @@ void MediaList::createContextMenu()
    /* connect to the action specific to this pages class */
    connect(actionRefreshMediaList, SIGNAL(triggered()), this,
                 SLOT(populateTree()));
+   connect(actionAllVolumesFromPool, SIGNAL(triggered()), this, SLOT(allVolumesFromPool()));
 }
 
 /*
@@ -330,3 +335,14 @@ void MediaList::relabelVolume()
    setConsoleCurrent();
    new relabelDialog(m_console, m_currentVolumeName);
 }
+
+/*
+ * Called from the signal of the context sensitive menu to purge!
+ */
+void MediaList::allVolumesFromPool()
+{
+   QString cmd("update pool=");
+   cmd += m_currentVolumeName + " All Volumes From Pool";
+   consoleCommand(cmd);
+   populateTree();
+}
index 143e83a3adc0e69f1fa738be94b6aeb2c6b69ea3..17130cbe8584c110950e5bb7cbe78ea39a3a0d52 100644 (file)
@@ -59,6 +59,7 @@ private slots:
    void purgeVolume();
    void pruneVolume();
    void relabelVolume();
+   void allVolumesFromPool();
 
 private:
    void createContextMenu();
index 4dfb5bb1f1354bc0741d7d906b402c4895f6fba5..6f0020b240f407fa11d0ba8322ec506179f2aa00 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>636</width>
-    <height>357</height>
+    <width>490</width>
+    <height>303</height>
    </rect>
   </property>
   <property name="windowTitle" >
     <string>Relabel Volume</string>
    </property>
   </action>
+  <action name="actionAllVolumesFromPool" >
+   <property name="icon" >
+    <iconset resource="../main.qrc" >:/images/cartridge-edit.svg</iconset>
+   </property>
+   <property name="text" >
+    <string>Update all Volumes From Pool</string>
+   </property>
+   <property name="iconText" >
+    <string>Update all Volumes From Pool</string>
+   </property>
+   <property name="toolTip" >
+    <string>Update all Volumes From Pool</string>
+   </property>
+   <property name="statusTip" >
+    <string>Update all Volumes From Pool</string>
+   </property>
+  </action>
  </widget>
  <resources>
   <include location="../main.qrc" />
index 4b8bd9846ab6b85bb3528c0061deabb249c79f72..b2f8ac64927ada06e513abdae444eb11d0cb734e 100644 (file)
@@ -48,7 +48,7 @@ Storage::Storage()
    m_name = "Storage";
    pgInitialize();
    QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
-   thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/package-x-generic.svg")));
+   thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/package-x-generic.png")));
 
    /* mp_treeWidget, Storage Tree Tree Widget inherited from ui_storage.h */
    m_populated = false;
@@ -165,6 +165,8 @@ void Storage::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetIte
             mp_treeWidget->removeAction(actionLabelStorage);
             mp_treeWidget->removeAction(actionMountStorage);
             mp_treeWidget->removeAction(actionUnMountStorage);
+            mp_treeWidget->removeAction(actionUpdateSlots);
+            mp_treeWidget->removeAction(actionUpdateSlotsScan);
          }
       }
 
@@ -179,14 +181,22 @@ void Storage::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetIte
          mp_treeWidget->addAction(actionMountStorage);
          mp_treeWidget->addAction(actionUnMountStorage);
          QString text;
-         text = "Status Storage " + m_currentStorage;
+         text = "Status Storage \"" + m_currentStorage + "\"";
          actionStatusStorageInConsole->setText(text);
-         text = "Label media in Storage " + m_currentStorage;
+         text = "Label media in Storage \"" + m_currentStorage + "\"";
          actionLabelStorage->setText(text);
-         text = "Mount media in Storage " + m_currentStorage;
+         text = "Mount media in Storage \"" + m_currentStorage + "\"";
          actionMountStorage->setText(text);
-         text = "\"UN\" Mount media in Storage " + m_currentStorage;
+         text = "\"UN\" Mount media in Storage \"" + m_currentStorage + "\"";
          actionUnMountStorage->setText(text);
+         if (m_currentAutoChanger != 0) {
+            mp_treeWidget->addAction(actionUpdateSlots);
+            mp_treeWidget->addAction(actionUpdateSlotsScan);
+            text = "Barcode Scan media in Storage \"" + m_currentStorage + "\"";
+            actionUpdateSlots->setText(text);
+            text = "Mount and read scan media in Storage \"" + m_currentStorage + "\"";
+            actionUpdateSlotsScan->setText(text);
+         }
       }
    }
 }
@@ -214,6 +224,10 @@ void Storage::createContextMenu()
                 SLOT(consoleMountStorage()));
    connect(actionUnMountStorage, SIGNAL(triggered()), this,
                 SLOT(consoleUnMountStorage()));
+   connect(actionUpdateSlots, SIGNAL(triggered()), this,
+                SLOT(consoleUpdateSlots()));
+   connect(actionUpdateSlotsScan, SIGNAL(triggered()), this,
+                SLOT(consoleUpdateSlotsScan()));
 }
 
 /*
@@ -268,3 +282,19 @@ void Storage::consoleUnMountStorage()
    cmd += m_currentStorage;
    consoleCommand(cmd);
 }
+
+/* Update Slots */
+void Storage::consoleUpdateSlots()
+{
+   QString cmd("update slots storage=");
+   cmd += m_currentStorage;
+   consoleCommand(cmd);
+}
+
+/* Update Slots Scan*/
+void Storage::consoleUpdateSlotsScan()
+{
+   QString cmd("update slots scan storage=");
+   cmd += m_currentStorage;
+   consoleCommand(cmd);
+}
index 7705640511db7c87f976167e35bfa0f64cffdd02..fb9d13e0ae6a3f71e6a24f3a87cfb177da4197cc 100644 (file)
@@ -53,11 +53,12 @@ public slots:
 
 private slots:
    void populateTree();
-//   void showJobs();
    void consoleStatusStorage();
    void consoleLabelStorage();
    void consoleMountStorage();
    void consoleUnMountStorage();
+   void consoleUpdateSlots();
+   void consoleUpdateSlotsScan();
 
 private:
    void createContextMenu();
index 61a37e5d849f4a99b16b085182183b8d55120434..7ec0c643ac98b26910b7bb4b6d70cb74333a58b3 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>791</width>
-    <height>644</height>
+    <width>468</width>
+    <height>311</height>
    </rect>
   </property>
   <property name="windowTitle" >
@@ -41,6 +41,9 @@
    <property name="text" >
     <string>Status Storage In Console</string>
    </property>
+   <property name="statusTip" >
+    <string>Status Storage In Console</string>
+   </property>
   </action>
   <action name="actionLabelStorage" >
    <property name="icon" >
@@ -49,6 +52,9 @@
    <property name="text" >
     <string>Label Storage</string>
    </property>
+   <property name="statusTip" >
+    <string>Label Storage</string>
+   </property>
   </action>
   <action name="actionMountStorage" >
    <property name="icon" >
@@ -57,6 +63,9 @@
    <property name="text" >
     <string>MountStorage</string>
    </property>
+   <property name="statusTip" >
+    <string>MountStorage</string>
+   </property>
   </action>
   <action name="actionUnMountStorage" >
    <property name="icon" >
    <property name="text" >
     <string>UnMount Storage</string>
    </property>
+   <property name="statusTip" >
+    <string>UnMount Storage</string>
+   </property>
+  </action>
+  <action name="actionUpdateSlots" >
+   <property name="icon" >
+    <iconset resource="../main.qrc" >:/images/package-x-generic.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Update Slots</string>
+   </property>
+   <property name="statusTip" >
+    <string>Update Slots</string>
+   </property>
+  </action>
+  <action name="actionUpdateSlotsScan" >
+   <property name="icon" >
+    <iconset resource="../main.qrc" >:/images/package-x-generic.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Update Slots Scan</string>
+   </property>
+   <property name="statusTip" >
+    <string>Update Slots Scan</string>
+   </property>
   </action>
  </widget>
  <resources>