]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/storage/storage.cpp
I could not get a few files to compile until I opened and saved these
[bacula/bacula] / bacula / src / qt-console / storage / storage.cpp
index b2f8ac64927ada06e513abdae444eb11d0cb734e..6e8ffedcb52ef82dee4942c57bc18dbad1de5782 100644 (file)
@@ -1,14 +1,14 @@
 /*
    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.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -58,6 +58,7 @@ Storage::Storage()
    /* add context sensitive menu items specific to this classto the page
     * selector tree. m_contextActions is QList of QActions */
    m_contextActions.append(actionRefreshStorage);
+   dockPage();
 }
 
 Storage::~Storage()
@@ -167,6 +168,7 @@ void Storage::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetIte
             mp_treeWidget->removeAction(actionUnMountStorage);
             mp_treeWidget->removeAction(actionUpdateSlots);
             mp_treeWidget->removeAction(actionUpdateSlotsScan);
+            mp_treeWidget->removeAction(actionRelease);
          }
       }
 
@@ -180,6 +182,7 @@ void Storage::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetIte
          mp_treeWidget->addAction(actionLabelStorage);
          mp_treeWidget->addAction(actionMountStorage);
          mp_treeWidget->addAction(actionUnMountStorage);
+         mp_treeWidget->addAction(actionRelease);
          QString text;
          text = "Status Storage \"" + m_currentStorage + "\"";
          actionStatusStorageInConsole->setText(text);
@@ -189,6 +192,8 @@ void Storage::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetIte
          actionMountStorage->setText(text);
          text = "\"UN\" Mount media in Storage \"" + m_currentStorage + "\"";
          actionUnMountStorage->setText(text);
+         text = "Release media in Storage \"" + m_currentStorage + "\"";
+         actionRelease->setText(text);
          if (m_currentAutoChanger != 0) {
             mp_treeWidget->addAction(actionUpdateSlots);
             mp_treeWidget->addAction(actionUpdateSlotsScan);
@@ -228,6 +233,8 @@ void Storage::createContextMenu()
                 SLOT(consoleUpdateSlots()));
    connect(actionUpdateSlotsScan, SIGNAL(triggered()), this,
                 SLOT(consoleUpdateSlotsScan()));
+   connect(actionRelease, SIGNAL(triggered()), this,
+                SLOT(consoleRelease()));
 }
 
 /*
@@ -298,3 +305,11 @@ void Storage::consoleUpdateSlotsScan()
    cmd += m_currentStorage;
    consoleCommand(cmd);
 }
+
+/* Release a tape in the drive */
+void Storage::consoleRelease()
+{
+   QString cmd("release storage=");
+   cmd += m_currentStorage;
+   consoleCommand(cmd);
+}