]> git.sur5r.net Git - bacula/bacula/commitdiff
On vacation I am having a little fun !!
authorDirk H Bartley <dbartley@schupan.com>
Tue, 26 May 2009 18:28:50 +0000 (18:28 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Tue, 26 May 2009 18:28:50 +0000 (18:28 +0000)
Storage status, dir status and client status pages all now have separate timers
which are visible and configurable from within the page.  The user can see the
countdown of the timer.

Add a tab widget to the client status for a little different look containing
the heading and running outputs.  Changing to a different tab auto refreshes
the widget that becomes in front like with the storage status.

In the client status page make the table right click to a refresh option.

In both client and storage pages, if the right click option for a status window
is chosen, a test is done to see if that staus already exists.  If so, then
bring that status window to the current window instead of creating a repeat
instance of the class

In the storage status page, miscelaneous tab - add two more buttons to perform
commands for label and release identical to the right click options from the
storage page.

If a status window for a specific client or storage is open when bat is closed,
a settings is written and if the storage or client page is populated the next
time bat is opened, the status page for the storage or client will automatically
be created.

In the main menu, add an option to execute "reload" AND ALSO repopulate the
lists for an easy way to do both after modifying bacula-dir.conf

With each status page having it's own timer, the common timer from prefs is no
longer required

The joblist page now has a column for pool.  A dropdown for selecting based on
pool has also been added.

Restoretree: The bug that was issued for a directory not being restored has
been resolved.  I thought this would take a while.  Turns out a query just
needed one line removed.

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

19 files changed:
bacula/src/qt-console/clients/clients.cpp
bacula/src/qt-console/clients/clients.h
bacula/src/qt-console/joblist/joblist.cpp
bacula/src/qt-console/joblist/joblist.ui
bacula/src/qt-console/main.ui
bacula/src/qt-console/mainwin.cpp
bacula/src/qt-console/mainwin.h
bacula/src/qt-console/prefs.ui
bacula/src/qt-console/restore/restoretree.cpp
bacula/src/qt-console/status/clientstat.cpp
bacula/src/qt-console/status/clientstat.h
bacula/src/qt-console/status/clientstat.ui
bacula/src/qt-console/status/dirstat.cpp
bacula/src/qt-console/status/dirstat.ui
bacula/src/qt-console/status/storstat.cpp
bacula/src/qt-console/status/storstat.h
bacula/src/qt-console/status/storstat.ui
bacula/src/qt-console/storage/storage.cpp
bacula/src/qt-console/storage/storage.h

index 9f3f4a93b47ad7a301d9739567de23498c887008..2104d1c0a8601c1d633de0d12565590a5238d9f8 100644 (file)
@@ -55,6 +55,7 @@ Clients::Clients()
    m_populated = false;
    m_checkcurwidget = true;
    m_closeable = false;
+   m_firstpopulation = true;
    /* add context sensitive menu items specific to this classto the page
     * selector tree. m_contextActions is QList of QActions */
    m_contextActions.append(actionRefreshClients);
@@ -127,6 +128,11 @@ void Clients::populateTable()
          foreach (QString resultline, results) {
             QStringList fieldlist = resultline.split("\t");
 
+            if (m_firstpopulation) {
+               m_firstpopulation = false;
+               settingsOpenStatus(fieldlist[0]);
+            }
+
             TableItemFormatter item(*tableWidget, row);
 
             /* Iterate through fields in the record */
@@ -319,6 +325,39 @@ void Clients::prune()
  */
 void Clients::statusClientWindow()
 {
-   QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
-   new ClientStat(m_currentlyselected, parentItem);
+   /* if one exists, then just set it current */
+   bool found = false;
+   foreach(Pages *page, mainWin->m_pagehash) {
+      if (mainWin->currentConsole() == page->console()) {
+         if (page->name() == tr("Client Status %1").arg(m_currentlyselected)) {
+            found = true;
+            page->setCurrent();
+         }
+      }
+   }
+   if (!found) {
+      QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
+      new ClientStat(m_currentlyselected, parentItem);
+   }
+}
+
+/*
+ * If first time, then check to see if there were status pages open the last time closed
+ * if so open
+ */
+void Clients::settingsOpenStatus(QString &client)
+{
+   QSettings settings(m_console->m_dir->name(), "bat");
+
+   settings.beginGroup("OpenOnExit");
+   QString toRead = "ClientStatus_" + client;
+   if (settings.value(toRead) == 1) {
+      Pmsg1(000, "Do open Client Status window for : %s\n", client.toUtf8().data());
+      new ClientStat(client, mainWin->getFromHash(this));
+      setCurrent();
+      mainWin->getFromHash(this)->setExpanded(true);
+   } else {
+      Pmsg1(000, "Do NOT open Client Status window for : %s\n", client.toUtf8().data());
+   }
+   settings.endGroup();
 }
index 8c206faa49f6d4fe5f98f40b8f148f89d1a3cb6e..6bc77e5f517d4702926baf8b6b80b9e460700624 100644 (file)
@@ -61,8 +61,10 @@ private slots:
 
 private:
    void createContextMenu();
+   void settingsOpenStatus(QString& client);
    QString m_currentlyselected;
    bool m_populated;
+   bool m_firstpopulation;
    bool m_checkcurwidget;
 };
 
index aa62e5e10e0ee342015080839a538569e1a6b277..dddf9991f20eb4350f9c9aae57f81eee6b64a1c0 100644 (file)
@@ -122,7 +122,8 @@ void JobList::populateTable()
    QStringList headerlist = (QStringList()
       << tr("Job Id") << tr("Job Name") << tr("Client") << tr("Job Starttime") 
       << tr("Job Type") << tr("Job Level") << tr("Job Files") 
-      << tr("Job Bytes") << tr("Job Status")  << tr("Purged") << tr("File Set"));
+      << tr("Job Bytes") << tr("Job Status")  << tr("Purged") << tr("File Set")
+      << tr("Pool Name"));
 
    m_jobIdIndex = headerlist.indexOf(tr("Job Id"));
    m_purgedIndex = headerlist.indexOf(tr("Purged"));
@@ -158,7 +159,7 @@ void JobList::populateTable()
       QString resultline;
       foreach (resultline, results) {
          fieldlist = resultline.split("\t");
-         if (fieldlist.size() < 12)
+         if (fieldlist.size() < 13)
             continue; /* some fields missing, ignore row */
 
          TableItemFormatter jobitem(*mp_tableWidget, row);
@@ -200,6 +201,8 @@ void JobList::populateTable()
          /* fileset */
          jobitem.setTextFld(col++, fld.next());
 
+         /* pool name */
+         jobitem.setTextFld(col++, fld.next());
          row++;
       }
    } 
@@ -257,6 +260,9 @@ void JobList::prepareFilterWidgets()
       fileSetComboBox->addItems(m_console->fileset_list);
       comboSel(fileSetComboBox, m_filesetName);
 
+      poolComboBox->addItem(tr("Any"));
+      poolComboBox->addItems(m_console->pool_list);
+
       jobStatusComboFill(statusComboBox);
    }
 }
@@ -274,10 +280,12 @@ void JobList::fillQueryString(QString &query)
             " Job.Starttime AS JobStart, Job.Type AS JobType,"
             " Job.Level AS BackupLevel, Job.Jobfiles AS FileCount,"
             " Job.JobBytes AS Bytes, Job.JobStatus AS Status,"
-            " Job.PurgedFiles AS Purged, FileSet.FileSet"
+            " Job.PurgedFiles AS Purged, FileSet.FileSet,"
+            " Pool.Name AS Pool"
             " FROM Job"
             " JOIN Client ON (Client.ClientId=Job.ClientId)"
