]> git.sur5r.net Git - bacula/bacula/commitdiff
Add icon to label class in page selector.
authorDirk H Bartley <dbartley@schupan.com>
Tue, 29 May 2007 15:34:57 +0000 (15:34 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Tue, 29 May 2007 15:34:57 +0000 (15:34 +0000)
Turn media edit into a inheritor of the page class to put it on the stack.
Added status tips for buttons in main.ui via designer
Added truly fancy method of editing retention and use duration in media edit.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4930 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/COMMANDS
bacula/src/qt-console/PAGES
bacula/src/qt-console/label/label.cpp
bacula/src/qt-console/main.ui
bacula/src/qt-console/mediaedit/mediaedit.cpp
bacula/src/qt-console/mediaedit/mediaedit.h
bacula/src/qt-console/mediaedit/mediaedit.ui
bacula/src/qt-console/medialist/medialist.cpp

index f70f2e1408d45e12acc734894df4a49cb35c2740..43b86bb33aae0d2e6846c29af24c123b3975d645 100644 (file)
@@ -18,23 +18,12 @@ list
    list nextvol job=<job-name>
    list nextvol job=<job-name> days=nnn
 
-prune files|jobs|volume client=<client-name> volume=<volume-name>
-could add as a dialog box from both client and medialist
-
 release storage=<storage-name>
 Would need to explain what this does in bat with a dialog
 
-run
-done
-
 setdebug
 I'd say we could choose not to implement this in bat
 
-status
-done, want to implement graphically
-
-unmount storage=<storage-name> [ drive=\lt{}num\gt{} ]
-done
 unmount [ jobid=<id> | job=<job-name> ]
 Mmmmm
 
@@ -115,12 +104,19 @@ help
 label
 Done by kern before I started
 
+prune files|jobs|volume client=<client-name> volume=<volume-name>
+could add as a dialog box from both client and medialist
+
 purge files jobid=<jobid>|job=<job-name>|client=<client-name>
 purge volume|volume=<vol-name> (of all jobs)
 purge jobs client=<client-name> (of all jobs)
 
 relabel
-done
+
+run
 
 reload
-could be done in console or on director's page selector widget
+
+status
+
+unmount storage=<storage-name> [ drive=\lt{}num\gt{} ]
index 68f3f8d9945c15a175830bdc3a1aeb9d4c63c1af..ec019637827e73c79ea8c74e656e36a4b2447516 100644 (file)
@@ -38,7 +38,7 @@ setCurrent() for making the page and tree widget item of an object selected and
 in the front of the stack.
 
 Closing
-Use the function closeDockPage() to close from within the class.  Otherwise, if
+Use the function closeStackPage() to close from within the class.  Otherwise, if
 there are pointers which need to be deleted, use a destructor.  The m_closeable
 page member will determine whether the option to close will appear in context
 menu of page selector.
index 3f4384c7e75e404457ae927a69f729e6e98647fd..19b7272dbafb47af8dda7c3b0eda93f710bc38a4 100644 (file)
@@ -63,6 +63,8 @@ void labelPage::showPage(QString &defString)
    pgInitialize();
    setupUi(this);
    m_console->notify(false);
+   QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
+   thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/label.png")));
 
    storageCombo->addItems(m_console->storage_list);
    int index = storageCombo->findText(defString, Qt::MatchExactly);
index 098d74ac831f1fadc6b3b56ef935785ff746375b..9feaab51b526e3b78dddfd11889a7b440b4532cf 100644 (file)
     <addaction name="actionCut" />
     <addaction name="actionPaste" />
    </widget>
-   <widget class="QMenu" name="menuFile" >
-    <property name="title" >
-     <string>&amp;File</string>
-    </property>
-    <addaction name="actionPrint" />
-    <addaction name="actionSave" />
-    <addaction name="actionQuit" />
-   </widget>
    <widget class="QMenu" name="menuSettings" >
     <property name="title" >
      <string>Settings</string>
     <addaction name="actionBat_Help" />
     <addaction name="actionAbout_bat" />
    </widget>
+   <widget class="QMenu" name="menuFile" >
+    <property name="title" >
+     <string>&amp;File</string>
+    </property>
+    <addaction name="actionPrint" />
+    <addaction name="actionSave" />
+    <addaction name="actionQuit" />
+   </widget>
    <addaction name="menuFile" />
    <addaction name="menuEdit" />
    <addaction name="menuSettings" />
     <iconset resource="main.qrc" >:/images/status.png</iconset>
    </property>
    <property name="text" >
-    <string>StatusDir</string>
+    <string comment="Query status of director" >Status Dir</string>
+   </property>
+   <property name="iconText" >
+    <string>Status Dir</string>
    </property>
    <property name="toolTip" >
-    <string>status dir</string>
+    <string>Query status of director</string>
    </property>
    <property name="statusTip" >
-    <string>Status of Director</string>
+    <string>Query status of director</string>
+   </property>
+   <property name="autoRepeat" >
+    <bool>true</bool>
    </property>
   </action>
   <action name="actionSelectFont" >
    <property name="text" >
     <string>Undock Window</string>
    </property>
+   <property name="statusTip" >
+    <string>Undock Current Window</string>
+   </property>
   </action>
   <action name="actionToggleDock" >
    <property name="icon" >
    <property name="text" >
     <string>ToggleDock</string>
    </property>
+   <property name="toolTip" >
+    <string>Toggle Dock Status</string>
+   </property>
+   <property name="statusTip" >
+    <string>Toggle Dock Status</string>
+   </property>
   </action>
   <action name="actionClosePage" >
    <property name="icon" >
    <property name="statusTip" >
     <string>Display any messages queued at the director</string>
    </property>
+   <property name="autoRepeat" >
+    <bool>false</bool>
+   </property>
   </action>
   <action name="actionPreferences" >
    <property name="text" >
index d846463f5a083f005657dfa85c6390b3ab6191b0..e1afbed81403b617550f7c01fefeef860a106b84 100644 (file)
 #include <QMessageBox>
 #include "bat.h"
 #include "mediaedit.h"
+#include <inttypes.h>
 
 /*
  * A constructor 
  */
-MediaEdit::MediaEdit(Console *console, QString &mediaId)
+MediaEdit::MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId)
 {
-   m_console = console;
-   m_console->notify(false);
+   setupUi(this);
+   m_name = "Media Edit";
+   pgInitialize(parentWidget);
+   QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
+   thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/cartridge-edit.svg")));
+   m_closeable = true;
+   dockPage();
+   setCurrent();
+
+   connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
+   connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
+   connectSpins();
+   connect(retentionSpin, SIGNAL(valueChanged(int)), this, SLOT(retentionChanged()));
+   connect(useDurationSpin, SIGNAL(valueChanged(int)), this, SLOT(useDurationChanged()));
+   connect(retentionRadio, SIGNAL(pressed()), this, SLOT(retentionRadioPressed()));
+   connect(useDurationRadio, SIGNAL(pressed()), this, SLOT(useDurationRadioPressed()));
+
    m_pool = "";
    m_status = "";
    m_slot = 0;
 
-   setupUi(this);
-
    if (!m_console->preventInUseConnect())
-       return;
+      return;
 
    /* The media's pool */
-   poolCombo->addItems(console->pool_list);
+   poolCombo->addItems(m_console->pool_list);
 
    /* The media's Status */
    QStringList statusList = (QStringList() << "Full" << "Used" << "Append" << "Error" << "Purged" << "Recycled");
@@ -62,9 +76,11 @@ MediaEdit::MediaEdit(Console *console, QString &mediaId)
 
    /* Set up the query for the default values */
    QStringList FieldList = (QStringList()
-      << "Media.VolumeName" << "Pool.Name" << "Media.VolStatus" << "Media.Slot" );
+      << "Media.VolumeName" << "Pool.Name" << "Media.VolStatus" << "Media.Slot"
+      << "Media.VolRetention" << "Media.VolUseDuration");
    QStringList AsList = (QStringList()
-      << "VolumeName" << "PoolName" << "Status" << "Slot" );
+      << "VolumeName" << "PoolName" << "Status" << "Slot"
+      << "Retention" << "UseDuration");
    int i = 0;
    QString query("SELECT ");
    foreach (QString field, FieldList) {
@@ -94,6 +110,7 @@ MediaEdit::MediaEdit(Console *console, QString &mediaId)
          /* Iterate through fields in the record */
          foreach (field, fieldlist) {
             field = field.trimmed();  /* strip leading & trailing spaces */
+            bool ok;
             if (i == 0) {
                m_mediaName = field;
                volumeLabel->setText(QString("Volume : %1").arg(m_mediaName));
@@ -102,9 +119,14 @@ MediaEdit::MediaEdit(Console *console, QString &mediaId)
             } else if (i == 2) {
                m_status = field;
             } else if (i == 3) {
-               bool ok;
                m_slot = field.toInt(&ok, 10);
                if (!ok){ m_slot = 0; }
+            } else if (i == 4) {
+               m_retention = field.toLong(&ok, 10);
+               if (!ok){ m_retention = 0; }
+            } else if (i == 5) {
+               m_useDuration = field.toLong(&ok, 10);
+               if (!ok){ m_useDuration = 0; }
             }
             i++;
          } /* foreach field */
@@ -125,6 +147,8 @@ MediaEdit::MediaEdit(Console *console, QString &mediaId)
          statusCombo->setCurrentIndex(index);
       }
       slotSpin->setValue(m_slot);
