]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/medialist/medialist.cpp
Fix bat browser for Win32
[bacula/bacula] / bacula / src / qt-console / medialist / medialist.cpp
index 29ae0288f34010b63e01755f0987e9a71e7fa73a..ee8a9d3321c50c2ba091354431282a82b1934671 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2007 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.
@@ -27,7 +27,7 @@
 */
  
 /*
- *   Version $Id: medialist.cpp 4230 2007-02-21 20:07:37Z kerns $
+ *   Version $Id$
  *
  *  MediaList Class
  *
@@ -50,7 +50,7 @@ MediaList::MediaList()
    m_name = "Media";
    pgInitialize();
    QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
-   thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/cartridge.svg")));
+   thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/cartridge.png")));
 
    /* mp_treeWidget, Storage Tree Tree Widget inherited from ui_medialist.h */
    m_populated = false;
@@ -114,8 +114,8 @@ void MediaList::populateTree()
          " Media.Enabled AS enabled, Pol.Name AS RecyclePool,"
          " Media.LastWritten AS LastWritten"
          " FROM Media"
-         " LEFT OUTER JOIN Pool ON (Media.PoolId=Pool.PoolId)"
-         " LEFT OUTER JOIN Pool AS Pol ON (Media.recyclepoolid=Pol.PoolId)"
+         " JOIN Pool ON (Media.PoolId=Pool.PoolId)"
+         " LEFT OUTER JOIN Pool AS Pol ON (Media.RecyclePoolId=Pol.PoolId)"
          " WHERE";
       query += " Pool.Name='" + pool_listItem + "'";
       query += " ORDER BY Media";
@@ -211,14 +211,6 @@ void MediaList::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetI
          foreach(QAction* mediaAction, mp_treeWidget->actions()) {
             mp_treeWidget->removeAction(mediaAction);
          }
-         /*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);
-         mp_treeWidget->removeAction(actionVolumeFromPool);*/
       }
 
       int treedepth = currentwidgetitem->data(0, Qt::UserRole).toInt();
@@ -259,6 +251,7 @@ void MediaList::createContextMenu()
    /* connect to the action specific to this pages class */
    connect(actionRefreshMediaList, SIGNAL(triggered()), this,
                 SLOT(populateTree()));
+   connect(actionAllVolumes, SIGNAL(triggered()), this, SLOT(allVolumes()));
    connect(actionAllVolumesFromPool, SIGNAL(triggered()), this, SLOT(allVolumesFromPool()));
    connect(actionVolumeFromPool, SIGNAL(triggered()), this, SLOT(volumeFromPool()));
 }
@@ -348,6 +341,13 @@ void MediaList::allVolumesFromPool()
    populateTree();
 }
 
+void MediaList::allVolumes()
+{
+   QString cmd = "update volume allfrompools";
+   consoleCommand(cmd);
+   populateTree();
+}
+
 /*
  * Called from the signal of the context sensitive menu to purge!
  */