-            " LEFT OUTER JOIN FileSet ON (FileSet.FileSetId=Job.FileSetId) ";
+            " LEFT OUTER JOIN FileSet ON (FileSet.FileSetId=Job.FileSetId) "
+            " LEFT OUTER JOIN pool ON Job.PoolId = Pool.PoolId ";
    QStringList conditions;
    if (m_mediaName != tr("Any")) {
       query += " LEFT OUTER JOIN JobMedia ON (JobMedia.JobId=Job.JobId) "
@@ -291,6 +299,7 @@ void JobList::fillQueryString(QString &query)
    jobStatusComboCond(conditions, statusComboBox, "Job.JobStatus");
    boolComboCond(conditions, purgedComboBox, "Job.PurgedFiles");
    comboCond(conditions, fileSetComboBox, "FileSet.FileSet");
+   comboCond(conditions, poolComboBox, "Pool.Name");
 
    /* If Limit check box For limit by days is checked  */
    if (daysCheckBox->checkState() == Qt::Checked) {
index ef1899244cd766e64b48e883c69a1daad8f9412e..91df7435410befb5aec18ec816bd4a5848a81cad 100644 (file)
   <widget class="QFrame" name="frame" >
    <property name="geometry" >
     <rect>
-     <x>30</x>
-     <y>170</y>
-     <width>533</width>
-     <height>172</height>
+     <x>20</x>
+     <y>220</y>
+     <width>545</width>
+     <height>154</height>
     </rect>
    </property>
    <property name="maximumSize" >
     <enum>QFrame::Raised</enum>
    </property>
    <layout class="QGridLayout" >
-    <property name="leftMargin" >
-     <number>9</number>
-    </property>
-    <property name="topMargin" >
-     <number>9</number>
-    </property>
-    <property name="rightMargin" >
-     <number>9</number>
-    </property>
-    <property name="bottomMargin" >
-     <number>9</number>
-    </property>
-    <property name="horizontalSpacing" >
-     <number>6</number>
-    </property>
-    <property name="verticalSpacing" >
-     <number>6</number>
-    </property>
-    <item row="0" column="4" >
-     <layout class="QGridLayout" >
+    <item row="0" column="0" >
+     <layout class="QVBoxLayout" >
+      <property name="spacing" >
+       <number>6</number>
+      </property>
       <property name="leftMargin" >
-       <number>0</number>
+       <number>3</number>
       </property>
       <property name="topMargin" >
-       <number>0</number>
+       <number>3</number>
       </property>
       <property name="rightMargin" >
-       <number>0</number>
+       <number>3</number>
       </property>
       <property name="bottomMargin" >
-       <number>0</number>
-      </property>
-      <property name="horizontalSpacing" >
-       <number>6</number>
-      </property>
-      <property name="verticalSpacing" >
-       <number>6</number>
+       <number>3</number>
       </property>
-      <item row="1" 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>75</height>
-         </size>
+      <item>
+       <layout class="QVBoxLayout" >
+        <property name="spacing" >
+         <number>6</number>
         </property>
-       </spacer>
-      </item>
-      <item row="1" column="0" >
-       <layout class="QGridLayout" >
         <property name="leftMargin" >
          <number>3</number>
         </property>
         <property name="bottomMargin" >
          <number>3</number>
         </property>
-        <property name="horizontalSpacing" >
-         <number>3</number>
-        </property>
-        <property name="verticalSpacing" >
-         <number>3</number>
-        </property>
-        <item row="0" column="0" >
-         <widget class="QPushButton" name="refreshButton" >
+        <item>
+         <widget class="QCheckBox" name="limitCheckBox" >
           <property name="text" >
-           <string>Refresh</string>
-          </property>
-          <property name="icon" >
-           <iconset resource="../main.qrc" >:/images/view-refresh.png</iconset>
+           <string>Record Limit</string>
           </property>
          </widget>
         </item>
-        <item row="1" column="0" >
-         <widget class="QPushButton" name="graphButton" >
-          <property name="text" >
-           <string>Graph</string>
+        <item>
+         <widget class="QSpinBox" name="limitSpinBox" >
+          <property name="minimum" >
+           <number>1</number>
           </property>
-          <property name="icon" >
-           <iconset resource="../main.qrc" >:/images/applications-graphics.png</iconset>
+          <property name="maximum" >
+           <number>10000</number>
+          </property>
+          <property name="singleStep" >
+           <number>25</number>
           </property>
          </widget>
         </item>
        </layout>
       </item>
-      <item row="0" column="0" colspan="2" >
+      <item>
        <layout class="QVBoxLayout" >
         <property name="spacing" >
          <number>6</number>
          <number>3</number>
         </property>
         <item>
-         <widget class="QLabel" name="fileSetLabel" >
-          <property name="maximumSize" >
-           <size>
-            <width>16777215</width>
-            <height>20</height>
-           </size>
-          </property>
+         <widget class="QCheckBox" name="daysCheckBox" >
           <property name="text" >
-           <string>FileSet</string>
+           <string>Days Limit</string>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QComboBox" name="fileSetComboBox" />
+         <widget class="QSpinBox" name="daysSpinBox" >
+          <property name="singleStep" >
+           <number>7</number>
+          </property>
+         </widget>
         </item>
        </layout>
       </item>
      </layout>
     </item>
-    <item row="0" column="3" >
+    <item row="0" column="1" >
      <layout class="QVBoxLayout" >
       <property name="spacing" >
        <number>6</number>
          <number>3</number>
         </property>
         <item>
-         <widget class="QLabel" name="statusLabel" >
+         <widget class="QLabel" name="clientsLabel" >
           <property name="text" >
-           <string>Status</string>
+           <string>Clients</string>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QComboBox" name="statusComboBox" />
+         <widget class="QComboBox" name="clientComboBox" />
         </item>
        </layout>
       </item>
          <number>3</number>
         </property>
         <item>
-         <widget class="QLabel" name="purgedLabel" >
+         <widget class="QLabel" name="volumeLabel" >
           <property name="text" >
-           <string>Purged</string>
+           <string>Volume</string>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QComboBox" name="purgedComboBox" />
+         <widget class="QComboBox" name="volumeComboBox" />
         </item>
        </layout>
       </item>
      </layout>
     </item>
-    <item row="0" column="0" >
+    <item row="0" column="2" >
      <layout class="QVBoxLayout" >
       <property name="spacing" >
        <number>6</number>
          <number>3</number>
         </property>
         <item>
-         <widget class="QCheckBox" name="limitCheckBox" >
+         <widget class="QLabel" name="jobLabel" >
           <property name="text" >
-           <string>Record Limit</string>
+           <string>Job</string>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QSpinBox" name="limitSpinBox" >
-          <property name="minimum" >
-           <number>1</number>
-          </property>
-          <property name="maximum" >
-           <number>10000</number>
-          </property>
-          <property name="singleStep" >
-           <number>25</number>
-          </property>
-         </widget>
+         <widget class="QComboBox" name="jobComboBox" />
         </item>
        </layout>
       </item>
          <number>3</number>
         </property>
         <item>
-         <widget class="QCheckBox" name="daysCheckBox" >
+         <widget class="QLabel" name="levelLabel" >
           <property name="text" >
-           <string>Days Limit</string>
+           <string>Level</string>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QSpinBox" name="daysSpinBox" >
-          <property name="singleStep" >
-           <number>7</number>
-          </property>
-         </widget>
+         <widget class="QComboBox" name="levelComboBox" />
         </item>
        </layout>
       </item>
      </layout>
     </item>
-    <item row="0" column="1" >
+    <item row="0" column="3" >
      <layout class="QVBoxLayout" >
       <property name="spacing" >
        <number>6</number>
          <number>3</number>
         </property>
         <item>
-         <widget class="QLabel" name="clientsLabel" >
+         <widget class="QLabel" name="statusLabel" >
           <property name="text" >
-           <string>Clients</string>
+           <string>Status</string>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QComboBox" name="clientComboBox" />
+         <widget class="QComboBox" name="statusComboBox" />
         </item>
        </layout>
       </item>
          <number>3</number>
         </property>
         <item>
-         <widget class="QLabel" name="volumeLabel" >
+         <widget class="QLabel" name="purgedLabel" >
           <property name="text" >
-           <string>Volume</string>
+           <string>Purged</string>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QComboBox" name="volumeComboBox" />
+         <widget class="QComboBox" name="purgedComboBox" />
         </item>
        </layout>
       </item>
      </layout>
     </item>
-    <item row="0" column="2" >
+    <item row="0" column="4" >
      <layout class="QVBoxLayout" >
-      <property name="spacing" >
-       <number>6</number>
-      </property>
-      <property name="leftMargin" >
-       <number>3</number>
-      </property>
-      <property name="topMargin" >
-       <number>3</number>
-      </property>
-      <property name="rightMargin" >
-       <number>3</number>
-      </property>
-      <property name="bottomMargin" >
-       <number>3</number>
-      </property>
       <item>
        <layout class="QVBoxLayout" >
         <property name="spacing" >
          <number>3</number>
         </property>
         <item>
-         <widget class="QLabel" name="jobLabel" >
+         <widget class="QLabel" name="fileSetLabel" >
           <property name="text" >
-           <string>Job</string>
+           <string>FileSet</string>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QComboBox" name="jobComboBox" />
+         <widget class="QComboBox" name="fileSetComboBox" />
         </item>
        </layout>
       </item>
          <number>3</number>
         </property>
         <item>
-         <widget class="QLabel" name="levelLabel" >
+         <widget class="QLabel" name="poolLabel" >
           <property name="text" >
-           <string>Level</string>
+           <string>Pool</string>
           </property>
          </widget>
         </item>
         <item>
-         <widget class="QComboBox" name="levelComboBox" />
+         <widget class="QComboBox" name="poolComboBox" />
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </item>
+    <item row="0" column="5" >
+     <layout class="QVBoxLayout" >
+      <item>
+       <layout class="QGridLayout" >
+        <property name="leftMargin" >
+         <number>3</number>
+        </property>
+        <property name="topMargin" >
+         <number>3</number>
+        </property>
+        <property name="rightMargin" >
+         <number>3</number>
+        </property>
+        <property name="bottomMargin" >
+         <number>3</number>
+        </property>
+        <property name="horizontalSpacing" >
+         <number>3</number>
+        </property>
+        <property name="verticalSpacing" >
+         <number>3</number>
+        </property>
+        <item row="0" column="0" >
+         <widget class="QPushButton" name="refreshButton" >
+          <property name="text" >
+           <string>Refresh</string>
+          </property>
+          <property name="icon" >
+           <iconset resource="../main.qrc" >:/images/view-refresh.png</iconset>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0" >
+         <widget class="QPushButton" name="graphButton" >
+          <property name="text" >
+           <string>Graph</string>
+          </property>
+          <property name="icon" >
+           <iconset resource="../main.qrc" >:/images/applications-graphics.png</iconset>
+          </property>
+         </widget>
         </item>
        </layout>
       </item>
+      <item>
+       <spacer>
+        <property name="orientation" >
+         <enum>Qt::Vertical</enum>
+        </property>
+        <property name="sizeHint" >
+         <size>
+          <width>20</width>
+          <height>40</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
      </layout>
     </item>
    </layout>
index cfb309d958f30e90adea03ca80df3ef0413da7c5..0cd9ae5787b3025000aa6243f157aa2a7274a68b 100644 (file)
@@ -81,7 +81,7 @@
      <x>0</x>
      <y>0</y>
      <width>882</width>
-     <height>22</height>
+     <height>24</height>
     </rect>
    </property>
    <widget class="QMenu" name="menuEdit" >
     <addaction name="actionSave" />
     <addaction name="actionQuit" />
     <addaction name="actionRepopLists" />
+    <addaction name="actionReloadRepop" />
    </widget>
    <addaction name="menuFile" />
    <addaction name="menuEdit" />
     <string>Repop Lists</string>
    </property>
   </action>
+  <action name="actionReloadRepop" >
+   <property name="icon" >
+    <iconset resource="main.qrc" >:/images/mark.png</iconset>
+   </property>
+   <property name="text" >
+    <string>Reload and Repop</string>
+   </property>
+  </action>
  </widget>
  <resources>
   <include location="main.qrc" />
index a1352c742960cb8944970e4cf55bfec931aa8a30..1d5975d7327fbb7695ba502094983d4211e47096 100644 (file)
@@ -265,6 +265,7 @@ void MainWin::connectSignals()
    connect(actionClosePage, SIGNAL(triggered()), this,  SLOT(closePage()));
    connect(actionPreferences, SIGNAL(triggered()), this,  SLOT(setPreferences()));
    connect(actionRepopLists, SIGNAL(triggered()), this,  SLOT(repopLists()));
+   connect(actionReloadRepop, SIGNAL(triggered()), this,  SLOT(reloadRepopLists()));
 }
 
 void MainWin::disconnectSignals()
@@ -291,6 +292,7 @@ void MainWin::disconnectSignals()
    disconnect(actionClosePage, SIGNAL(triggered()), this,  SLOT(closePage()));
    disconnect(actionPreferences, SIGNAL(triggered()), this,  SLOT(setPreferences()));
    disconnect(actionRepopLists, SIGNAL(triggered()), this,  SLOT(repopLists()));
+   disconnect(actionReloadRepop, SIGNAL(triggered()), this,  SLOT(reloadRepopLists()));
 }
 
 /*
@@ -345,10 +347,21 @@ void MainWin::disconnectConsoleSignals(Console *console)
    disconnect(actionSelectFont, SIGNAL(triggered()), console, SLOT(set_font()));
 }
 
+
+/* 
+ * Two functions to respond to menu items to repop lists and execute reload and repopulate
+ * the lists for jobs, clients, filesets .. ..
+ */
 void MainWin::repopLists()
 {
    m_currentConsole->populateLists(false);
 }