+      retentionSpin->setValue(m_retention);
+      useDurationSpin->setValue(m_useDuration);
 
       this->show();
    } else {
@@ -132,14 +156,16 @@ MediaEdit::MediaEdit(Console *console, QString &mediaId)
                            QMessageBox::Ok, QMessageBox::Ok);
       return;
    }
-
 }
 
 /*
- * Function to handle updating the record
+ * Function to handle updating the record then closing the page
  */
-void MediaEdit::accept()
+void MediaEdit::okButtonPushed()
 {
+//update volume=xxx slots MaxVolJobs=nnn MaxVolBytes=nnn Recycle=yes|no
+//         enabled=n recyclepool=zzz
+// done pool=yyy volstatus=xxx slot=nnn VolUse=ddd VolRetention=ddd
    QString scmd;
    this->hide();
    bool docmd = false;
@@ -157,22 +183,162 @@ void MediaEdit::accept()
        scmd += " slot=" + QString().setNum(slotSpin->value());
        docmd = true;
    }
+   if (m_retention != retentionSpin->value()) {
+       scmd += " VolRetention=" + QString().setNum(retentionSpin->value());
+       docmd = true;
+   }
+   if (m_useDuration != useDurationSpin->value()) {
+       scmd += " VolUse=" + QString().setNum(useDurationSpin->value());
+       docmd = true;
+   }
    if (docmd) {
       if (mainWin->m_commandDebug) {
          Pmsg1(000, "sending command : %s\n",scmd.toUtf8().data());
       }
-      m_console->write_dir(scmd.toUtf8().data());
-      m_console->displayToPrompt();
-      m_console->notify(true);
-    }
-   delete this;
-   mainWin->resetFocus();
+      consoleCommand(scmd);
+   }
+   closeStackPage();
 }
 
