]> git.sur5r.net Git - bacula/bacula/commitdiff
Add the remainder of the editible fields to mediaedit. Also add those
authorDirk H Bartley <dbartley@schupan.com>
Tue, 29 May 2007 21:09:07 +0000 (21:09 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Tue, 29 May 2007 21:09:07 +0000 (21:09 +0000)
fields to medialist.  Querying for recycle pool took another sql trick.  I'll test
with mysql on return from vacation.  Trick is alias of table.

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

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 e1afbed81403b617550f7c01fefeef860a106b84..2cb9b3d2f00ead0ef110979e121aed2d1f01cbf0 100644 (file)
@@ -61,6 +61,7 @@ MediaEdit::MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId)
    connect(useDurationRadio, SIGNAL(pressed()), this, SLOT(useDurationRadioPressed()));
 
    m_pool = "";
+   m_recyclePool = "";
    m_status = "";
    m_slot = 0;
 
@@ -77,10 +78,14 @@ MediaEdit::MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId)
    /* Set up the query for the default values */
    QStringList FieldList = (QStringList()
       << "Media.VolumeName" << "Pool.Name" << "Media.VolStatus" << "Media.Slot"
-      << "Media.VolRetention" << "Media.VolUseDuration");
+      << "Media.VolRetention" << "Media.VolUseDuration" << "Media.MaxVolJobs"
+      << "Media.MaxVolFiles" << "Media.MaxVolBytes" << "Media.Recycle" << "Media.Enabled"
+      << "Pol.Name");
    QStringList AsList = (QStringList()
       << "VolumeName" << "PoolName" << "Status" << "Slot"
-      << "Retention" << "UseDuration");
+      << "Retention" << "UseDuration" << "MaxJobs"
+      << "MaxFiles" << "MaxBytes" << "Recycle" << "Enabled"
+      << "RecyclePool");
    int i = 0;
    QString query("SELECT ");
    foreach (QString field, FieldList) {
@@ -90,9 +95,11 @@ MediaEdit::MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId)
       query += field + " AS " + AsList[i];
       i += 1;
    }
-   query += " FROM Media, Pool WHERE Media.PoolId=Pool.PoolId";
-   query += " AND Media.MediaId='" + mediaId + "'";
-   query += " ORDER BY Pool.Name";
+   query += " FROM Media"
+            " LEFT OUTER JOIN Pool ON (Media.PoolId=Pool.PoolId)"
+            " LEFT OUTER JOIN Pool AS pol ON (Media.recyclepoolid=Pol.PoolId)"
+            " WHERE Media.MediaId='" + mediaId + "'"
+            " ORDER BY Pool.Name";
 
    if (mainWin->m_sqlDebug) {
       Pmsg1(000, "MediaList query cmd : %s\n",query.toUtf8().data());
@@ -122,11 +129,28 @@ MediaEdit::MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId)
                m_slot = field.toInt(&ok, 10);
                if (!ok){ m_slot = 0; }
             } else if (i == 4) {
-               m_retention = field.toLong(&ok, 10);
+               m_retention = field.toInt(&ok, 10);
                if (!ok){ m_retention = 0; }
             } else if (i == 5) {
-               m_useDuration = field.toLong(&ok, 10);
+               m_useDuration = field.toInt(&ok, 10);
                if (!ok){ m_useDuration = 0; }
+            } else if (i == 6) {
+               m_maxVolJobs = field.toInt(&ok, 10);
+               if (!ok){ m_maxVolJobs = 0; }
+            } else if (i == 7) {
+               m_maxVolFiles = field.toInt(&ok, 10);
+               if (!ok){ m_maxVolFiles = 0; }
+            } else if (i == 8) {
+               m_maxVolBytes = field.toInt(&ok, 10);
+               if (!ok){ m_maxVolBytes = 0; }
+            } else if (i == 9) {
+               if (field == "1") m_recycle = true;
+               else m_recycle = false;
+            } else if (i == 10) {
+               if (field == "1") m_enabled = true;
+               else m_enabled = false;
+            } else if (i == 11) {
+               m_recyclePool = field;
             }
             i++;
          } /* foreach field */