+void MainWin::reloadRepopLists()
+{
+   QString cmd = "reload";
+   m_currentConsole->consoleCommand(cmd);
+   m_currentConsole->populateLists(false);
+}
 
 /* 
  * Reimplementation of QWidget closeEvent virtual function   
@@ -357,6 +370,13 @@ void MainWin::closeEvent(QCloseEvent *event)
 {
    m_isClosing = true;
    writeSettings();
+   /* Remove all groups from settings for OpenOnExit so that we can start some of the status windows */
+   foreach(Console *console, m_consoleHash){
+      QSettings settings(console->m_dir->name(), "bat");
+      settings.beginGroup("OpenOnExit");
+      settings.remove("");
+      settings.endGroup();
+   }
    /* close all non console pages, this will call settings in destructors */
    while (m_consoleHash.count() < m_pagehash.count()) {
       foreach(Pages *page, m_pagehash) {
@@ -386,6 +406,7 @@ void MainWin::writeSettings()
    settings.setValue("winPos", pos());
    settings.setValue("state", saveState());
    settings.endGroup();
+
 }
 
 void MainWin::readSettings()
@@ -748,8 +769,6 @@ void MainWin::setPreferences()
    prefs.daysSpinBox->setValue(m_daysLimitVal);
    prefs.checkMessages->setCheckState(m_checkMessages ? Qt::Checked : Qt::Unchecked);
    prefs.checkMessagesSpin->setValue(m_checkMessagesInterval);
-   prefs.refreshStatusDir->setCheckState(m_refreshStatusDir ? Qt::Checked : Qt::Unchecked);
-   prefs.refreshStatusDirSpin->setValue(m_refreshStatusDirInterval);
    prefs.executeLongCheckBox->setCheckState(m_longList ? Qt::Checked : Qt::Unchecked);
    prefs.rtPopDirCheckBox->setCheckState(m_rtPopDirDebug ? Qt::Checked : Qt::Unchecked);
    prefs.rtDirCurICCheckBox->setCheckState(m_rtDirCurICDebug ? Qt::Checked : Qt::Unchecked);
@@ -804,8 +823,6 @@ void prefsDialog::accept()
    mainWin->m_daysLimitVal = this->daysSpinBox->value();
    mainWin->m_checkMessages = this->checkMessages->checkState() == Qt::Checked;
    mainWin->m_checkMessagesInterval = this->checkMessagesSpin->value();
-   mainWin->m_refreshStatusDir = this->refreshStatusDir->checkState() == Qt::Checked;
-   mainWin->m_refreshStatusDirInterval = this->refreshStatusDirSpin->value();
    mainWin->m_longList = this->executeLongCheckBox->checkState() == Qt::Checked;
 
    mainWin->m_rtPopDirDebug = this->rtPopDirCheckBox->checkState() == Qt::Checked;
@@ -849,8 +866,6 @@ void prefsDialog::accept()
    settings.beginGroup("Timers");
    settings.setValue("checkMessages", mainWin->m_checkMessages);
    settings.setValue("checkMessagesInterval", mainWin->m_checkMessagesInterval);
-   settings.setValue("refreshStatusDir", mainWin->m_refreshStatusDir);
-   settings.setValue("refreshStatusDirInterval", mainWin->m_refreshStatusDirInterval);
    settings.endGroup();
    settings.beginGroup("Misc");
    settings.setValue("longList", mainWin->m_longList);
@@ -902,8 +917,6 @@ void MainWin::readPreferences()
    settings.beginGroup("Timers");
    m_checkMessages = settings.value("checkMessages", false).toBool();
    m_checkMessagesInterval = settings.value("checkMessagesInterval", 28).toInt();
-   m_refreshStatusDir = settings.value("refreshStatusDir", false).toBool();
-   m_refreshStatusDirInterval = settings.value("refreshStatusDirInterval", 28).toInt();
    settings.endGroup();
    settings.beginGroup("Misc");
    m_longList = settings.value("longList", false).toBool();
index 21624a352277ae1b825058b2b0e71c11623db104..1d3fab3934a6b2971d762ea9cb8d450532975926 100644 (file)
@@ -87,8 +87,6 @@ public:
    int m_daysLimitVal;
    bool m_checkMessages;
    int m_checkMessagesInterval;
-   bool m_refreshStatusDir;
-   int m_refreshStatusDirInterval;
    bool m_longList;
    bool m_rtPopDirDebug;
    bool m_rtDirCurICDebug;
@@ -128,6 +126,7 @@ public slots:
    void waitEnter();
    void waitExit();
    void repopLists();
+   void reloadRepopLists();
    void popLists();
 
 protected:
index f5f4ddcd8e1f5bf48644fef8f57b84c800777cc7..ca83939a553aee53cf1591802805d5c94db4466f 100644 (file)
@@ -43,7 +43,7 @@
    <item row="1" column="0" >
     <widget class="QTabWidget" name="tabWidget" >
      <property name="currentIndex" >
-      <number>3</number>
+      <number>0</number>
      </property>
      <widget class="QWidget" name="tab" >
       <attribute name="title" >
         </property>
        </widget>
       </widget>
-      <widget class="QGroupBox" name="groupBox_8" >
-       <property name="geometry" >
-        <rect>
-         <x>60</x>
-         <y>200</y>
-         <width>180</width>
-         <height>106</height>
-        </rect>
-       </property>
-       <property name="sizePolicy" >
-        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="title" >
-        <string>Status Dir</string>
-       </property>
-       <widget class="QLabel" name="checkLabel_2" >
-        <property name="geometry" >
-         <rect>
-          <x>11</x>
-          <y>81</y>
-          <width>158</width>
-          <height>16</height>
-         </rect>
-        </property>
-        <property name="text" >
-         <string>Refresh Status Dir Interval</string>
-        </property>
-       </widget>
-       <widget class="QCheckBox" name="refreshStatusDir" >
-        <property name="geometry" >
-         <rect>
-          <x>11</x>
-          <y>25</y>
-          <width>158</width>
-          <height>20</height>
-         </rect>
-        </property>
-        <property name="text" >
-         <string>Refresh Status Dir</string>
-        </property>
-       </widget>
-       <widget class="QSpinBox" name="refreshStatusDirSpin" >
-        <property name="geometry" >
-         <rect>
-          <x>11</x>
-          <y>51</y>
-          <width>158</width>
-          <height>24</height>
-         </rect>
-        </property>
-        <property name="minimum" >
-         <number>15</number>
-        </property>
-        <property name="maximum" >
-         <number>3600</number>
-        </property>
-       </widget>
-      </widget>
      </widget>
      <widget class="QWidget" name="tab_2" >
       <attribute name="title" >
index d1a157318f4fa72da431d9b275173aa78b044285..d19619823e7bb19c718237fcd46524e1b9c63f21 100644 (file)
@@ -1555,7 +1555,6 @@ void restoreTree::restoreButtonPushed()
               " INNER JOIN Job ON (Job.JobId=File.JobId)"
               " WHERE File.PathId=" + QString("%1").arg(pathid) +
               " AND Job.Jobid IN (" + m_checkedJobs + ")"
-              " AND File.FilenameId!=" + QString("%1").arg(m_nullFileNameId) +
               " GROUP BY File.FilenameId"
             ") t1, File "
               " INNER JOIN Filename on (Filename.FilenameId=File.FilenameId)"
index 87d146c8611a437c1afec656bd1504c9197f8b94..a193e777ca1aed2367b0b7ef9ed73e60d70ad405 100644 (file)
@@ -52,10 +52,9 @@ ClientStat::ClientStat(QString &client, QTreeWidgetItem *parentTreeWidgetItem)
    readSettings();
    dockPage();
    m_timer = new QTimer(this);
-   QWidget::connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
-   m_timer->start(mainWin->m_refreshStatusDirInterval*1000);
 
    createConnections();
+   m_timer->start(1000);
    setCurrent();
 }
 
