]> git.sur5r.net Git - bacula/bacula/commitdiff
Add check boxes and combo boxes to limit the joblist. Move setTitle
authorDirk H Bartley <dbartley@schupan.com>
Sat, 5 May 2007 02:17:02 +0000 (02:17 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Sat, 5 May 2007 02:17:02 +0000 (02:17 +0000)
to pg_Initialize from constructors.

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

bacula/src/qt-console/TODO
bacula/src/qt-console/clients/clients.cpp
bacula/src/qt-console/fileset/fileset.cpp
bacula/src/qt-console/joblist/joblist.cpp
bacula/src/qt-console/joblist/joblist.ui
bacula/src/qt-console/medialist/medialist.cpp
bacula/src/qt-console/pages.cpp
bacula/src/qt-console/storage/storage.cpp

index 627eb8c5decfb5d3f568f7165ea6aedc09d9d749..741a1737869dade6ac60574c32020eff0feedcbd 100644 (file)
@@ -6,12 +6,10 @@ Possilbe: Turn run and label into docked pages. (remove button bar buttons??)
 
 Resolve issue of connection during restore selection.  Could go with preempt
 
-Add option to LIMIT the number of jobs shown in all jobs page for users with
-multiple hundreds to thousands of jobs.
-
 Where and bootstrap are confused in runjobs of restore.
 
 User preferences.  With log to stdout options.
+Have settings for defaults of limits on joblist
 
 Test restore and get anything not working, working.
   partially done.
@@ -21,9 +19,6 @@ Get restore into stack.
 
 Update README  describe bat.conf.example to bat.conf
 
-Create list of what does not work.
-From what I can tell, just the restore window on the left.
-
 Add numerous are you sure dialog boxes.  Like are you sure you want to
 delete/purge that volume.  Show a little of the documentation about what
 the consequences of delete or purging are.
@@ -106,10 +101,15 @@ global one defined in the mainWin class (if I remember right).
 ============================================================
 DONE:
 ============================================================
+Create list of what does not work.
+From what I can tell, just the restore window on the left.
+
+Add option to LIMIT the number of jobs shown in all jobs page for users with
+multiple hundreds to thousands of jobs.
+
 Play with includes to Make these compiles shorter.
   moved includes of of includes and into files only console.h should be long
 
-
 relabel storage=DDS3 oldvolume=ddsvol003 volume=dds3vol003 slot=3 pool=dds3_hope
 in label slot spinner, limit the upper to the value of slots for that storage.
 
index 4f18299e14563ad16fefbeba43b7a05cb01350d1..8aa2ed5fe85694b00ba76e1a63cf43b5b6da02c2 100644 (file)
@@ -50,7 +50,6 @@ Clients::Clients()
    m_populated = false;
    m_checkcurwidget = true;
    m_closeable = false;
-   setTitle();
 }
 
 Clients::~Clients()
index b2c66674d5c0040d229f913b8e0cdecf2edf3bfa..6a92c31fa878f425e1d9b334ee47540024b5d13b 100644 (file)
@@ -50,7 +50,6 @@ FileSet::FileSet()
    m_populated = false;
    m_checkcurwidget = true;
    m_closeable = false;
-   setTitle();
 }
 
 FileSet::~FileSet()
index fc3eabe327f085c681a22d75e202733f0e3dfb0e..a695964dcdd40b02c4c0533f9d6c68bf085ac2c0 100644 (file)
@@ -53,7 +53,12 @@ JobList::JobList(QString &mediaName, QString &clientname,
    m_closeable = false;
    m_checkCurrentWidget = true;
    createConnections();
-   setTitle();
+
+   /* Set Defaults for check and spin for limits */
+   limitCheckBox->setCheckState(Qt::Checked);
+   limitSpinBox->setValue(150);
+   daysCheckBox->setCheckState(Qt::Unchecked);
+   daysSpinBox->setValue(30);
 }
 
 /*
@@ -68,6 +73,34 @@ void JobList::populateTable()
    QString resultline;
    QBrush blackBrush(Qt::black);
 
+   /* Can't do this in constructor because not neccesarily conected in constructor */
+   if (!m_populated) {
+      clientsComboBox->addItem("");
+      clientsComboBox->addItems(m_console->client_list);
+      int clientIndex = clientsComboBox->findText(m_clientName, Qt::MatchExactly);
+      if (clientIndex != -1)
+         clientsComboBox->setCurrentIndex(clientIndex);
+
+      /* Not m_console->volume_list will query database */
+      QString query("SELECT VolumeName AS Media FROM Media ORDER BY Media");
+      QStringList results, volumeList;
+      if (m_console->sql_cmd(query, results)) {
+         QString field;
+         QStringList fieldlist;
+         /* Iterate through the lines of results. */
+         foreach (QString resultline, results) {
+            fieldlist = resultline.split("\t");
+            volumeList.append(fieldlist[0]);
+         } /* foreach resultline */
+      } /* if results from query */
+      volumeComboBox->addItem("");
+      volumeComboBox->addItems(volumeList);
+      int volumeIndex = volumeComboBox->findText(m_mediaName, Qt::MatchExactly);
+      if (volumeIndex != -1) {
+         volumeComboBox->setCurrentIndex(volumeIndex);
+      }
+   }
+
    /* Set up query QString and header QStringList */
    QString query("");
    query += "SELECT DISTINCT Job.Jobid AS Id, Job.Name AS JobName, Client.Name AS Client,"
