]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/mediaedit/mediaedit.cpp
Check for job_canceled() in fd_plugin code
[bacula/bacula] / bacula / src / qt-console / mediaedit / mediaedit.cpp
index 137b77e0a07d8052ebc823184a9f52f4ab09bb9f..447bb183bd803d513554cef724ef27c2ed2ffc1d 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2009 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.
@@ -20,7 +20,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Bacula® is a registered trademark of John Walker.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
  *   Dirk Bartley, March 2007
  */
  
+#include "bat.h"
 #include <QAbstractEventDispatcher>
 #include <QTableWidgetItem>
 #include <QMessageBox>
-#include "bat.h"
 #include "mediaedit.h"
-#include <inttypes.h>
 
 /*
  * A constructor 
@@ -44,8 +43,7 @@
 MediaEdit::MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId)
 {
    setupUi(this);
-   m_name = tr("Media Edit");
-   pgInitialize(parentWidget);
+   pgInitialize(tr("Media Edit"), parentWidget);
    QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
    thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/cartridge-edit.png")));
    m_closeable = true;
@@ -65,9 +63,6 @@ MediaEdit::MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId)
    m_status = "";
    m_slot = 0;
 
-   if (!m_console->preventInUseConnect())
-      return;
-
    /* The media's pool */
    poolCombo->addItems(m_console->pool_list);
 
@@ -184,9 +179,9 @@ MediaEdit::MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId)
       else enabledCheck->setCheckState(Qt::Unchecked);
       /* default for recycle pool */
       recyclePoolCombo->addItems(m_console->pool_list);
+      recyclePoolCombo->insertItem(0, "*None*");
       index = recyclePoolCombo->findText(m_recyclePool, Qt::MatchExactly);
       if (index == -1) {
-         recyclePoolCombo->insertItem(0, "");
          index = 0;
       }
       recyclePoolCombo->setCurrentIndex(index);
@@ -255,8 +250,12 @@ void MediaEdit::okButtonPushed()
       scmd += " enabled=yes";
       docmd = true;
    }
-   if (m_recyclePool != recyclePoolCombo->currentText() && recyclePoolCombo->currentText() != "") {
-      scmd += " recyclepool=\"" + recyclePoolCombo->currentText() + "\"";
+   if (m_recyclePool != recyclePoolCombo->currentText()) {
+      scmd += " recyclepool=\"";
+      if (recyclePoolCombo->currentText() != "*None*") {
+         scmd += recyclePoolCombo->currentText();
+      }
+      scmd += "\"";
       docmd = true;
    }
    if (docmd) {