@@ -87,9 +86,8 @@ ClientStat::~ClientStat()
  */
 void ClientStat::populateAll()
 {
-   populateHeader();
    populateTerminated();
-   populateRunning();
+   populateCurrentTab(tabWidget->currentIndex());
 }
 
 /*
@@ -97,10 +95,25 @@ void ClientStat::populateAll()
  */
 void ClientStat::timerTriggered()
 {
-   bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
-   if (((isDocked() && iscurrent) || (!isDocked())) && mainWin->m_refreshStatusDir) {
-      populateAll();
+   double value = timerDisplay->value();
+   value -= 1;
+   if (value == 0) {
+      value = spinBox->value();
+      bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
+      if (((isDocked() && iscurrent) || (!isDocked())) && (checkBox->checkState() == Qt::Checked)) {
+         populateAll();
+      }
    }
+   timerDisplay->display(value);
+}
+
+
+void ClientStat::populateCurrentTab(int index)
+{
+   if (index == 0)
+      populateHeader();
+   if (index == 1)
+      populateRunning();
 }
 
 /*
@@ -217,6 +230,8 @@ void ClientStat::PgSeltreeWidgetClicked()
 void ClientStat::currentStackItem()
 {
    populateAll();
+   timerDisplay->display(spinBox->value());
+
    if (!m_populated) {
       m_populated=true;
    }
@@ -228,8 +243,11 @@ void ClientStat::currentStackItem()
  */
 void ClientStat::createConnections()
 {
-   connect(actionRefresh, SIGNAL(triggered()), this,
-                   SLOT(populateAll()));
+   connect(actionRefresh, SIGNAL(triggered()), this, SLOT(populateAll()));
+   connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(populateCurrentTab(int)));
+   connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
+   terminatedTable->setContextMenuPolicy(Qt::ActionsContextMenu);
+   terminatedTable->addAction(actionRefresh);
 }
 
 /*
@@ -240,6 +258,13 @@ void ClientStat::writeSettings()
    QSettings settings(m_console->m_dir->name(), "bat");
    settings.beginGroup(m_groupText);
    settings.setValue(m_splitText, splitter->saveState());
+   settings.setValue("refreshInterval", spinBox->value());
+   settings.setValue("refreshCheck", checkBox->checkState());
+   settings.endGroup();
+
+   settings.beginGroup("OpenOnExit");
+   QString toWrite = "ClientStatus_" + m_client;
+   settings.setValue(toWrite, 1);
    settings.endGroup();
 }
 
@@ -253,5 +278,9 @@ void ClientStat::readSettings()
    QSettings settings(m_console->m_dir->name(), "bat");
    settings.beginGroup(m_groupText);
    splitter->restoreState(settings.value(m_splitText).toByteArray());
+   spinBox->setValue(settings.value("refreshInterval", 28).toInt());
+   checkBox->setCheckState((Qt::CheckState)settings.value("refreshCheck", Qt::Checked).toInt());
    settings.endGroup();
+
+   timerDisplay->display(spinBox->value());
 }
index ccae6551b5feb29068febf7e6814999c94de34f9..af90f0de48965c9bb9d41a531a4c044f3a835610 100644 (file)
@@ -53,6 +53,7 @@ public slots:
    void populateTerminated();
    void populateRunning();
    void populateAll();
+   void populateCurrentTab(int);
 
 private slots:
    void timerTriggered();
index 57026d968528c4f0d2e71b70d060c65652650972..9862c58e65bef473cd5d4641042913b1cb2695a3 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>618</width>
-    <height>630</height>
+    <width>557</width>
+    <height>350</height>
    </rect>
   </property>
   <property name="windowTitle" >
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
      </property>
-     <widget class="QWidget" name="" >
-      <layout class="QVBoxLayout" >
+     <widget class="QWidget" name="layoutWidget" >
+      <layout class="QHBoxLayout" >
        <item>
-        <widget class="QLabel" name="runningLabel_2" >
-         <property name="layoutDirection" >
-          <enum>Qt::LeftToRight</enum>
-         </property>
-         <property name="text" >
-          <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
-p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:13pt; font-weight:600;">Header&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignCenter</set>
-         </property>
+        <widget class="QTabWidget" name="tabWidget" >
+         <property name="currentIndex" >
+          <number>0</number>
+         </property>
+         <widget class="QWidget" name="tab" >
+          <attribute name="title" >
+           <string>Header</string>
+          </attribute>
+          <layout class="QGridLayout" >
+           <item row="0" column="0" >
+            <widget class="QTextEdit" name="textEditHeader" >
+             <property name="sizePolicy" >
+              <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+               <horstretch>200</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="minimumSize" >
+              <size>
+               <width>0</width>
+               <height>0</height>
+              </size>
+             </property>
+             <property name="maximumSize" >
+              <size>
+               <width>16777215</width>
+               <height>16777215</height>
+              </size>
+             </property>
+             <property name="sizeIncrement" >
+              <size>
+               <width>1</width>
+               <height>0</height>
+              </size>
+             </property>
+             <property name="focusPolicy" >
+              <enum>Qt::StrongFocus</enum>
+             </property>
+             <property name="acceptDrops" >
+              <bool>false</bool>
+             </property>
+             <property name="toolTip" >
+              <string comment="Joblog Window" />
+             </property>
+             <property name="statusTip" >
+              <string comment="Joblog Window" />
+             </property>
+             <property name="whatsThis" >
+              <string comment="Joblog Window" />
+             </property>
+             <property name="horizontalScrollBarPolicy" >
+              <enum>Qt::ScrollBarAsNeeded</enum>
+             </property>
+             <property name="autoFormatting" >
+              <set>QTextEdit::AutoNone</set>
+             </property>
+             <property name="tabChangesFocus" >
+              <bool>false</bool>
+             </property>
+             <property name="documentTitle" >
+              <string comment="Joblog Window" />
+             </property>
+             <property name="lineWrapMode" >
+              <enum>QTextEdit::NoWrap</enum>
+             </property>
+             <property name="readOnly" >
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="tab_2" >
+          <attribute name="title" >
+           <string>Running</string>
+          </attribute>
+          <layout class="QGridLayout" >
+           <item row="0" column="0" >
+            <widget class="QTextEdit" name="textEditRunning" />
+           </item>
+          </layout>
+         </widget>
         </widget>
        </item>
        <item>
-        <widget class="QTextEdit" name="textEditHeader" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
-           <horstretch>200</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
+        <widget class="QGroupBox" name="groupBox" >
          <property name="minimumSize" >
           <size>
-           <width>0</width>
+           <width>141</width>
            <height>0</height>
           </size>
          </property>
          <property name="maximumSize" >
           <size>
-           <width>16777215</width>
+           <width>141</width>
            <height>16777215</height>
           </size>
          </property>
-         <property name="sizeIncrement" >
-          <size>
-           <width>1</width>
-           <height>0</height>
-          </size>
-         </property>
-         <property name="focusPolicy" >
-          <enum>Qt::StrongFocus</enum>
-         </property>
-         <property name="acceptDrops" >
-          <bool>false</bool>
-         </property>
-         <property name="toolTip" >
-          <string comment="Joblog Window" />
-         </property>
-         <property name="statusTip" >
-          <string comment="Joblog Window" />
-         </property>
-         <property name="whatsThis" >
-          <string comment="Joblog Window" />
-         </property>
-         <property name="horizontalScrollBarPolicy" >
-          <enum>Qt::ScrollBarAsNeeded</enum>
-         </property>
-         <property name="autoFormatting" >
-          <set>QTextEdit::AutoNone</set>
-         </property>
-         <property name="tabChangesFocus" >
-          <bool>false</bool>
-         </property>
-         <property name="documentTitle" >
-          <string comment="Joblog Window" />
-         </property>
-         <property name="lineWrapMode" >
-          <enum>QTextEdit::NoWrap</enum>
-         </property>
-         <property name="readOnly" >
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="" >
-      <layout class="QGridLayout" >
-       <item row="0" column="0" >
-        <widget class="QLabel" name="runningLabel" >
-         <property name="layoutDirection" >
-          <enum>Qt::LeftToRight</enum>
-         </property>
-         <property name="text" >
-          <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
-p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-&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:13pt; font-weight:600;">Running&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
-         </property>
-         <property name="alignment" >
-          <set>Qt::AlignCenter</set>
-         </property>
+         <property name="title" >
+          <string>Refresh Timer</string>
+         </property>
+         <widget class="QSpinBox" name="spinBox" >
+          <property name="geometry" >
+           <rect>
+            <x>20</x>
+            <y>50</y>
+            <width>111</width>
+            <height>24</height>
+           </rect>
+          </property>
+          <property name="minimum" >
+           <number>5</number>
+          </property>
+          <property name="maximum" >
+           <number>999</number>
+          </property>
+         </widget>
+         <widget class="QCheckBox" name="checkBox" >
+          <property name="geometry" >
+           <rect>
+            <x>20</x>
+            <y>20</y>
+            <width>101</width>
+            <height>20</height>
+           </rect>
+          </property>
+          <property name="text" >
+           <string>Do Refresh</string>
+          </property>
+         </widget>
+         <widget class="QLCDNumber" name="timerDisplay" >
+          <property name="geometry" >
+           <rect>
+            <x>20</x>
+            <y>80</y>
+            <width>101</width>
+            <height>31</height>
+           </rect>
+          </property>
+         </widget>
         </widget>
        </item>
-       <item row="1" column="0" >
-        <widget class="QTextEdit" name="textEditRunning" />
-       </item>
       </layout>
      </widget>
-     <widget class="QWidget" name="" >
+     <widget class="QWidget" name="layoutWidget" >
       <layout class="QGridLayout" >
        <item row="0" column="0" >
         <widget class="QLabel" name="terminatedLabel" >
index 03efffdf7ea80d58227595574c161dc0c4697ad7..400eb23bdc99db225d061eaa9e684216400d641d 100644 (file)
@@ -49,11 +49,10 @@ DirStat::DirStat()
    thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/status.png")));
    m_cursor = new QTextCursor(textEdit->document());
 
+   m_timer = new QTimer(this);
    readSettings();
    dockPage();
-   m_timer = new QTimer(this);
-   QWidget::connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
-   m_timer->start(mainWin->m_refreshStatusDirInterval*1000);
+   m_timer->start(1000);
 
    createConnections();
    setCurrent();
@@ -98,10 +97,16 @@ void DirStat::populateAll()
  */
 void DirStat::timerTriggered()
 {
-   bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
-   if (((isDocked() && iscurrent) || (!isDocked())) && mainWin->m_refreshStatusDir) {
-      populateAll();
+   double value = timerDisplay->value();
+   value -= 1;
+   if (value == 0) {
+      value = spinBox->value();
+      bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
+      if (((isDocked() && iscurrent) || (!isDocked())) && (checkBox->checkState() == Qt::Checked)) {
+         populateAll();
+      }
    }
+   timerDisplay->display(value);
 }
 
 /*
@@ -290,6 +295,7 @@ void DirStat::PgSeltreeWidgetClicked()
 void DirStat::currentStackItem()
 {
    populateAll();
+   timerDisplay->display(spinBox->value());
    if (!m_populated) {
       m_populated=true;
    }
@@ -301,12 +307,10 @@ void DirStat::currentStackItem()
  */
 void DirStat::createConnections()
 {
-   connect(actionRefresh, SIGNAL(triggered()), this,
-                   SLOT(populateAll()));
-   connect(actionCancelRunning, SIGNAL(triggered()), this,
-                   SLOT(consoleCancelJob()));
-   connect(actionDisableScheduledJob, SIGNAL(triggered()), this,
-                   SLOT(consoleDisableJob()));
+   connect(actionRefresh, SIGNAL(triggered()), this, SLOT(populateAll()));
+   connect(actionCancelRunning, SIGNAL(triggered()), this, SLOT(consoleCancelJob()));
+   connect(actionDisableScheduledJob, SIGNAL(triggered()), this, SLOT(consoleDisableJob()));
+   connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
 
    scheduledTable->setContextMenuPolicy(Qt::ActionsContextMenu);
    scheduledTable->addAction(actionRefresh);
@@ -326,6 +330,8 @@ void DirStat::writeSettings()
    QSettings settings(m_console->m_dir->name(), "bat");
    settings.beginGroup(m_groupText);
    settings.setValue(m_splitText, splitter->saveState());
+   settings.setValue("refreshInterval", spinBox->value());
+   settings.setValue("refreshCheck", checkBox->checkState());
    settings.endGroup();
 }
 
@@ -339,7 +345,11 @@ void DirStat::readSettings()
    QSettings settings(m_console->m_dir->name(), "bat");
    settings.beginGroup(m_groupText);
    splitter->restoreState(settings.value(m_splitText).toByteArray());
+   spinBox->setValue(settings.value("refreshInterval", 28).toInt());
+   checkBox->setCheckState((Qt::CheckState)settings.value("refreshCheck", Qt::Checked).toInt());
    settings.endGroup();
+
+   timerDisplay->display(spinBox->value());
 }
 
 /*
index edc065728827618a70f09421b0d971efdab59fb2..41a4b40d607a4da2e164141f7c7a99ef39df89bb 100644 (file)
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>409</width>
-    <height>326</height>
+    <width>514</width>
+    <height>425</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>Form</string>
   </property>
   <layout class="QGridLayout" >
-   <property name="leftMargin" >
-    <number>9</number>
-   </property>
-   <property name="topMargin" >
-    <number>9</number>
-   </property>
-   <property name="rightMargin" >
-    <number>9</number>
-   </property>
-   <property name="bottomMargin" >
-    <number>9</number>
-   </property>
-   <property name="horizontalSpacing" >
-    <number>6</number>
-   </property>
-   <property name="verticalSpacing" >
-    <number>6</number>
-   </property>
    <item row="0" column="0" >
     <widget class="QSplitter" name="splitter" >
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
      </property>
-     <widget class="QTextEdit" name="textEdit" >
-      <property name="sizePolicy" >
-       <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
-        <horstretch>200</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
-      </property>
-      <property name="minimumSize" >
-       <size>
-        <width>0</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="maximumSize" >
-       <size>
-        <width>16777215</width>
-        <height>100</height>
-       </size>
-      </property>
-      <property name="sizeIncrement" >
-       <size>
-        <width>1</width>
-        <height>0</height>
-       </size>
-      </property>
-      <property name="focusPolicy" >
-       <enum>Qt::StrongFocus</enum>
-      </property>
-      <property name="acceptDrops" >
-       <bool>false</bool>
-      </property>
-      <property name="toolTip" >
-       <string comment="Joblog Window" />
-      </property>
-      <property name="statusTip" >
-       <string comment="Joblog Window" />
-      </property>
-      <property name="whatsThis" >
-       <string comment="Joblog Window" />
-      </property>
-      <property name="horizontalScrollBarPolicy" >
-       <enum>Qt::ScrollBarAsNeeded</enum>
-      </property>
-      <property name="autoFormatting" >
-       <set>QTextEdit::AutoNone</set>
-      </property>
-      <property name="tabChangesFocus" >
-       <bool>false</bool>
-      </property>
-      <property name="documentTitle" >
-       <string comment="Joblog Window" />
-      </property>
-      <property name="lineWrapMode" >
-       <enum>QTextEdit::NoWrap</enum>
-      </property>
-      <property name="readOnly" >
-       <bool>true</bool>
-      </property>
+     <widget class="QWidget" name="" >
+      <layout class="QHBoxLayout" >
+       <item>
+        <widget class="QTextEdit" name="textEdit" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize" >
+          <size>
+           <width>0</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="maximumSize" >
+          <size>
+           <width>16777215</width>
+           <height>100</height>
+          </size>
+         </property>
+         <property name="sizeIncrement" >
+          <size>
+           <width>1</width>
+           <height>0</height>
+          </size>
+         </property>
+         <property name="focusPolicy" >
+          <enum>Qt::StrongFocus</enum>
+         </property>
+         <property name="acceptDrops" >
+          <bool>false</bool>
+         </property>
+         <property name="toolTip" >
+          <string comment="Joblog Window" />
+         </property>
+         <property name="statusTip" >
+          <string comment="Joblog Window" />
+         </property>
+         <property name="whatsThis" >
+          <string comment="Joblog Window" />
+         </property>
+         <property name="horizontalScrollBarPolicy" >
+          <enum>Qt::ScrollBarAsNeeded</enum>
+         </property>
+         <property name="autoFormatting" >
+          <set>QTextEdit::AutoNone</set>
+         </property>
+         <property name="tabChangesFocus" >
+          <bool>false</bool>
+         </property>
+         <property name="documentTitle" >
+          <string comment="Joblog Window" />
+         </property>
+         <property name="lineWrapMode" >
+          <enum>QTextEdit::NoWrap</enum>
+         </property>
+         <property name="readOnly" >
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="groupBox" >
+         <property name="sizePolicy" >
+          <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="minimumSize" >
+          <size>
+           <width>221</width>
+           <height>100</height>
+          </size>
+         </property>
+         <property name="maximumSize" >
+          <size>
+           <width>221</width>
+           <height>100</height>
+          </size>
+         </property>
+         <property name="title" >
+          <string>Refresh Timer</string>
+         </property>
+         <widget class="QSpinBox" name="spinBox" >
+          <property name="geometry" >
+           <rect>
+            <x>20</x>
+            <y>60</y>
+            <width>111</width>
+            <height>24</height>
+           </rect>
+          </property>
+          <property name="minimum" >
+           <number>5</number>
+          </property>
+          <property name="maximum" >
+           <number>999</number>
+          </property>
+         </widget>
+         <widget class="QCheckBox" name="checkBox" >
+          <property name="geometry" >
+           <rect>
+            <x>20</x>
+            <y>20</y>
+            <width>101</width>
+            <height>20</height>
+           </rect>
+          </property>
+          <property name="text" >
+           <string>Do Refresh</string>
+          </property>
+         </widget>
+         <widget class="QLCDNumber" name="timerDisplay" >
+          <property name="geometry" >
+           <rect>
+            <x>110</x>
+            <y>20</y>
+            <width>101</width>
+            <height>31</height>
+           </rect>
+          </property>
+         </widget>
+        </widget>
+       </item>
+      </layout>
      </widget>
      <widget class="QWidget" name="dirstatlayoutWidget" >
       <layout class="QVBoxLayout" >
index 7a148e9bd2684d278468cc58cd57efabbf16fc0d..4925778a0f8da4211093c66c0fb7fc0308794294 100644 (file)
@@ -36,6 +36,7 @@
 #include <QTableWidgetItem>
 #include "storstat.h"
 #include "mount/mount.h"
+#include "label/label.h"
 
 /*
 .status storage=<storage-name> <keyword>
@@ -67,9 +68,9 @@ StorStat::StorStat(QString &storage, QTreeWidgetItem *parentTreeWidgetItem)
    m_timer = new QTimer(this);
    readSettings();
    dockPage();
-   QWidget::connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
 
    createConnections();
+   m_timer->start(1000);
    setCurrent();
 }
 
@@ -110,10 +111,16 @@ void StorStat::populateAll()
  */
 void StorStat::timerTriggered()
 {
-   bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
-   if (((isDocked() && iscurrent) || (!isDocked())) && (checkBox->checkState() == Qt::Checked)) {
-      populateAll();
+   double value = timerDisplay->value();
+   value -= 1;
+   if (value == 0) {
+      value = spinBox->value();
+      bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
+      if (((isDocked() && iscurrent) || (!isDocked())) && (checkBox->checkState() == Qt::Checked)) {
+         populateAll();
+      }
    }
+   timerDisplay->display(value);
 }
 
 /*
@@ -291,6 +298,7 @@ void StorStat::PgSeltreeWidgetClicked()
 void StorStat::currentStackItem()
 {
    populateAll();
+   timerDisplay->display(spinBox->value());
    if (!m_populated) {
       m_populated=true;
    }
@@ -302,16 +310,15 @@ void StorStat::currentStackItem()
  */
 void StorStat::createConnections()
 {
-   connect(actionRefresh, SIGNAL(triggered()), this,
-                   SLOT(populateAll()));
-   connect(tabWidget, SIGNAL(currentChanged(int)), this,
-                   SLOT(populateCurrentTab(int)));
-   connect(spinBox, SIGNAL(valueChanged(int)), this,
-                   SLOT(spinBoxValueChanged(int)));
+   connect(actionRefresh, SIGNAL(triggered()), this, SLOT(populateAll()));
+   connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(populateCurrentTab(int)));
    connect(mountButton, SIGNAL(pressed()), this, SLOT(mountButtonPushed()));
    connect(umountButton, SIGNAL(pressed()), this, SLOT(umountButtonPushed()));
+   connect(labelButton, SIGNAL(pressed()), this, SLOT(labelButtonPushed()));
+   connect(releaseButton, SIGNAL(pressed()), this, SLOT(releaseButtonPushed()));
    terminatedTable->setContextMenuPolicy(Qt::ActionsContextMenu);
    terminatedTable->addAction(actionRefresh);
+   connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
 }
 
 /*
@@ -325,6 +332,11 @@ void StorStat::writeSettings()
    settings.setValue("refreshInterval", spinBox->value());
    settings.setValue("refreshCheck", checkBox->checkState());
    settings.endGroup();
+
+   settings.beginGroup("OpenOnExit");
+   QString toWrite = "StorageStatus_" + m_storage;
+   settings.setValue(toWrite, 1);
+   settings.endGroup();
 }
 
 /*
@@ -341,7 +353,7 @@ void StorStat::readSettings()
    checkBox->setCheckState((Qt::CheckState)settings.value("refreshCheck", Qt::Checked).toInt());
    settings.endGroup();
 
-   m_timer->start(spinBox->value()*1000);
+   timerDisplay->display(spinBox->value());
 }
 
 /*
@@ -363,14 +375,6 @@ void StorStat::populateCurrentTab(int index)
       populateRunning();
 }
 
-/*
- * Set the timer when changed
- */
-void StorStat::spinBoxValueChanged(int newval)
-{
-   m_timer->setInterval(newval*1000);
-}
-
 /*
  * execute mount in console
  */
