]> git.sur5r.net Git - bacula/bacula/commitdiff
Put controls in a scroll area for JobList and restore tree. Then put the scroll
authorDirk H Bartley <dbartley@schupan.com>
Sun, 29 Jul 2007 04:42:23 +0000 (04:42 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Sun, 29 Jul 2007 04:42:23 +0000 (04:42 +0000)
area in a splitter.  Allows for the window to get smaller and the control area will
then scroll.
Add ability to have the only criterion be the client in restore tree.
Add limits to restore tree like with joblist with record limit and/or days limit.

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

bacula/src/qt-console/joblist/joblist.cpp
bacula/src/qt-console/joblist/joblist.ui
bacula/src/qt-console/restore/restoretree.cpp
bacula/src/qt-console/restore/restoretree.h
bacula/src/qt-console/restore/restoretree.ui

index 006c06a9f548244c1e4ddfbea41af4ed0935d38b..159ba120fec00e01e7497ac62ebe96982f8dcb6b 100644 (file)
@@ -70,6 +70,21 @@ JobList::JobList(const QString &mediaName, const QString &clientName,
    daysCheckBox->setCheckState(mainWin->m_daysLimitCheck ? Qt::Checked : Qt::Unchecked);
    daysSpinBox->setValue(mainWin->m_daysLimitVal);
    dockPage();
+
+   QGridLayout *m_gridLayout = new QGridLayout(this);
+   m_gridLayout->setSpacing(6);
+   m_gridLayout->setMargin(9);
+   m_gridLayout->setObjectName(QString::fromUtf8("m_gridLayout"));
+
+   QSplitter *splitter_2 = new QSplitter(Qt::Vertical, this);
+   QScrollArea *area = new QScrollArea();
+   area->setObjectName(QString::fromUtf8("area"));
+   area->setWidget(frame);
+   area->setWidgetResizable(true);
+   splitter_2->addWidget(mp_tableWidget);
+   splitter_2->addWidget(area);
+
+   m_gridLayout->addWidget(splitter_2, 0, 0, 1, 1);
 }
 
 /*
index 00a0ab9b942a8d16b3950670737d57275dc00f5d..c0ee9eb989959a985d404b40e3c9389cf35d5672 100644 (file)
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>545</width>
-    <height>276</height>
+    <width>739</width>
+    <height>512</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>Form</string>
   </property>
-  <layout class="QGridLayout" >
-   <property name="margin" >
-    <number>9</number>
+  <widget class="QTableWidget" name="mp_tableWidget" >
+   <property name="geometry" >
+    <rect>
+     <x>60</x>
+     <y>10</y>
+     <width>457</width>
+     <height>131</height>
+    </rect>
    </property>
-   <property name="spacing" >
-    <number>6</number>
+  </widget>
+  <widget class="QFrame" name="frame" >
+   <property name="geometry" >
+    <rect>
+     <x>30</x>
+     <y>170</y>
+     <width>521</width>
+     <height>143</height>
+    </rect>
    </property>
-   <item row="1" column="0" >
-    <layout class="QGridLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item row="1" column="4" >
-      <layout class="QGridLayout" >
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <item row="0" column="0" >
-        <layout class="QGridLayout" >
-         <property name="margin" >
-          <number>0</number>
-         </property>
-         <property name="spacing" >
-          <number>3</number>
-         </property>
-         <item row="0" column="0" >
-          <widget class="QPushButton" name="refreshButton" >
-           <property name="maximumSize" >
-            <size>
-             <width>65</width>
-             <height>20</height>
-            </size>
-           </property>
-           <property name="text" >
-            <string>Refresh</string>
-           </property>
-           <property name="icon" >
-            <iconset resource="../main.qrc" >:/images/view-refresh.svg</iconset>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="0" >
-          <widget class="QPushButton" name="graphButton" >
-           <property name="maximumSize" >
-            <size>
-             <width>65</width>
-             <height>20</height>
-            </size>
-           </property>
-           <property name="text" >
-            <string>Graph</string>
-           </property>
-           <property name="icon" >
-            <iconset resource="../main.qrc" >:/images/graph1.png</iconset>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item row="0" column="1" >
-        <spacer>
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType" >
-          <enum>QSizePolicy::Ignored</enum>
-         </property>
-         <property name="sizeHint" >
-          <size>
-           <width>16</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </item>
-     <item rowspan="2" row="0" column="3" >
-      <layout class="QVBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <item>
-        <layout class="QVBoxLayout" >
-         <property name="margin" >
-          <number>0</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="statusLabel" >
-           <property name="text" >
-            <string>Status</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QComboBox" name="statusComboBox" />
-         </item>
-        </layout>
-       </item>
-       <item>
-        <layout class="QVBoxLayout" >
-         <property name="margin" >
-          <number>0</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="purgedLabel" >
-           <property name="text" >
-            <string>Purged</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QComboBox" name="purgedComboBox" />
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </item>
-     <item rowspan="2" row="0" column="0" >
-      <layout class="QVBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <item>
-        <layout class="QVBoxLayout" >
-         <property name="margin" >
-          <number>0</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item>
-          <widget class="QCheckBox" name="limitCheckBox" >
-           <property name="text" >
-            <string>Record Limit</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QSpinBox" name="limitSpinBox" >
-           <property name="maximum" >
-            <number>10000</number>
-           </property>
-           <property name="minimum" >
-            <number>1</number>
-           </property>
-           <property name="singleStep" >
-            <number>25</number>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <layout class="QVBoxLayout" >
-         <property name="margin" >
-          <number>0</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item>
-          <widget class="QCheckBox" name="daysCheckBox" >
-           <property name="text" >
-            <string>Days Limit</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QSpinBox" name="daysSpinBox" >
-           <property name="singleStep" >
-            <number>7</number>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </item>
-     <item row="0" column="4" >
-      <layout class="QVBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <item>
-        <widget class="QLabel" name="fileSetLabel" >
-         <property name="maximumSize" >
-          <size>
-           <width>16777215</width>
-           <height>20</height>
-          </size>
-         </property>
-         <property name="text" >
-          <string>FileSet</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QComboBox" name="fileSetComboBox" />
-       </item>
-      </layout>
-     </item>
-     <item rowspan="2" row="0" column="1" >
-      <layout class="QVBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <item>
-        <layout class="QVBoxLayout" >
-         <property name="margin" >
-          <number>0</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="clientsLabel" >
-           <property name="text" >
-            <string>Clients</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QComboBox" name="clientComboBox" />
-         </item>
-        </layout>
-       </item>
-       <item>
-        <layout class="QVBoxLayout" >
-         <property name="margin" >
-          <number>0</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="volumeLabel" >
-           <property name="text" >
-            <string>Volume</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QComboBox" name="volumeComboBox" />
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </item>
-     <item rowspan="2" row="0" column="2" >
-      <layout class="QVBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <item>
-        <layout class="QVBoxLayout" >
-         <property name="margin" >
-          <number>0</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="jobLabel" >
-           <property name="text" >
-            <string>Job</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QComboBox" name="jobComboBox" />
-         </item>
-        </layout>
-       </item>
-       <item>
-        <layout class="QVBoxLayout" >
-         <property name="margin" >
-          <number>0</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="levelLabel" >
-           <property name="text" >
-            <string>Level</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QComboBox" name="levelComboBox" />
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </item>
-    </layout>
-   </item>
-   <item row="0" column="0" >
-    <widget class="QTableWidget" name="mp_tableWidget" />
-   </item>
-  </layout>
+   <property name="maximumSize" >
+    <size>
+     <width>900</width>
+     <height>143</height>
+    </size>
+   </property>
+   <property name="frameShape" >
+    <enum>QFrame::StyledPanel</enum>
+   </property>
+   <property name="frameShadow" >
+    <enum>QFrame::Raised</enum>
+   </property>
+   <layout class="QGridLayout" >
+    <property name="margin" >
+     <number>9</number>
+    </property>
+    <property name="spacing" >
+     <number>6</number>
+    </property>
+    <item rowspan="2" row="0" column="2" >
+     <layout class="QVBoxLayout" >
+      <property name="margin" >
+       <number>3</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="jobLabel" >
+          <property name="text" >
+           <string>Job</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="jobComboBox" />
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="levelLabel" >
+          <property name="text" >
+           <string>Level</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="levelComboBox" />
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </item>
+    <item rowspan="2" row="0" column="1" >
+     <layout class="QVBoxLayout" >
+      <property name="margin" >
+       <number>3</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="clientsLabel" >
+          <property name="text" >
+           <string>Clients</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="clientComboBox" />
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="volumeLabel" >
+          <property name="text" >
+           <string>Volume</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="volumeComboBox" />
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </item>
+    <item row="0" column="4" >
+     <layout class="QVBoxLayout" >
+      <property name="margin" >
+       <number>3</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item>
+       <widget class="QLabel" name="fileSetLabel" >
+        <property name="maximumSize" >
+         <size>
+          <width>16777215</width>
+          <height>20</height>
+         </size>
+        </property>
+        <property name="text" >
+         <string>FileSet</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="fileSetComboBox" />
+      </item>
+     </layout>
+    </item>
+    <item rowspan="2" row="0" column="0" >
+     <layout class="QVBoxLayout" >
+      <property name="margin" >
+       <number>3</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QCheckBox" name="limitCheckBox" >
+          <property name="text" >
+           <string>Record Limit</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="limitSpinBox" >
+          <property name="maximum" >
+           <number>10000</number>
+          </property>
+          <property name="minimum" >
+           <number>1</number>
+          </property>
+          <property name="singleStep" >
+           <number>25</number>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QCheckBox" name="daysCheckBox" >
+          <property name="text" >
+           <string>Days Limit</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="daysSpinBox" >
+          <property name="singleStep" >
+           <number>7</number>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </item>
+    <item rowspan="2" row="0" column="3" >
+     <layout class="QVBoxLayout" >
+      <property name="margin" >
+       <number>3</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="statusLabel" >
+          <property name="text" >
+           <string>Status</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="statusComboBox" />
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="purgedLabel" >
+          <property name="text" >
+           <string>Purged</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="purgedComboBox" />
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </item>
+    <item row="1" column="4" >
+     <layout class="QGridLayout" >
+      <property name="margin" >
+       <number>3</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item row="0" column="0" >
+       <layout class="QGridLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>3</number>
+        </property>
+        <item row="0" column="0" >
+         <widget class="QPushButton" name="refreshButton" >
+          <property name="maximumSize" >
+           <size>
+            <width>65</width>
+            <height>20</height>
+           </size>
+          </property>
+          <property name="text" >
+           <string>Refresh</string>
+          </property>
+          <property name="icon" >
+           <iconset resource="../main.qrc" >:/images/view-refresh.svg</iconset>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0" >
+         <widget class="QPushButton" name="graphButton" >
+          <property name="maximumSize" >
+           <size>
+            <width>65</width>
+            <height>20</height>
+           </size>
+          </property>
+          <property name="text" >
+           <string>Graph</string>
+          </property>
+          <property name="icon" >
+           <iconset resource="../main.qrc" >:/images/graph1.png</iconset>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item row="0" column="1" >
+       <spacer>
+        <property name="orientation" >
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeType" >
+         <enum>QSizePolicy::Ignored</enum>
+        </property>
+        <property name="sizeHint" >
+         <size>
+          <width>16</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </item>
+   </layout>
+  </widget>
   <action name="actionRefreshJobList" >
    <property name="icon" >
     <iconset resource="../main.qrc" >:/images/view-refresh.svg</iconset>
index 852d8c9ac5e2c6ed6e71bb113d159eb35536931c..8d51d087c6b30fc29c5a69c2b050c03c63ba2ddf 100644 (file)
@@ -57,11 +57,33 @@ restoreTree::restoreTree()
    m_slashregex.setPattern("/");
    m_debugCnt = 0;
    m_debugTrap = true;
+
+   QGridLayout *m_gridLayout = new QGridLayout(this);
+   m_gridLayout->setSpacing(6);
+   m_gridLayout->setMargin(9);
+   m_gridLayout->setObjectName(QString::fromUtf8("m_gridLayout"));
+
+   QSplitter *splitter_2 = new QSplitter(Qt::Vertical, this);
+   QScrollArea *area = new QScrollArea();
+   area->setObjectName(QString::fromUtf8("area"));
+   area->setWidget(widget);
+   area->setWidgetResizable(true);
+   splitter_2->addWidget(splitter);
+   splitter_2->addWidget(area);
+
+   m_gridLayout->addWidget(splitter_2, 0, 0, 1, 1);
+
    /* progress widgets */
    prBar1->setVisible(false);
    prBar2->setVisible(false);
    prLabel1->setVisible(false);
    prLabel2->setVisible(false);
+
+   /* Set Defaults for check and spin for limits */
+   limitCheckBox->setCheckState(mainWin->m_recordLimitCheck ? Qt::Checked : Qt::Unchecked);
+   limitSpinBox->setValue(mainWin->m_recordLimitVal);
+   daysCheckBox->setCheckState(mainWin->m_daysLimitCheck ? Qt::Checked : Qt::Unchecked);
+   daysSpinBox->setValue(mainWin->m_daysLimitVal);
 }
 
 restoreTree::~restoreTree()