@@ -149,8 +173,25 @@ MediaEdit::MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId)
       slotSpin->setValue(m_slot);
       retentionSpin->setValue(m_retention);
       useDurationSpin->setValue(m_useDuration);
-
-      this->show();
+      setSpins(retentionSpin->value());
+      retentionRadio->setChecked(true);
+      maxJobsSpin->setValue(m_maxVolJobs);
+      maxFilesSpin->setValue(m_maxVolFiles);
+      maxBytesSpin->setValue(m_maxVolBytes);
+      if (m_recycle) recycleCheck->setCheckState(Qt::Checked);
+      else recycleCheck->setCheckState(Qt::Unchecked);
+      if (m_enabled) enabledCheck->setCheckState(Qt::Checked);
+      else enabledCheck->setCheckState(Qt::Unchecked);
+      /* default for recycle pool */
+      recyclePoolCombo->addItems(m_console->pool_list);
+      index = recyclePoolCombo->findText(m_recyclePool, Qt::MatchExactly);
+      if (index == -1) {
+         recyclePoolCombo->insertItem(0, "");
+         index = recyclePoolCombo->findText(m_recyclePool, Qt::MatchExactly);
+      }
+      if (index != -1) {
+         recyclePoolCombo->setCurrentIndex(index);
+      }
    } else {
       QMessageBox::warning(this, "No Volume name", "No Volume name given",
                            QMessageBox::Ok, QMessageBox::Ok);
@@ -163,33 +204,62 @@ MediaEdit::MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId)
  */
 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;
    scmd = QString("update volume=\"%1\"")
                   .arg(m_mediaName);
    if (m_pool != poolCombo->currentText()) {
-       scmd += " pool=\"" + poolCombo->currentText() + "\"";
-       docmd = true;
+      scmd += " pool=\"" + poolCombo->currentText() + "\"";
+      docmd = true;
    }
    if (m_status != statusCombo->currentText()) {
-       scmd += " volstatus=\"" + statusCombo->currentText() + "\"";
-       docmd = true;
+      scmd += " volstatus=\"" + statusCombo->currentText() + "\"";
+      docmd = true;
    }
    if (m_slot != slotSpin->value()) {
-       scmd += " slot=" + QString().setNum(slotSpin->value());
-       docmd = true;
+      scmd += " slot=" + QString().setNum(slotSpin->value());
+      docmd = true;
    }
    if (m_retention != retentionSpin->value()) {
-       scmd += " VolRetention=" + QString().setNum(retentionSpin->value());
-       docmd = true;
+      scmd += " VolRetention=" + QString().setNum(retentionSpin->value());
+      docmd = true;
    }
    if (m_useDuration != useDurationSpin->value()) {
-       scmd += " VolUse=" + QString().setNum(useDurationSpin->value());
-       docmd = true;
+      scmd += " VolUse=" + QString().setNum(useDurationSpin->value());
+      docmd = true;
+   }
+   if (m_maxVolJobs != maxJobsSpin->value()) {
+      scmd += " MaxVolJobs=" + QString().setNum(maxJobsSpin->value());
+      docmd = true;
+   }
+   if (m_maxVolFiles != maxFilesSpin->value()) {
+      scmd += " MaxVolFiles=" + QString().setNum(maxFilesSpin->value());
+      docmd = true;
+   }
+   if (m_maxVolBytes != maxBytesSpin->value()) {
+      scmd += " MaxVolBytes=" + QString().setNum(maxBytesSpin->value());
+      docmd = true;
+   }
+   if ((m_recycle) && (recycleCheck->checkState() == Qt::Unchecked)) {
+      scmd += " Recycle=no";
+      docmd = true;
+   }
+   if ((!m_recycle) && (recycleCheck->checkState() == Qt::Checked)) {
+      scmd += " Recycle=yes";
+      docmd = true;
+   }
+   if ((m_enabled) && (enabledCheck->checkState() == Qt::Unchecked)) {
+      scmd += " enabled=no";
+      docmd = true;
+   }
+   if ((!m_enabled) && (enabledCheck->checkState() == Qt::Checked)) {
+      scmd += " enabled=yes";
+      docmd = true;
+   }
+   if (m_recyclePool != recyclePoolCombo->currentText()) {
+      scmd += " recyclepool=\"" + recyclePoolCombo->currentText() + "\"";
+      docmd = true;
    }
    if (docmd) {
       if (mainWin->m_commandDebug) {
index 74fc207f2a6517a1bcbaac5a69d3862b57863522..63ae800e3ea75ef593360b023150ac0e1211be3d 100644 (file)
@@ -64,6 +64,12 @@ private:
    int m_slot;
    int m_retention;
    int m_useDuration;
+   int m_maxVolJobs;
+   int m_maxVolFiles;
+   int m_maxVolBytes;
+   bool m_recycle;
+   bool m_enabled;
+   QString m_recyclePool;
 };
 
 #endif /* _MEDIAEDIT_H_ */
index ae8973f936b4040ee6a25833ab0c0828e03ad49d..269ae9ee283a73dbb2ced747b48f1c73ca25b6e7 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>515</width>
-    <height>334</height>
+    <width>468</width>
+    <height>451</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <property name="spacing" >
     <number>6</number>
    </property>
+   <item row="1" column="2" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="0" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
    <item row="1" column="1" >
     <layout class="QGridLayout" >
      <property name="margin" >
      <property name="spacing" >
       <number>6</number>
      </property>
-     <item row="6" column="1" >
-      <widget class="QLabel" name="label_10" >
-       <property name="text" >
-        <string>Minutes</string>
+     <item row="8" column="1" >
+      <widget class="QSpinBox" name="maxBytesSpin" >
+       <property name="maximum" >
+        <number>2147483647</number>
        </property>
       </widget>
      </item>
-     <item row="5" column="2" >
-      <widget class="QSpinBox" name="hoursSpin" >
-       <property name="maximum" >
-        <number>24</number>
+     <item row="1" column="0" colspan="2" >
+      <layout class="QHBoxLayout" >
+       <property name="margin" >
+        <number>0</number>
        </property>
-       <property name="minimum" >
-        <number>-1</number>
+       <property name="spacing" >
+        <number>6</number>
        </property>
-       <property name="value" >
-        <number>0</number>
+       <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="4" column="1" >
+      <widget class="QSpinBox" name="slotSpin" >
+       <property name="maximum" >
+        <number>10000</number>
        </property>
       </widget>
      </item>
-     <item row="4" column="2" >
-      <widget class="QSpinBox" name="daysSpin" >
-       <property name="maximum" >
-        <number>365</number>
+     <item row="3" column="1" >
+      <widget class="QComboBox" name="statusCombo" />
+     </item>
+     <item row="9" column="0" >
+      <widget class="QLabel" name="label_14" >
+       <property name="text" >
+        <string>Max Volume Files:</string>
        </property>
-       <property name="minimum" >
-        <number>-1</number>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
        </property>
       </widget>
      </item>
-     <item rowspan="8" row="0" column="0" >
-      <layout class="QGridLayout" >
+     <item row="13" column="0" colspan="3" >
+      <layout class="QHBoxLayout" >
        <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>
+        <spacer>
+         <property name="orientation" >
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" >
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
        </item>
-       <item row="1" column="0" colspan="2" >
-        <layout class="QHBoxLayout" >
-         <property name="margin" >
-          <number>0</number>
+       <item>
+        <widget class="QPushButton" name="okButton" >
+         <property name="text" >
+          <string>OK</string>
          </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>
+        </widget>
        </item>
-       <item row="0" column="0" colspan="2" >
-        <layout class="QHBoxLayout" >
-         <property name="margin" >
-          <number>0</number>
+       <item>
+        <widget class="QPushButton" name="cancelButton" >
+         <property name="text" >
+          <string>Cancel</string>
+         </property>
+        </widget>
+       </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="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">
+         <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>
+         </property>
+        </widget>
        </item>
-       <item row="4" column="0" >
-        <widget class="QLabel" name="label_4" >
-         <property name="text" >
-          <string>Slot:</string>
+       <item>
+        <spacer>
+         <property name="orientation" >
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" >
+          <size>
+           <width>81</width>
+           <height>20</height>
+          </size>
          </property>
-         <property name="buddy" >
-          <cstring>slotSpin</cstring>
+        </spacer>
+       </item>
+      </layout>
+     </item>
+     <item row="3" column="0" >
+      <widget class="QLabel" name="label_5" >
+       <property name="text" >
+        <string>Volume Status:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="12" column="0" colspan="2" >
+      <layout class="QHBoxLayout" >
+       <property name="margin" >
+        <number>0</number>
+       </property>
+       <property name="spacing" >
+        <number>6</number>
+       </property>
+       <item>
+        <widget class="QCheckBox" name="enabledCheck" >
+         <property name="layoutDirection" >
+          <enum>Qt::RightToLeft</enum>
+         </property>
+         <property name="text" >
+          <string>Enabled</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 rowspan="13" row="0" column="2" >
+      <layout class="QGridLayout" >
+       <property name="margin" >
+        <number>0</number>
+       </property>
+       <property name="spacing" >
+        <number>6</number>
+       </property>
        <item row="6" column="0" >
-        <widget class="QLabel" name="label_7" >
+        <widget class="QLabel" name="label_10" >
          <property name="text" >
-          <string>Use Duration:</string>
+          <string>Minutes</string>
+         </property>
+        </widget>
+       </item>
+       <item row="5" column="1" >
+        <widget class="QSpinBox" name="hoursSpin" >
+         <property name="maximum" >
+          <number>24</number>
          </property>
-         <property name="buddy" >
-          <cstring>slotSpin</cstring>
+         <property name="minimum" >
+          <number>-1</number>
+         </property>
+         <property name="value" >
+          <number>0</number>
          </property>
         </widget>
        </item>
-       <item row="5" column="0" >
-        <widget class="QLabel" name="label_6" >
+       <item row="7" column="0" >
+        <widget class="QLabel" name="label_11" >
          <property name="text" >
-          <string>Retension:</string>
+          <string>Seconds</string>
          </property>
-         <property name="buddy" >
-          <cstring>slotSpin</cstring>
+        </widget>
+       </item>
+       <item row="1" column="0" colspan="2" >
+        <widget class="QRadioButton" name="retentionRadio" >
+         <property name="text" >
+          <string>Retention</string>
          </property>
         </widget>
        </item>
-       <item row="5" column="1" >
-        <widget class="QSpinBox" name="retentionSpin" >
-         <property name="maximum" >
-          <number>2147483647</number>
+       <item row="4" column="0" >
+        <widget class="QLabel" name="label_8" >
+         <property name="text" >
+          <string>Days</string>
          </property>
         </widget>
        </item>
+       <item row="2" column="0" colspan="2" >
+        <widget class="QRadioButton" name="useDurationRadio" >
+         <property name="text" >
+          <string>Use Duration</string>
+         </property>
+        </widget>
+       </item>
+       <item row="8" column="0" colspan="2" >
+        <spacer>
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" >
+          <size>
+           <width>97</width>
+           <height>81</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
        <item row="3" column="0" >
-        <widget class="QLabel" name="label_5" >
+        <widget class="QLabel" name="label_2" >
          <property name="text" >
-          <string>Volume Status:</string>
+          <string>Years</string>
          </property>
         </widget>
        </item>
        <item row="4" column="1" >
-        <widget class="QSpinBox" name="slotSpin" >
+        <widget class="QSpinBox" name="daysSpin" >
          <property name="maximum" >
-          <number>10000</number>
+          <number>365</number>
+         </property>
+         <property name="minimum" >
+          <number>-1</number>
          </property>
         </widget>
        </item>
-       <item row="7" column="0" colspan="2" >
-        <layout class="QHBoxLayout" >
-         <property name="margin" >
-          <number>0</number>
+       <item row="7" column="1" >
+        <widget class="QSpinBox" name="secondsSpin" >
+         <property name="maximum" >
+          <number>60</number>
+         </property>
+         <property name="minimum" >
+          <number>-1</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>
+        </widget>
        </item>
-       <item row="2" column="0" >
-        <widget class="QLabel" name="label_3" >
-         <property name="text" >
-          <string>Pool:</string>
+       <item row="3" column="1" >
+        <widget class="QSpinBox" name="yearsSpin" >
+         <property name="maximum" >
+          <number>999</number>
          </property>
-         <property name="buddy" >
-          <cstring>poolCombo</cstring>
+         <property name="minimum" >
+          <number>-1</number>
          </property>
         </widget>
        </item>
-       <item row="2" column="1" >
-        <widget class="QComboBox" name="poolCombo" />
+       <item row="5" column="0" >
+        <widget class="QLabel" name="label_9" >
+         <property name="text" >
+          <string>Hours</string>
+         </property>
+        </widget>
        </item>
        <item row="6" column="1" >
-        <widget class="QSpinBox" name="useDurationSpin" >
+        <widget class="QSpinBox" name="minutesSpin" >
          <property name="maximum" >
-          <number>2147483647</number>
+          <number>60</number>
+         </property>
+         <property name="minimum" >
+          <number>-1</number>
          </property>
         </widget>
        </item>
+       <item row="0" column="0" colspan="2" >
+        <spacer>
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" >
+          <size>
+           <width>97</width>
+           <height>71</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
       </layout>
      </item>
-     <item row="0" column="1" colspan="2" >
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>97</width>
-         <height>16</height>
-        </size>
-       </property>
-      </spacer>
+     <item row="9" column="1" >
+      <widget class="QSpinBox" name="maxFilesSpin" >
+       <property name="maximum" >
+        <number>2147483647</number>
+       </property>
+      </widget>
      </item>
-     <item row="3" column="1" >
-      <widget class="QLabel" name="label_2" >
-       <property name="text" >
-        <string>Years</string>
+     <item row="11" column="0" colspan="2" >
+      <layout class="QHBoxLayout" >
+       <property name="margin" >
+        <number>0</number>
+       </property>
+       <property name="spacing" >
+        <number>6</number>
+       </property>
+       <item>
+        <widget class="QCheckBox" name="recycleCheck" >
+         <property name="layoutDirection" >
+          <enum>Qt::RightToLeft</enum>
+         </property>
+         <property name="text" >
+          <string>Recycle</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="6" column="1" >
+      <widget class="QSpinBox" name="useDurationSpin" >
+       <property name="maximum" >
+        <number>2147483647</number>
        </property>
       </widget>
      </item>
-     <item row="5" column="1" >
-      <widget class="QLabel" name="label_9" >
-       <property name="text" >
-        <string>Hours</string>
+     <item row="7" column="1" >
+      <widget class="QSpinBox" name="maxJobsSpin" >
+       <property name="maximum" >
+        <number>2147483647</number>
        </property>
       </widget>
      </item>
-     <item row="2" column="1" colspan="2" >
-      <widget class="QRadioButton" name="useDurationRadio" >
+     <item row="6" column="0" >
+      <widget class="QLabel" name="label_7" >
        <property name="text" >
-        <string>Use Duration</string>
+        <string>Use Duration:</string>
+       </property>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
        </property>
       </widget>
      </item>
-     <item row="3" column="2" >
-      <widget class="QSpinBox" name="yearsSpin" >
-       <property name="maximum" >
-        <number>999</number>
+     <item row="2" column="0" >
+      <widget class="QLabel" name="label_3" >
+       <property name="text" >
+        <string>Pool:</string>
        </property>
-       <property name="minimum" >
-        <number>-1</number>
+       <property name="buddy" >
+        <cstring>poolCombo</cstring>
        </property>
       </widget>
      </item>
-     <item row="4" column="1" >
-      <widget class="QLabel" name="label_8" >
+     <item row="10" column="1" >
+      <widget class="QComboBox" name="recyclePoolCombo" />
+     </item>
+     <item row="8" column="0" >
+      <widget class="QLabel" name="label_13" >
        <property name="text" >
-        <string>Days</string>
+        <string>Max Volume Bytes:</string>
+       </property>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
        </property>
       </widget>
      </item>
-     <item row="7" column="1" >
-      <widget class="QLabel" name="label_11" >
+     <item row="5" column="0" >
+      <widget class="QLabel" name="label_6" >
        <property name="text" >
-        <string>Seconds</string>
+        <string>Retension:</string>
+       </property>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
        </property>
       </widget>
      </item>
-     <item row="1" column="1" colspan="2" >
-      <widget class="QRadioButton" name="retentionRadio" >
+     <item row="2" column="1" >
+      <widget class="QComboBox" name="poolCombo" />
+     </item>
+     <item row="4" column="0" >
+      <widget class="QLabel" name="label_4" >
        <property name="text" >
-        <string>Retention</string>
+        <string>Slot:</string>
+       </property>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
        </property>
       </widget>
      </item>
-     <item row="7" column="2" >
-      <widget class="QSpinBox" name="secondsSpin" >
+     <item row="5" column="1" >
+      <widget class="QSpinBox" name="retentionSpin" >
        <property name="maximum" >
-        <number>60</number>
+        <number>2147483647</number>
+       </property>
+      </widget>
+     </item>
+     <item row="10" column="0" >
+      <widget class="QLabel" name="label_15" >
+       <property name="text" >
+        <string>Recycle Pool:</string>
        </property>
-       <property name="minimum" >
-        <number>-1</number>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
        </property>
       </widget>
      </item>
-     <item row="6" column="2" >
-      <widget class="QSpinBox" name="minutesSpin" >
-       <property name="maximum" >
-        <number>60</number>
+     <item row="7" column="0" >
+      <widget class="QLabel" name="label_12" >
+       <property name="text" >
+        <string>Max Volume Jobs:</string>
        </property>
-       <property name="minimum" >
-        <number>-1</number>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
        </property>
       </widget>
      </item>
     </layout>
    </item>
-   <item row="0" column="1" >
+   <item row="2" column="1" >
     <spacer>
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
@@ -379,7 +548,7 @@ p, li { white-space: pre-wrap; }
      </property>
     </spacer>
    </item>
-   <item row="2" column="1" >
+   <item row="0" column="1" >
     <spacer>
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
@@ -392,32 +561,6 @@ p, li { white-space: pre-wrap; }
      </property>
     </spacer>
    </item>
-   <item row="1" column="0" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>40</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="2" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>40</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
  <resources/>
index 41bb9447076d28398a1188473c27fb5db74e801a..027d6cb023c3a00f07da451c109e73c22eeaa86c 100644 (file)
@@ -77,9 +77,10 @@ void MediaList::populateTree()
        return;
 
    QStringList headerlist = (QStringList()
-      << "Volume Name" << "Id" << "Status" << "Enabled"
-      << "Bytes" << "Files" << "Jobs" << "Retention" 
-      << "Media Type" << "Slot" << "Last Written");
+      << "Volume Name" << "Id" << "Status" << "Enabled" << "Bytes" << "Files"
+      << "Jobs" << "Retention" << "Media Type" << "Slot" << "Use Duration"
+      << "Max Jobs" << "Max Files" << "Max Bytes" << "Recycle" << "Enabled"
+      << "RecyclePool" << "Last Written");
    int statusIndex = headerlist.indexOf("Status");
 
    m_checkcurwidget = false;
@@ -106,10 +107,16 @@ void MediaList::populateTree()
          " Media.Enabled AS Enabled, Media.VolBytes AS Bytes,"
          " Media.VolFiles AS FileCount, Media.VolJobs AS JobCount,"
          " Media.VolRetention AS VolumeRetention, Media.MediaType AS MediaType,"
-         " Media.Slot AS Slot, Media.LastWritten AS LastWritten"
-         " FROM Media, Pool"
-         " WHERE Media.PoolId=Pool.PoolId";
-      query += " AND Pool.Name='" + pool_listItem + "'";
+         " Media.Slot AS Slot, Media.VolUseDuration AS UseDuration,"
+         " Media.MaxVolJobs AS MaxJobs, Media.MaxVolFiles AS MaxFiles,"
+         " Media.MaxVolBytes AS MaxBytes, Media.Recycle AS Recycle,"
+         " 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)"
+         " WHERE";
+      query += " Pool.Name='" + pool_listItem + "'";
       query += " ORDER BY Media";
    
       if (mainWin->m_sqlDebug) {