@@ -428,3 +432,17 @@ void StorStat::umountButtonPushed()
    QString cmd("umount storage=" + m_storage);
    consoleCommand(cmd);
 }
+
+/* Release a tape in the drive */
+void StorStat::releaseButtonPushed()
+{
+   QString cmd("release storage=");
+   cmd += m_storage;
+   consoleCommand(cmd);
+}
+
+/* Label Media populating current storage by default */
+void StorStat::labelButtonPushed()
+{
+   new labelPage(m_storage);
+}  
index 8648d39a5e7df08fd48816d19e1ec29038623a87..7eb846a5ac4ebfadf31f81548723f0b500e67340 100644 (file)
@@ -60,10 +60,11 @@ public slots:
 
 private slots:
    void timerTriggered();
-   void spinBoxValueChanged(int);
    void populateCurrentTab(int);
    void mountButtonPushed();
    void umountButtonPushed();
+   void releaseButtonPushed();
+   void labelButtonPushed();
 
 private:
    void createConnections();
index fd1960e20c8679df4ce6c73ca5a791f75fe755b9..36a1049f47515d6dede9015adc188b4eef9a5e88 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>367</width>
-    <height>310</height>
+    <width>694</width>
+    <height>393</height>
    </rect>
   </property>
   <property name="windowTitle" >
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
      </property>