@@ -91,6 +113,7 @@ void restoreTree::setupPage()
    clientCombo->addItems(m_console->client_list);
    fileSetCombo->addItem("Any");
    fileSetCombo->addItems(m_console->fileset_list);
+   jobCombo->addItem("Any");
    jobCombo->addItems(m_console->job_list);
 
    directoryTree->setContextMenuPolicy(Qt::ActionsContextMenu);
@@ -116,11 +139,10 @@ void restoreTree::populateDirectoryTree()
    m_versionExceptionHash.clear();
    m_directoryIconStateHash.clear();
 
-   int clientIndex = clientCombo->currentIndex();
-   int fileSetIndex = fileSetCombo->currentIndex();
-   QString jobComboText = jobCombo->itemText(jobCombo->currentIndex());
-   QString clientComboText = clientCombo->itemText(clientIndex);
-   QString fileSetComboText = fileSetCombo->itemText(fileSetIndex);
+   QString jobComboText = jobCombo->currentText();
+   QString clientComboText = clientCombo->currentText();
+   QString fileSetComboText = fileSetCombo->currentText();
+   if (mainWin->m_rtPopDirDebug) Pmsg2(000, "testing prev=\"%s\" current=\"%s\"\n", m_prevJobCombo.toUtf8().data(), jobComboText.toUtf8().data());
    bool dropdownChanged = (m_prevJobCombo != jobComboText) || (m_prevClientCombo != clientComboText) || (m_prevFileSetCombo != fileSetComboText);
    int taskcount = 2, ontask = 1;
    if (dropdownChanged) taskcount += 1;