-void MediaEdit::reject()
+/* close if cancel */
+void MediaEdit::cancelButtonPushed()
 {
-   this->hide();
-   m_console->notify(true);
-   delete this;
-   mainWin->resetFocus();
+   closeStackPage();
+}
+
+/*
+ * Slot for user changed retention
+ */
+void MediaEdit::retentionChanged()
+{
+   retentionRadio->setChecked(true);
+   setSpins(retentionSpin->value());
+}
+
+/*
+ * Slot for user changed the use duration
+ */
+void MediaEdit::useDurationChanged()
+{
+   useDurationRadio->setChecked(true);
+   setSpins(useDurationSpin->value());
+}
+
+/*
+ * Set the 5 duration spins from a known duration value
+ */
+void MediaEdit::setSpins(int value)
+{
+   int years, days, hours, minutes, seconds, left;
+       
+   years = abs(value / 31536000);
+   left = value - years * 31536000;
+   days = abs(left / 86400);
+   left = left - days * 86400;
+   hours = abs(left / 3600);
+   left = left - hours * 3600;
+   minutes = abs(left / 60);
+   seconds = left - minutes * 60;
+   disconnectSpins();
+   yearsSpin->setValue(years);
+   daysSpin->setValue(days);
+   hoursSpin->setValue(hours);
+   minutesSpin->setValue(minutes);
+   secondsSpin->setValue(seconds);
+   connectSpins();
+}
+
+/*
+ * This slot is called any time any one of the 5 duration spins a changed.
+ */
+void MediaEdit::durationChanged()
+{
+   disconnectSpins();
+   if (secondsSpin->value() == -1) {
+      secondsSpin->setValue(59);
+      minutesSpin->setValue(minutesSpin->value()-1);
+   }
+   if (minutesSpin->value() == -1) {
+      minutesSpin->setValue(59);
+      hoursSpin->setValue(hoursSpin->value()-1);
+   }
+   if (hoursSpin->value() == -1) {
+      hoursSpin->setValue(23);
+      daysSpin->setValue(daysSpin->value()-1);
+   }
+   if (daysSpin->value() == -1) {
+      daysSpin->setValue(364);
+      yearsSpin->setValue(yearsSpin->value()-1);
+   }
+   if (yearsSpin->value() == -1) {
+      yearsSpin->setValue(0);
+   }
+
+   if (secondsSpin->value() == 60) {
+      secondsSpin->setValue(0);
+      minutesSpin->setValue(minutesSpin->value()+1);
+   }
+   if (minutesSpin->value() == 60) {
+      minutesSpin->setValue(0);
+      hoursSpin->setValue(hoursSpin->value()+1);
+   }
+   if (hoursSpin->value() == 24) {
+      hoursSpin->setValue(0);
+      daysSpin->setValue(daysSpin->value()+1);
+   }
+   if (daysSpin->value() == 365) {
+      daysSpin->setValue(0);
+      yearsSpin->setValue(yearsSpin->value()+1);
+   }
+   connectSpins();
+   if (retentionRadio->isChecked()) {
+      int retention;
+      retention = secondsSpin->value() + minutesSpin->value() * 60 + 
+         hoursSpin->value() * 3600 + daysSpin->value() * 86400 +
+         yearsSpin->value() * 31536000;
+      disconnect(retentionSpin, SIGNAL(valueChanged(int)), this, SLOT(retentionChanged()));
+      retentionSpin->setValue(retention);
+      connect(retentionSpin, SIGNAL(valueChanged(int)), this, SLOT(retentionChanged()));
+   }
+   if (useDurationRadio->isChecked()) {
+      int useDuration;
+      useDuration = secondsSpin->value() + minutesSpin->value() * 60 + 
+         hoursSpin->value() * 3600 + daysSpin->value() * 86400 +
+         yearsSpin->value() * 31536000;
+      disconnect(useDurationSpin, SIGNAL(valueChanged(int)), this, SLOT(useDurationChanged()));
+      useDurationSpin->setValue(useDuration);
+      connect(useDurationSpin, SIGNAL(valueChanged(int)), this, SLOT(useDurationChanged()));
+   }
+}
+
+/* Connect the spins */
+void MediaEdit::connectSpins()
+{
+   connect(secondsSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
+   connect(minutesSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
+   connect(hoursSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
+   connect(daysSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
+   connect(yearsSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
+}
+
+/* disconnect spins so that we can set the value of other spin from changed duration spin */
+void MediaEdit::disconnectSpins()
+{
+   disconnect(secondsSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
+   disconnect(minutesSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
+   disconnect(hoursSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
+   disconnect(daysSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
+   disconnect(yearsSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
+}
+
+/* slot for setting spins when retention radio checked */
+void MediaEdit::retentionRadioPressed()
+{
+   setSpins(retentionSpin->value());
+}
+
+/* slot for setting spins when duration radio checked */
+void MediaEdit::useDurationRadioPressed()
+{
+   setSpins(useDurationSpin->value());
 }
index eb11ebfadba74751a9ec38618535379018c93f06..74fc207f2a6517a1bcbaac5a69d3862b57863522 100644 (file)
 #include <QtGui>
 #include "ui_mediaedit.h"
 #include "console.h"
+#include "pages.h"
 
-class MediaEdit : public QDialog, public Ui::mediaeditForm
+class MediaEdit : public Pages, public Ui::mediaEditForm
 {
    Q_OBJECT 
 
 public:
-   MediaEdit(Console *console, QString &mediaId);
+   MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId);
 
-public slots:
-   void accept();
-   void reject();
+private slots:
+   void okButtonPushed();
+   void cancelButtonPushed();
+   void retentionChanged();
+   void durationChanged();
+   void useDurationChanged();
+   void setSpins(int value);
+   void retentionRadioPressed();
+   void useDurationRadioPressed();
 
 private:
-   Console *m_console;
+   void connectSpins();
+   void disconnectSpins();
    QString m_mediaName;
    QString m_pool;
    QString m_status;
    int m_slot;
+   int m_retention;
+   int m_useDuration;
 };
 
 #endif /* _MEDIAEDIT_H_ */
index f9b6e593317a696465da1eeaed4fcc85d7383a46..ae8973f936b4040ee6a25833ab0c0828e03ad49d 100644 (file)
@@ -1,19 +1,16 @@
 <ui version="4.0" >
- <class>mediaeditForm</class>
- <widget class="QDialog" name="mediaeditForm" >
-  <property name="windowModality" >
-   <enum>Qt::WindowModal</enum>
-  </property>
+ <class>mediaEditForm</class>
+ <widget class="QWidget" name="mediaEditForm" >
   <property name="geometry" >
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>416</width>
-    <height>230</height>
+    <width>515</width>
+    <height>334</height>
    </rect>
   </property>
   <property name="windowTitle" >
-   <string>Label</string>
+   <string>Form</string>
   </property>
   <layout class="QGridLayout" >
    <property name="margin" >
    <property name="spacing" >
     <number>6</number>
    </property>
-   <item row="1" column="0" >
-    <layout class="QHBoxLayout" >
+   <item row="1" column="1" >
+    <layout class="QGridLayout" >
      <property name="margin" >
       <number>0</number>
      </property>
      <property name="spacing" >
       <number>6</number>
      </property>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
+     <item row="6" column="1" >
+      <widget class="QLabel" name="label_10" >
+       <property name="text" >
+        <string>Minutes</string>
        </property>
-       <property name="sizeHint" >
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
+      </widget>
+     </item>
+     <item row="5" column="2" >
+      <widget class="QSpinBox" name="hoursSpin" >
+       <property name="maximum" >
+        <number>24</number>
        </property>
-      </spacer>
+       <property name="minimum" >
+        <number>-1</number>
+       </property>
+       <property name="value" >
+        <number>0</number>
+       </property>
+      </widget>
      </item>
-     <item>
-      <widget class="QLabel" name="volumeLabel" >
-       <property name="maximumSize" >
-        <size>
-         <width>16777215</width>
-         <height>48</height>
-        </size>
+     <item row="4" column="2" >
+      <widget class="QSpinBox" name="daysSpin" >
+       <property name="maximum" >
+        <number>365</number>
        </property>
-       <property name="text" >
-        <string>Volume : </string>
+       <property name="minimum" >
+        <number>-1</number>
        </property>
       </widget>
      </item>
-     <item>
+     <item rowspan="8" row="0" column="0" >
+      <layout class="QGridLayout" >
+       <property name="margin" >
+        <number>0</number>
+       </property>
+       <property name="spacing" >
+        <number>6</number>
+       </property>
+       <item row="3" column="1" >
+        <widget class="QComboBox" name="statusCombo" />
+       </item>
+       <item row="1" column="0" colspan="2" >
+        <layout class="QHBoxLayout" >
+         <property name="margin" >
+          <number>0</number>
+         </property>
+         <property name="spacing" >
+          <number>6</number>
+         </property>
+         <item>
+          <spacer>
+           <property name="orientation" >
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" >
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QLabel" name="volumeLabel" >
+           <property name="maximumSize" >
+            <size>
+             <width>16777215</width>
+             <height>48</height>
+            </size>
+           </property>
+           <property name="text" >
+            <string>Volume : </string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation" >
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" >
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item row="0" column="0" colspan="2" >
+        <layout class="QHBoxLayout" >
+         <property name="margin" >
+          <number>0</number>
+         </property>
+         <property name="spacing" >
+          <number>6</number>
+         </property>
+         <item>
+          <spacer>
+           <property name="orientation" >
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" >
+            <size>
+             <width>71</width>
+             <height>21</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QLabel" name="label" >
+           <property name="maximumSize" >
+            <size>
+             <width>16777215</width>
+             <height>30</height>
+            </size>
+           </property>
+           <property name="text" >
+            <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+p, li { white-space: pre-wrap; }
+&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:12pt; font-weight:600;">Edit a Volume&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer>
+           <property name="orientation" >
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" >
+            <size>
+             <width>81</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item row="4" column="0" >
+        <widget class="QLabel" name="label_4" >
+         <property name="text" >
+          <string>Slot:</string>
+         </property>
+         <property name="buddy" >
+          <cstring>slotSpin</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="6" column="0" >
+        <widget class="QLabel" name="label_7" >
+         <property name="text" >
+          <string>Use Duration:</string>
+         </property>
+         <property name="buddy" >
+          <cstring>slotSpin</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="0" >
+        <widget class="QLabel" name="label_6" >
+         <property name="text" >
+          <string>Retension:</string>
+         </property>
+         <property name="buddy" >
+          <cstring>slotSpin</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="1" >
+        <widget class="QSpinBox" name="retentionSpin" >
+         <property name="maximum" >
+          <number>2147483647</number>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0" >
+        <widget class="QLabel" name="label_5" >
+         <property name="text" >
+          <string>Volume Status:</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="1" >
+        <widget class="QSpinBox" name="slotSpin" >
+         <property name="maximum" >
+          <number>10000</number>
+         </property>
+        </widget>
+       </item>
+       <item row="7" column="0" colspan="2" >
+        <layout class="QHBoxLayout" >
+         <property name="margin" >
+          <number>0</number>
+         </property>
+         <property name="spacing" >
+          <number>6</number>
+         </property>
+         <item>
+          <spacer>
+           <property name="orientation" >
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" >
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="okButton" >
+           <property name="text" >
+            <string>OK</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="cancelButton" >
+           <property name="text" >
+            <string>Cancel</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item row="2" column="0" >
+        <widget class="QLabel" name="label_3" >
+         <property name="text" >
+          <string>Pool:</string>
+         </property>
+         <property name="buddy" >
+          <cstring>poolCombo</cstring>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1" >
+        <widget class="QComboBox" name="poolCombo" />
+       </item>
+       <item row="6" column="1" >
+        <widget class="QSpinBox" name="useDurationSpin" >
+         <property name="maximum" >
+          <number>2147483647</number>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item row="0" column="1" colspan="2" >
       <spacer>
        <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
+        <enum>Qt::Vertical</enum>
        </property>
        <property name="sizeHint" >
         <size>
-         <width>40</width>
-         <height>20</height>
+         <width>97</width>
+         <height>16</height>
         </size>
        </property>
       </spacer>
      </item>
-    </layout>
-   </item>
-   <item row="3" column="0" >
-    <layout class="QGridLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item row="1" column="0" >
-      <widget class="QLabel" name="label_5" >
+     <item row="3" column="1" >
+      <widget class="QLabel" name="label_2" >
        <property name="text" >
-        <string>Volume Status:</string>
+        <string>Years</string>
        </property>
       </widget>
      </item>
-     <item row="1" column="1" >
-      <widget class="QComboBox" name="statusCombo" />
+     <item row="5" column="1" >
+      <widget class="QLabel" name="label_9" >
+       <property name="text" >
+        <string>Hours</string>
+       </property>
+      </widget>
      </item>
-     <item row="0" column="1" >
-      <widget class="QComboBox" name="poolCombo" />
+     <item row="2" column="1" colspan="2" >
+      <widget class="QRadioButton" name="useDurationRadio" >
+       <property name="text" >
+        <string>Use Duration</string>
+       </property>
+      </widget>
      </item>
-     <item row="2" column="1" >
-      <widget class="QSpinBox" name="slotSpin" >
+     <item row="3" column="2" >
+      <widget class="QSpinBox" name="yearsSpin" >
        <property name="maximum" >
-        <number>10000</number>
+        <number>999</number>
+       </property>
+       <property name="minimum" >
+        <number>-1</number>
        </property>
       </widget>
      </item>
-     <item row="0" column="0" >
-      <widget class="QLabel" name="label_3" >
+     <item row="4" column="1" >
+      <widget class="QLabel" name="label_8" >
        <property name="text" >
-        <string>Pool:</string>
-       </property>
-       <property name="buddy" >
-        <cstring>poolCombo</cstring>
+        <string>Days</string>
        </property>
       </widget>
      </item>
-     <item row="2" column="0" >
-      <widget class="QLabel" name="label_4" >
+     <item row="7" column="1" >
+      <widget class="QLabel" name="label_11" >
        <property name="text" >
-        <string>Slot:</string>
-       </property>
-       <property name="buddy" >
-        <cstring>slotSpin</cstring>
+        <string>Seconds</string>
        </property>
       </widget>
      </item>
-    </layout>
-   </item>
-   <item row="0" column="0" >
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>71</width>
-         <height>21</height>
-        </size>
+     <item row="1" column="1" colspan="2" >
+      <widget class="QRadioButton" name="retentionRadio" >
+       <property name="text" >
+        <string>Retention</string>
        </property>
-      </spacer>
+      </widget>
      </item>
-     <item>
-      <widget class="QLabel" name="label" >
-       <property name="maximumSize" >
-        <size>
-         <width>16777215</width>
-         <height>30</height>
-        </size>
+     <item row="7" column="2" >
+      <widget class="QSpinBox" name="secondsSpin" >
+       <property name="maximum" >
+        <number>60</number>
        </property>
-       <property name="text" >
-        <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
-p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:12pt; font-weight:600;">Edit a Volume&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
+       <property name="minimum" >
+        <number>-1</number>
        </property>
       </widget>
      </item>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
+     <item row="6" column="2" >
+      <widget class="QSpinBox" name="minutesSpin" >
+       <property name="maximum" >
+        <number>60</number>
        </property>
-       <property name="sizeHint" >
-        <size>
-         <width>81</width>
-         <height>20</height>
-        </size>
+       <property name="minimum" >
+        <number>-1</number>
        </property>
-      </spacer>
+      </widget>
      </item>
     </layout>
    </item>
-   <item row="4" column="0" >
+   <item row="0" column="1" >
     <spacer>
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
      </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Maximum</enum>
+     <property name="sizeHint" >
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="2" column="1" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" >
       <size>
-       <width>21</width>
-       <height>16</height>
+       <width>20</width>
+       <height>40</height>
       </size>
      </property>
     </spacer>
    </item>
-   <item row="5" column="0" >
-    <widget class="QDialogButtonBox" name="buttonBox" >
+   <item row="1" column="0" >
+    <spacer>
      <property name="orientation" >
       <enum>Qt::Horizontal</enum>
      </property>
-     <property name="standardButtons" >
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+     <property name="sizeHint" >
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
      </property>
-    </widget>
+    </spacer>
    </item>
-   <item row="2" column="0" >
+   <item row="1" column="2" >
     <spacer>
      <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Maximum</enum>
+      <enum>Qt::Horizontal</enum>
      </property>
      <property name="sizeHint" >
       <size>
-       <width>398</width>
-       <height>16</height>
+       <width>40</width>
+       <height>20</height>
       </size>
      </property>
     </spacer>
@@ -218,38 +421,5 @@ p, li { white-space: pre-wrap; }
   </layout>
  </widget>
  <resources/>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>mediaeditForm</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>248</x>
-     <y>254</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>157</x>
-     <y>274</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>mediaeditForm</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>316</x>
-     <y>260</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>286</x>
-     <y>274</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
+ <connections/>
 </ui>
index 6cad0dbb57dfcabdcb2aa2394dfc20847baa2557..41bb9447076d28398a1188473c27fb5db74e801a 100644 (file)
@@ -164,7 +164,7 @@ void MediaList::setStatusColor(QTreeWidgetItem *item, QString &field, int &index
  */
 void MediaList::editVolume()
 {
-   MediaEdit* edit = new MediaEdit(m_console, m_currentVolumeId);
+   MediaEdit* edit = new MediaEdit(mainWin->getFromHash(this), m_currentVolumeId);
    connect(edit, SIGNAL(destroyed()), this, SLOT(populateTree()));
 }