-     <widget class="QTabWidget" name="tabWidget" >
-      <property name="currentIndex" >
-       <number>0</number>
-      </property>
-      <widget class="QWidget" name="headerTab" >
-       <attribute name="title" >
-        <string>Header</string>
-       </attribute>
-       <layout class="QGridLayout" >
-        <item row="0" column="0" >
-         <widget class="QTextEdit" name="textEditHeader" />
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="waitReservationTab" >
-       <attribute name="title" >
-        <string>Waitreservation</string>
-       </attribute>
-       <layout class="QGridLayout" >
-        <item row="0" column="0" >
-         <widget class="QTextEdit" name="textEditWaitReservation" />
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="devicesTab" >
-       <attribute name="title" >
-        <string>Devices</string>
-       </attribute>
-       <layout class="QGridLayout" >
-        <item row="0" column="0" >
-         <widget class="QTextEdit" name="textEditDevices" />
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="volumesTab" >
-       <attribute name="title" >
-        <string>Volumes</string>
-       </attribute>
-       <layout class="QGridLayout" >
-        <item row="0" column="0" >
-         <widget class="QTextEdit" name="textEditVolumes" />
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="spoolingTab" >
-       <attribute name="title" >
-        <string>Spooling</string>
-       </attribute>
-       <layout class="QGridLayout" >
-        <item row="0" column="0" >
-         <widget class="QTextEdit" name="textEditSpooling" />
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="runningTab" >
-       <attribute name="title" >
-        <string>Running</string>
-       </attribute>
-       <layout class="QGridLayout" >
-        <item row="0" column="0" >
-         <widget class="QTextEdit" name="textEditRunning" />
-        </item>
-       </layout>
-      </widget>
-      <widget class="QWidget" name="tab" >
-       <attribute name="title" >
-        <string>Misc</string>
-       </attribute>
-       <widget class="QPushButton" name="mountButton" >
-        <property name="geometry" >
-         <rect>
-          <x>170</x>
-          <y>40</y>
-          <width>80</width>
-          <height>24</height>
-         </rect>
-        </property>
-        <property name="text" >
-         <string>Mount</string>
-        </property>
-       </widget>
-       <widget class="QPushButton" name="umountButton" >
-        <property name="geometry" >
-         <rect>
-          <x>170</x>
-          <y>70</y>
-          <width>80</width>
-          <height>24</height>
-         </rect>
-        </property>
-        <property name="text" >
-         <string>UMount</string>
-        </property>
-       </widget>
-       <widget class="QGroupBox" name="groupBox" >
-        <property name="geometry" >
-         <rect>
-          <x>10</x>
-          <y>10</y>
-          <width>151</width>
-          <height>91</height>
-         </rect>
-        </property>
-        <property name="title" >
-         <string>Refresh Timer Top</string>
-        </property>
-        <widget class="QSpinBox" name="spinBox" >
-         <property name="geometry" >
-          <rect>
-           <x>20</x>
-           <y>50</y>
-           <width>111</width>
-           <height>24</height>
-          </rect>
-         </property>
-         <property name="minimum" >
-          <number>5</number>
-         </property>
-         <property name="maximum" >
-          <number>999</number>
+     <widget class="QWidget" name="layoutWidget" >
+      <layout class="QHBoxLayout" >
+       <item>
+        <widget class="QTabWidget" name="tabWidget" >
+         <property name="currentIndex" >
+          <number>6</number>
          </property>