@@ -144,21 +166,34 @@ void restoreTree::populateDirectoryTree()
       m_prevFileSetCombo = fileSetComboText;
       if (mainWin->m_rtPopDirDebug) Pmsg0(000, "Repopulating the Job Table\n");
 
-      m_condition = " Job.name = '" + jobCombo->itemText(jobCombo->currentIndex()) + "'";
-      if ((clientIndex >= 0) && (clientCombo->itemText(clientIndex) != "Any")) {
-         m_condition.append(" AND Client.Name='" + clientCombo->itemText(clientIndex) + "'");
+      QString condition = " Client.Name='" + clientCombo->itemText(clientCombo->currentIndex()) + "'";
+      if ((jobCombo->currentIndex() >= 0) && (jobComboText != "Any")) {
+         condition.append(" AND Job.name = '" + jobComboText + "'");
+      }
+      if ((fileSetCombo->currentIndex() >= 0) && (fileSetComboText != "Any")) {
+         condition.append(" AND FileSet.FileSet='" + fileSetComboText + "'");
       }
-      if ((fileSetIndex >= 0) && (fileSetCombo->itemText(fileSetIndex) != "Any")) {
-         m_condition.append(" AND FileSet.FileSet='" + fileSetCombo->itemText(fileSetIndex) + "'");
+      /* If Limit check box For limit by days is checked  */
+      if (daysCheckBox->checkState() == Qt::Checked) {
+         QDateTime stamp = QDateTime::currentDateTime().addDays(-daysSpinBox->value());
+         QString since = stamp.toString(Qt::ISODate);
+         condition.append(" AND Job.Starttime>'" + since + "'");
       }
       m_jobQueryPart =
          " INNER JOIN Client ON (Job.ClientId=Client.ClientId)"
          " INNER JOIN FileSet ON (Job.FileSetId=FileSet.FileSetId)"
-         " WHERE" + m_condition +
+         " WHERE" + condition +
          " AND Job.purgedfiles=0";
       m_jobQuery =
          "SELECT Job.Jobid"
          " From Job" + m_jobQueryPart;
+      /* If Limit check box for limit records returned is checked  */
+      if (limitCheckBox->checkState() == Qt::Checked) {
+         QString limit;
+         limit.setNum(limitSpinBox->value());
+         m_jobQuery += " LIMIT " + limit;
+      }
+
       if (mainWin->m_sqlDebug) {
          Pmsg1(000, "Query cmd : %s\n", m_jobQuery.toUtf8().data());
       }
@@ -392,6 +427,10 @@ void restoreTree::refreshButtonPushed()
  */
 void restoreTree::jobComboChanged(int)
 {
+   if (jobCombo->currentText() == "Any") {
+      fileSetCombo->setCurrentIndex(fileSetCombo->findText("Any", Qt::MatchExactly));
+      return;
+   }
    job_defaults job_defs;
 
    (void)index;
@@ -615,6 +654,12 @@ void restoreTree::populateJobTable()
       "SELECT Job.Jobid AS Id, Job.EndTime AS EndTime, Job.Level AS Level"
       " FROM Job" + m_jobQueryPart +
       " ORDER BY Job.EndTime DESC";
+   /* If Limit check box for limit records returned is checked  */
+   if (limitCheckBox->checkState() == Qt::Checked) {
+      QString limit;
+      limit.setNum(limitSpinBox->value());
+      jobQuery += " LIMIT " + limit;
+   }
    if (mainWin->m_sqlDebug) {
       Pmsg1(000, "Query cmd : %s\n", jobQuery.toUtf8().data());
    }
index ae3a7e2279a51e1cb8aa35b7f120f5e5c9a3fdf8..9311ddeb727139c18393a7bf37e80dcbb36e8d85 100644 (file)
@@ -99,7 +99,6 @@ private:
    QRegExp m_slashregex;
    bool m_slashTrap;
    QHash<QString, QTreeWidgetItem *> m_dirPaths;
-   QString m_condition;
    QString m_jobQuery;
    QString m_jobQueryPart;
    QString m_prevJobCombo;
index 1447db6c2e99173f2ad5dd6344ad51f4ccd3da35..053e31eaa112fefcb5d1328102ccf8f8bbb72efc 100644 (file)
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>411</width>
-    <height>295</height>
+    <width>817</width>
+    <height>524</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>Form</string>
   </property>
-  <layout class="QGridLayout" >
-   <property name="margin" >
-    <number>9</number>
+  <widget class="QSplitter" name="splitter" >
+   <property name="geometry" >
+    <rect>
+     <x>60</x>
+     <y>160</y>
+     <width>382</width>
+     <height>221</height>
+    </rect>
    </property>
-   <property name="spacing" >
-    <number>6</number>
+   <property name="orientation" >
+    <enum>Qt::Horizontal</enum>
    </property>
-   <item row="0" column="0" >
-    <widget class="QSplitter" name="splitter" >
-     <property name="sizePolicy" >
-      <sizepolicy>
-       <hsizetype>7</hsizetype>
-       <vsizetype>7</vsizetype>
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
+   <widget class="QWidget" name="layoutWidget" >
+    <layout class="QVBoxLayout" >
+     <property name="margin" >
+      <number>0</number>
      </property>
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
+     <property name="spacing" >
+      <number>6</number>
      </property>
-     <widget class="QWidget" name="" >
-      <layout class="QGridLayout" >
-       <property name="margin" >
-        <number>0</number>
+     <item>
+      <widget class="QLabel" name="jobTabelLabel" >
+       <property name="text" >
+        <string>Jobs</string>
        </property>
-       <property name="spacing" >
-        <number>6</number>
+       <property name="alignment" >
+        <set>Qt::AlignCenter</set>
        </property>
-       <item row="3" column="0" >
-        <widget class="QProgressBar" name="prBar1" >
-         <property name="enabled" >
-          <bool>true</bool>
-         </property>
-         <property name="value" >
-          <number>24</number>
-         </property>
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="0" >
-        <widget class="QLabel" name="prLabel1" >
-         <property name="text" >
-          <string>TextLabel</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignCenter</set>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="0" >
-        <widget class="QLabel" name="jobLabel" >
-         <property name="text" >
-          <string>Jobs</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignCenter</set>
-         </property>
-        </widget>
-       </item>
-       <item row="5" column="0" >
-        <widget class="QProgressBar" name="prBar2" >
-         <property name="enabled" >
-          <bool>true</bool>
-         </property>
-         <property name="value" >
-          <number>24</number>
-         </property>
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item row="4" column="0" >
-        <widget class="QLabel" name="prLabel2" >
-         <property name="text" >
-          <string>TextLabel</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignCenter</set>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="0" >
-        <widget class="QTableWidget" name="jobTable" />
-       </item>
-      </layout>
-     </widget>
-     <widget class="QTreeWidget" name="directoryTree" />
-     <widget class="QWidget" name="layoutWidget_2" >
-      <layout class="QGridLayout" >
-       <property name="margin" >
-        <number>0</number>
+      </widget>
+     </item>
+     <item>
+      <widget class="QTableWidget" name="jobTable" />
+     </item>
+     <item>
+      <widget class="QLabel" name="prLabel1" >
+       <property name="text" >
+        <string>TextLabel</string>
        </property>
-       <property name="spacing" >
-        <number>6</number>
+       <property name="alignment" >
+        <set>Qt::AlignCenter</set>
        </property>
-       <item row="1" column="0" >
-        <widget class="QTableWidget" name="fileTable" />
-       </item>
-       <item row="0" column="0" >
-        <widget class="QLabel" name="fileLabel" >
-         <property name="text" >
-          <string>Files</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignCenter</set>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="layoutWidget_3" >
-      <layout class="QGridLayout" >
-       <property name="margin" >
-        <number>0</number>
+      </widget>
+     </item>
+     <item>
+      <widget class="QProgressBar" name="prBar1" >
+       <property name="enabled" >
+        <bool>true</bool>
        </property>
-       <property name="spacing" >
-        <number>6</number>
+       <property name="value" >
+        <number>24</number>
        </property>
-       <item row="1" column="0" >
-        <widget class="QLabel" name="versionFileLabel" >
-         <property name="text" >
-          <string>FileName</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignCenter</set>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="0" >
-        <widget class="QLabel" name="versionLabel" >
-         <property name="text" >
-          <string>Versions of File</string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignCenter</set>
-         </property>
-        </widget>
-       </item>
-       <item row="2" column="0" >
-        <widget class="QTableWidget" name="versionTable" />
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-   <item row="1" column="0" >
-    <layout class="QGridLayout" >
+       <property name="orientation" >
+        <enum>Qt::Horizontal</enum>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="prLabel2" >
+       <property name="text" >
+        <string>TextLabel</string>
+       </property>
+       <property name="alignment" >
+        <set>Qt::AlignCenter</set>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QProgressBar" name="prBar2" >
+       <property name="enabled" >
+        <bool>true</bool>
+       </property>
+       <property name="value" >
+        <number>24</number>
+       </property>
+       <property name="orientation" >
+        <enum>Qt::Horizontal</enum>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+   <widget class="QTreeWidget" name="directoryTree" />
+   <widget class="QWidget" name="layoutWidget_1" >
+    <layout class="QVBoxLayout" >
      <property name="margin" >
       <number>0</number>
      </property>
      <property name="spacing" >
       <number>6</number>
      </property>
-     <item row="0" column="0" >
-      <widget class="QLabel" name="directoryLabel" >
-       <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>5</hsizetype>
-         <vsizetype>0</vsizetype>
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
+     <item>
+      <widget class="QLabel" name="fileLabel" >
+       <property name="text" >
+        <string>Files</string>
+       </property>
+       <property name="alignment" >
+        <set>Qt::AlignCenter</set>
        </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QTableWidget" name="fileTable" />
+     </item>
+    </layout>
+   </widget>
+   <widget class="QWidget" name="layoutWidget_2" >
+    <layout class="QVBoxLayout" >
+     <property name="margin" >
+      <number>0</number>
+     </property>
+     <property name="spacing" >
+      <number>6</number>
+     </property>
+     <item>
+      <widget class="QLabel" name="versionLabel" >
        <property name="text" >
-        <string>Directory</string>
+        <string>Versions of File</string>
+       </property>
+       <property name="alignment" >
+        <set>Qt::AlignCenter</set>
        </property>
       </widget>
      </item>
-     <item row="1" column="0" >
-      <layout class="QHBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
+     <item>
+      <widget class="QLabel" name="versionFileLabel" >
+       <property name="text" >
+        <string>FileName</string>
        </property>
-       <property name="spacing" >
-        <number>6</number>
+       <property name="alignment" >
+        <set>Qt::AlignCenter</set>
        </property>
-       <item>
-        <widget class="QPushButton" name="refreshButton" >
-         <property name="text" >
-          <string>Refresh</string>
-         </property>
-         <property name="icon" >
-          <iconset resource="../main.qrc" >:/images/view-refresh.svg</iconset>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QComboBox" name="jobCombo" />
-       </item>
-       <item>
-        <widget class="QComboBox" name="clientCombo" />
-       </item>
-       <item>
-        <widget class="QComboBox" name="fileSetCombo" />
-       </item>
-       <item>
-        <spacer>
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" >
-          <size>
-           <width>21</width>
-           <height>26</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QPushButton" name="restoreButton" >
-         <property name="text" >
-          <string>Restore</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
+      </widget>
+     </item>
+     <item>
+      <widget class="QTableWidget" name="versionTable" />
      </item>
     </layout>
-   </item>
-  </layout>
+   </widget>
+  </widget>
+  <widget class="QWidget" native="1" name="widget" >
+   <property name="geometry" >
+    <rect>
+     <x>10</x>
+     <y>57</y>
+     <width>791</width>
+     <height>79</height>
+    </rect>
+   </property>
+   <property name="maximumSize" >
+    <size>
+     <width>950</width>
+     <height>16777215</height>
+    </size>
+   </property>
+   <layout class="QGridLayout" >
+    <property name="margin" >
+     <number>0</number>
+    </property>
+    <property name="spacing" >
+     <number>6</number>
+    </property>
+    <item row="1" column="0" >
+     <layout class="QHBoxLayout" >
+      <property name="margin" >
+       <number>3</number>
+      </property>
+      <property name="spacing" >
+       <number>9</number>
+      </property>
+      <item>
+       <widget class="QPushButton" name="refreshButton" >
+        <property name="text" >
+         <string>Refresh</string>
+        </property>
+        <property name="icon" >
+         <iconset resource="../main.qrc" >:/images/view-refresh.svg</iconset>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPushButton" name="restoreButton" >
+        <property name="text" >
+         <string>Restore</string>
+        </property>
+        <property name="icon" >
+         <iconset resource="../main.qrc" >:/images/restore.png</iconset>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>9</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="jobLabel" >
+          <property name="text" >
+           <string>Job</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="jobCombo" >
+          <property name="sizePolicy" >
+           <sizepolicy>
+            <hsizetype>7</hsizetype>
+            <vsizetype>0</vsizetype>
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="toolTip" >
+           <string>Job List Job Criterion Selector</string>
+          </property>
+          <property name="statusTip" >
+           <string>Job List Job Criterion Selector</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>0</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="clientLabel" >
+          <property name="text" >
+           <string>Client</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="clientCombo" >
+          <property name="sizePolicy" >
+           <sizepolicy>
+            <hsizetype>7</hsizetype>
+            <vsizetype>0</vsizetype>
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="toolTip" >
+           <string>Job List Client Criterion Selector</string>
+          </property>
+          <property name="statusTip" >
+           <string>Job List Client Criterion Selector</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>0</number>
+        </property>
+        <item>
+         <widget class="QLabel" name="fileSetLabel" >
+          <property name="text" >
+           <string>FileSet</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="fileSetCombo" >
+          <property name="sizePolicy" >
+           <sizepolicy>
+            <hsizetype>7</hsizetype>
+            <vsizetype>0</vsizetype>
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="toolTip" >
+           <string>Job List Fileset Criterion Selector</string>
+          </property>
+          <property name="statusTip" >
+           <string>Job List Fileset Criterion Selector</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>0</number>
+        </property>
+        <item>
+         <widget class="QCheckBox" name="limitCheckBox" >
+          <property name="text" >
+           <string>Record Limit</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="limitSpinBox" >
+          <property name="maximum" >
+           <number>10000</number>
+          </property>
+          <property name="minimum" >
+           <number>1</number>
+          </property>
+          <property name="singleStep" >
+           <number>25</number>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="margin" >
+         <number>3</number>
+        </property>
+        <property name="spacing" >
+         <number>0</number>
+        </property>
+        <item>
+         <widget class="QCheckBox" name="daysCheckBox" >
+          <property name="text" >
+           <string>Days Limit</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="daysSpinBox" >
+          <property name="singleStep" >
+           <number>7</number>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </item>
+    <item row="0" column="0" >
+     <widget class="QLabel" name="directoryLabel" >
+      <property name="sizePolicy" >
+       <sizepolicy>
+        <hsizetype>5</hsizetype>
+        <vsizetype>0</vsizetype>
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="cursor" >
+       <cursor>13</cursor>
+      </property>
+      <property name="text" >
+       <string>Directory</string>
+      </property>
+     </widget>
+    </item>
+   </layout>
+  </widget>
   <action name="actionSelectDirectory" >
    <property name="icon" >
     <iconset/>