@@ -77,15 +110,34 @@ void JobList::populateTable()
             " FROM Job, JobMedia, Media, Client"
             " WHERE JobMedia.JobId=Job.JobId and JobMedia.MediaId=Media.MediaId"
             " and Client.ClientId=Job.ClientId";
+   int volumeIndex = volumeComboBox->currentIndex();
+   if (volumeIndex != -1)
+      m_mediaName = volumeComboBox->itemText(volumeIndex);
    if (m_mediaName != "") {
-      query += " and Media.VolumeName='" + m_mediaName + "'";
+      query += " AND Media.VolumeName='" + m_mediaName + "'";
       m_closeable=true;
    }
+   int clientIndex = clientsComboBox->currentIndex();
+   if (clientIndex != -1)
+      m_clientName = clientsComboBox->itemText(clientIndex);
    if (m_clientName != "") {
-      query += " and Client.Name='" + m_clientName + "'";
+      query += " AND Client.Name='" + m_clientName + "'";
       m_closeable=true;
    }
-   query += " ORDER BY Job.Starttime";
+   /* 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);
+      query += " AND Job.Starttime>'" + since + "'";
+   }
+   /* Descending */
+   query += " ORDER BY Job.Starttime DESC";
+   /* If Limit check box for limit records returned is checked  */
+   if (limitCheckBox->checkState() == Qt::Checked) {
+      QString limit;
+      limit.setNum(limitSpinBox->value());
+      query += " LIMIT " + limit;
+   }
    QStringList headerlist = (QStringList()
       << "Job Id" << "Job Name" << "Client" << "Job Starttime" << "Job Type" 
       << "Job Level" << "Job Files" << "Job Bytes" << "Job Status"  );
@@ -203,6 +255,7 @@ void JobList::createConnections()
     * page selector tree */
    connect(actionRefreshJobList, SIGNAL(triggered()), this,
                 SLOT(populateTable()));
+   connect(refreshButton, SIGNAL(pressed()), this, SLOT(populateTable()));
    /* for the tableItemChanged to maintain m_currentJob */
    connect(mp_tableWidget, SIGNAL(
            currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)),
index f9b94fd41768aaaf8e5ee598b0ec6368fbdcd758..605f666e06303139377573a9dfbd06ce65bfec1f 100644 (file)
@@ -6,7 +6,7 @@
     <x>0</x>
     <y>0</y>
     <width>621</width>
-    <height>460</height>
+    <height>500</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <property name="spacing" >
     <number>6</number>
    </property>
+   <item row="1" column="0" >
+    <layout class="QHBoxLayout" >
+     <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>10</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="QLabel" name="clientsLabel" >
+         <property name="text" >
+          <string>Clients</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QComboBox" name="clientsComboBox" />
+       </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>
+     <item>
+      <widget class="QPushButton" name="refreshButton" >
+       <property name="maximumSize" >
+        <size>
+         <width>65</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="text" >
+        <string>Refresh</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
    <item row="0" column="0" >
     <widget class="QTableWidget" name="mp_tableWidget" />
    </item>
   </layout>
   <action name="actionRefreshJobList" >
    <property name="icon" >
-    <iconset>:images/run.png</iconset>
+    <iconset>../../../../../../../:images/run.png</iconset>
    </property>
    <property name="text" >
     <string>Refresh Job List</string>
   </action>
   <action name="actionListJobid" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>ListJobid</string>
   </action>
   <action name="actionListFilesOnJob" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>List Files On Job</string>
   </action>
   <action name="actionListJobMedia" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>ListJobMedia</string>
   </action>
   <action name="actionListVolumes" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>ListVolumes</string>
   </action>
   <action name="actionLongListJob" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>LongListJob</string>
   </action>
   <action name="actionDeleteJob" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>DeleteJob</string>
   </action>
   <action name="actionPurgeFiles" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>PurgeFiles</string>
index aca288728ee15af57d3365aa562b14ab4b0cdd77..44fc75e24bc99562af7e543c4f073f5948e36fae 100644 (file)
@@ -53,7 +53,6 @@ MediaList::MediaList()
    m_populated = false;
    m_checkcurwidget = true;
    m_closeable = false;
-   setTitle();
 }
 
 MediaList::~MediaList()
index b6bd5d2f99b152374b695c34794c5407d059e8a6..efee0781cfb4c9309fe2be85dd6a59f0d1e34cf3 100644 (file)
@@ -195,6 +195,7 @@ void Pages::pgInitialize(QTreeWidgetItem *parentTreeWidgetItem)
    treeWidgetName(name);
    item->setText(0, name);
    mainWin->hashInsert(item, this);
+   setTitle();
 }
 
 /*
index b3eee6d8dc788f77da2f2ee9c1d4a6f75dcaaf08..2de0b053654fc8280525b46b308c40cc8f13f9e0 100644 (file)
@@ -53,7 +53,6 @@ Storage::Storage()
    m_checkcurwidget = true;
    m_closeable = false;
    m_currentStorage = "";
-   setTitle();
 }
 
 Storage::~Storage()