+         <widget class="QWidget" name="headerTab" >
+          <attribute name="title" >
+           <string>Header</string>
+          </attribute>
+          <layout class="QGridLayout" >
+           <item row="0" column="0" >
+            <widget class="QTextEdit" name="textEditHeader" />
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="waitReservationTab" >
+          <attribute name="title" >
+           <string>Waitreservation</string>
+          </attribute>
+          <layout class="QGridLayout" >
+           <item row="0" column="0" >
+            <widget class="QTextEdit" name="textEditWaitReservation" />
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="devicesTab" >
+          <attribute name="title" >
+           <string>Devices</string>
+          </attribute>
+          <layout class="QGridLayout" >
+           <item row="0" column="0" >
+            <widget class="QTextEdit" name="textEditDevices" />
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="volumesTab" >
+          <attribute name="title" >
+           <string>Volumes</string>
+          </attribute>
+          <layout class="QGridLayout" >
+           <item row="0" column="0" >
+            <widget class="QTextEdit" name="textEditVolumes" />
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="spoolingTab" >
+          <attribute name="title" >
+           <string>Spooling</string>
+          </attribute>
+          <layout class="QGridLayout" >
+           <item row="0" column="0" >
+            <widget class="QTextEdit" name="textEditSpooling" />
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="runningTab" >
+          <attribute name="title" >
+           <string>Running</string>
+          </attribute>
+          <layout class="QGridLayout" >
+           <item row="0" column="0" >
+            <widget class="QTextEdit" name="textEditRunning" />
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="tab" >
+          <attribute name="title" >
+           <string>Misc</string>
+          </attribute>
+          <widget class="QWidget" name="" >
+           <property name="geometry" >
+            <rect>
+             <x>10</x>
+             <y>10</y>
+             <width>168</width>
+             <height>60</height>
+            </rect>
+           </property>
+           <layout class="QGridLayout" >
+            <item row="0" column="0" >
+             <widget class="QPushButton" name="mountButton" >
+              <property name="text" >
+               <string>Mount</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1" >
+             <widget class="QPushButton" name="umountButton" >
+              <property name="text" >
+               <string>UMount</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="0" >
+             <widget class="QPushButton" name="labelButton" >
+              <property name="text" >
+               <string>Label</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="1" >
+             <widget class="QPushButton" name="releaseButton" >
+              <property name="text" >
+               <string>Release</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </widget>
+         </widget>
         </widget>
-        <widget class="QCheckBox" name="checkBox" >
-         <property name="geometry" >
-          <rect>
-           <x>20</x>
-           <y>20</y>
-           <width>101</width>
-           <height>20</height>
-          </rect>
+       </item>
+       <item>
+        <widget class="QGroupBox" name="groupBox" >
+         <property name="minimumSize" >
+          <size>
+           <width>141</width>
+           <height>0</height>
+          </size>
          </property>
-         <property name="text" >
-          <string>Do Refresh</string>
+         <property name="maximumSize" >
+          <size>
+           <width>141</width>
+           <height>16777215</height>
+          </size>
+         </property>
+         <property name="title" >
+          <string>Refresh Timer</string>
          </property>
+         <widget class="QSpinBox" name="spinBox" >
+          <property name="geometry" >
+           <rect>
+            <x>20</x>
+            <y>50</y>
+            <width>111</width>
+            <height>24</height>
+           </rect>
+          </property>
+          <property name="minimum" >
+           <number>5</number>
+          </property>
+          <property name="maximum" >
+           <number>999</number>
+          </property>
+         </widget>
+         <widget class="QCheckBox" name="checkBox" >
+          <property name="geometry" >
+           <rect>
+            <x>20</x>
+            <y>20</y>
+            <width>101</width>
+            <height>20</height>
+           </rect>
+          </property>
+          <property name="text" >
+           <string>Do Refresh</string>
+          </property>
+         </widget>
+         <widget class="QLCDNumber" name="timerDisplay" >
+          <property name="geometry" >
+           <rect>
+            <x>20</x>
+            <y>80</y>
+            <width>101</width>
+            <height>31</height>
+           </rect>
+          </property>
+         </widget>
         </widget>
-       </widget>
-      </widget>
+       </item>
+      </layout>
      </widget>
      <widget class="QWidget" name="layoutWidget" >
       <layout class="QVBoxLayout" >
index 8484ae12d66ae71a802a6b4dd3d75bfd4cc3b7d6..d76c8e9e0708019752a4169759b206a14aa7ffeb 100644 (file)
@@ -53,6 +53,7 @@ Storage::Storage()
 
    /* mp_treeWidget, Storage Tree Tree Widget inherited from ui_storage.h */
    m_populated = false;
+   m_firstpopulation = true;
    m_checkcurwidget = true;
    m_closeable = false;
    m_currentStorage = "";
@@ -132,6 +133,10 @@ void Storage::populateTree()
          foreach (QString resultline, results) {
             fieldlist = resultline.split("\t");
             storageName = fieldlist.takeFirst();
+            if (m_firstpopulation) {
+               m_firstpopulation = false;
+               settingsOpenStatus(storageName);
+            }
             TreeItemFormatter storageItem(*m_topItem, 1);
             storageItem.setTextFld(0, storageName);
             if(settings.contains(storageName))
@@ -404,8 +409,20 @@ void Storage::consoleRelease()
  */
 void Storage::statusStorageWindow()
 {
-   QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
-   new StorStat(m_currentStorage, parentItem);
+   /* if one exists, then just set it current */
+   bool found = false;
+   foreach(Pages *page, mainWin->m_pagehash) {
+      if (mainWin->currentConsole() == page->console()) {
+         if (page->name() == tr("Storage Status %1").arg(m_currentStorage)) {
+            found = true;
+            page->setCurrent();
+         }
+      }
+   }
+   if (!found) {
+      QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
+      new StorStat(m_currentStorage, parentItem);
+   }
 }
 
 /*
@@ -422,3 +439,24 @@ void Storage::writeExpandedSettings()
    }
    settings.endGroup();
 }
+
+/*
+ * If first time, then check to see if there were status pages open the last time closed
+ * if so open
+ */
+void Storage::settingsOpenStatus(QString &storage)
+{
+   QSettings settings(m_console->m_dir->name(), "bat");
+
+   settings.beginGroup("OpenOnExit");
+   QString toRead = "StorageStatus_" + storage;
+   if (settings.value(toRead) == 1) {
+      Pmsg1(000, "Do open Storage Status window for : %s\n", storage.toUtf8().data());
+      new StorStat(storage, mainWin->getFromHash(this));
+      setCurrent();
+      mainWin->getFromHash(this)->setExpanded(true);
+   } else {
+      Pmsg1(000, "Do NOT open Storage Status window for : %s\n", storage.toUtf8().data());
+   }
+   settings.endGroup();
+}
index 3e778f12bb76e4cb4257e51afed424f9beb8495d..8f3f416d5aa9ba423ca0f5751b19b226ac2dc8ae 100644 (file)
@@ -65,9 +65,11 @@ private slots:
 private:
    void createContextMenu();
    void mediaList(QTreeWidgetItem *parent, const QString &storageID);
+   void settingsOpenStatus(QString& storage);
    QString m_currentStorage;
    bool m_currentAutoChanger;
    bool m_populated;
+   bool m_firstpopulation;
    bool m_checkcurwidget;
    void writeExpandedSettings();
    QTreeWidgetItem *m_topItem;