]> git.sur5r.net Git - bacula/bacula/commitdiff
Add preference to have the status dir screen auto refresh.
authorDirk H Bartley <dbartley@schupan.com>
Tue, 19 Feb 2008 20:28:13 +0000 (20:28 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Tue, 19 Feb 2008 20:28:13 +0000 (20:28 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6447 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/mainwin.cpp
bacula/src/qt-console/mainwin.h
bacula/src/qt-console/prefs.ui
bacula/src/qt-console/status/dirstat.cpp
bacula/src/qt-console/status/dirstat.h

index 20335059c6f0a3cc3d1506c530b795fa8694dac5..0465ac3cd9f88afed8c9ced0e9651daedc4cb3fb 100644 (file)
@@ -646,6 +646,8 @@ 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);
@@ -693,6 +695,8 @@ 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;
@@ -732,9 +736,11 @@ void prefsDialog::accept()
    settings.setValue("daysLimitCheck", mainWin->m_daysLimitCheck);
    settings.setValue("daysLimitVal", mainWin->m_daysLimitVal);
    settings.endGroup();
-   settings.beginGroup("Messages");
+   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);
@@ -785,9 +791,11 @@ void MainWin::readPreferences()
    m_daysLimitCheck = settings.value("daysLimitCheck", false).toBool();
    m_daysLimitVal = settings.value("daysLimitVal", 28).toInt();
    settings.endGroup();
-   settings.beginGroup("Messages");
+   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 911c964202fc1f85b44c615f588531bc844ce6b0..d96b5885c8483c01c6cd4ae24ee0d8f711e74879 100644 (file)
@@ -86,6 +86,8 @@ 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;
index 9f2e0aee19e4973bf968bfb418066309b63a9258..a0b0bc2aa9589940c55a93be535d92bd83211338 100644 (file)
@@ -5,14 +5,12 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>435</width>
-    <height>499</height>
+    <width>470</width>
+    <height>533</height>
    </rect>
   </property>
   <property name="sizePolicy" >
-   <sizepolicy>
-    <hsizetype>0</hsizetype>
-    <vsizetype>0</vsizetype>
+   <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
    <iconset>images/bat.png</iconset>
   </property>
   <layout class="QGridLayout" >
-   <property name="margin" >
+   <property name="leftMargin" >
     <number>9</number>
    </property>
-   <property name="spacing" >
+   <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="1" column="0" >
     <widget class="QTabWidget" name="tabWidget" >
      <property name="currentIndex" >
-      <number>2</number>
+      <number>0</number>
      </property>
      <widget class="QWidget" name="tab" >
       <attribute name="title" >
-       <string>Messages</string>
+       <string>Timers</string>
       </attribute>
-      <layout class="QGridLayout" >
-       <property name="margin" >
-        <number>9</number>
+      <widget class="QGroupBox" name="groupBox" >
+       <property name="geometry" >
+        <rect>
+         <x>60</x>
+         <y>60</y>
+         <width>180</width>
+         <height>106</height>
+        </rect>
        </property>
-       <property name="spacing" >
-        <number>6</number>
+       <property name="sizePolicy" >
+        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
        </property>
-       <item row="0" column="0" >
-        <widget class="QGroupBox" name="groupBox" >
-         <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>0</hsizetype>
-           <vsizetype>0</vsizetype>
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="title" >
-          <string>Messages Options</string>
-         </property>
-         <layout class="QGridLayout" >
-          <property name="margin" >
-           <number>9</number>
-          </property>
-          <property name="spacing" >
-           <number>6</number>
-          </property>
-          <item row="2" column="0" >
-           <widget class="QLabel" name="checkLabel" >
-            <property name="text" >
-             <string>Message check interval in seconds</string>
-            </property>
-           </widget>
-          </item>
-          <item row="0" column="0" >
-           <widget class="QCheckBox" name="checkMessages" >
-            <property name="text" >
-             <string>Check Messages</string>
-            </property>
-           </widget>
-          </item>
-          <item row="1" column="0" >
-           <widget class="QSpinBox" name="checkMessagesSpin" >
-            <property name="maximum" >
-             <number>3600</number>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-       </item>
-      </layout>
+       <property name="title" >
+        <string>Messages Options</string>
+       </property>
+       <widget class="QLabel" name="checkLabel" >
+        <property name="geometry" >
+         <rect>
+          <x>11</x>
+          <y>81</y>
+          <width>158</width>
+          <height>16</height>
+         </rect>
+        </property>
+        <property name="text" >
+         <string>Message check interval in seconds</string>
+        </property>
+       </widget>
+       <widget class="QCheckBox" name="checkMessages" >
+        <property name="geometry" >
+         <rect>
+          <x>11</x>
+          <y>25</y>
+          <width>158</width>
+          <height>20</height>
+         </rect>
+        </property>
+        <property name="text" >
+         <string>Check Messages</string>
+        </property>
+       </widget>
+       <widget class="QSpinBox" name="checkMessagesSpin" >
+        <property name="geometry" >
+         <rect>
+          <x>11</x>
+          <y>51</y>
+          <width>158</width>
+          <height>24</height>
+         </rect>
+        </property>
+        <property name="maximum" >
+         <number>3600</number>
+        </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>20</number>
+        </property>
+        <property name="maximum" >
+         <number>3600</number>
+        </property>
+       </widget>
+      </widget>
      </widget>
      <widget class="QWidget" name="tab_2" >
       <attribute name="title" >
        <string>Joblist</string>
       </attribute>
       <layout class="QGridLayout" >
-       <property name="margin" >
+       <property name="leftMargin" >
         <number>9</number>
        </property>
-       <property name="spacing" >
+       <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="QGroupBox" name="groupBox_2" >
          <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>0</hsizetype>
-           <vsizetype>0</vsizetype>
+          <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
           <string>Jolist Limit Options</string>
          </property>
          <layout class="QGridLayout" >
-          <property name="margin" >
+          <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="spacing" >
+          <property name="horizontalSpacing" >
+           <number>6</number>
+          </property>
+          <property name="verticalSpacing" >
            <number>6</number>
           </property>
           <item row="0" column="0" >
            <layout class="QGridLayout" >
-            <property name="margin" >
+            <property name="leftMargin" >
+             <number>0</number>
+            </property>
+            <property name="topMargin" >
              <number>0</number>
             </property>
-            <property name="spacing" >
+            <property name="rightMargin" >
+             <number>0</number>
+            </property>
+            <property name="bottomMargin" >
+             <number>0</number>
+            </property>
+            <property name="horizontalSpacing" >
+             <number>6</number>
+            </property>
+            <property name="verticalSpacing" >
              <number>6</number>
             </property>
             <item row="2" column="0" >
             </item>
             <item row="3" column="0" >
              <widget class="QSpinBox" name="daysSpinBox" >
-              <property name="maximum" >
-               <number>10000</number>
-              </property>
               <property name="minimum" >
                <number>1</number>
               </property>
+              <property name="maximum" >
+               <number>10000</number>
+              </property>
               <property name="singleStep" >
                <number>7</number>
               </property>
             </item>
             <item row="1" column="0" >
              <widget class="QSpinBox" name="recordSpinBox" >
-              <property name="maximum" >
-               <number>10000</number>
-              </property>
               <property name="minimum" >
                <number>1</number>
               </property>
+              <property name="maximum" >
+               <number>10000</number>
+              </property>
               <property name="singleStep" >
                <number>25</number>
               </property>
         <string>Context Sensitive List Commands</string>
        </property>
        <layout class="QGridLayout" >
-        <property name="margin" >
+        <property name="leftMargin" >
+         <number>9</number>
+        </property>
+        <property name="topMargin" >
+         <number>9</number>
+        </property>
+        <property name="rightMargin" >
          <number>9</number>
         </property>
-        <property name="spacing" >
+        <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" >
         </rect>
        </property>
        <property name="title" >
-        <string>GroupBox</string>
+        <string>Open Pages</string>
        </property>
        <widget class="QCheckBox" name="openPlotCheckBox" >
         <property name="geometry" >
        <string>Debug</string>
       </attribute>
       <layout class="QGridLayout" >
-       <property name="margin" >
+       <property name="leftMargin" >
+        <number>9</number>
+       </property>
+       <property name="topMargin" >
         <number>9</number>
        </property>
-       <property name="spacing" >
+       <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="QGroupBox" name="groupBox_3" >
          <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>0</hsizetype>
-           <vsizetype>0</vsizetype>
+          <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
           <string>Debugging Options</string>
          </property>
          <layout class="QGridLayout" >
-          <property name="margin" >
+          <property name="leftMargin" >
            <number>9</number>
           </property>
-          <property name="spacing" >
+          <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" >
            <layout class="QGridLayout" >
-            <property name="margin" >
+            <property name="leftMargin" >
+             <number>0</number>
+            </property>
+            <property name="topMargin" >
              <number>0</number>
             </property>
-            <property name="spacing" >
+            <property name="rightMargin" >
+             <number>0</number>
+            </property>
+            <property name="bottomMargin" >
+             <number>0</number>
+            </property>
+            <property name="horizontalSpacing" >
+             <number>6</number>
+            </property>
+            <property name="verticalSpacing" >
              <number>6</number>
             </property>
             <item row="0" column="0" >
        <string>RestoreTree</string>
       </attribute>
       <layout class="QGridLayout" >
-       <property name="margin" >
+       <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="spacing" >
+       <property name="horizontalSpacing" >
+        <number>6</number>
+       </property>
+       <property name="verticalSpacing" >
         <number>6</number>
        </property>
        <item row="0" column="0" >
         <widget class="QGroupBox" name="groupBox_5" >
          <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>0</hsizetype>
-           <vsizetype>0</vsizetype>
+          <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
            <horstretch>0</horstretch>
            <verstretch>0</verstretch>
           </sizepolicy>
           <string>Debugging Options</string>
          </property>
          <layout class="QGridLayout" >
-          <property name="margin" >
+          <property name="leftMargin" >
+           <number>9</number>
+          </property>
+          <property name="topMargin" >
+           <number>9</number>
+          </property>
+          <property name="rightMargin" >
            <number>9</number>
           </property>
-          <property name="spacing" >
+          <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" >
            <layout class="QGridLayout" >
-            <property name="margin" >
+            <property name="leftMargin" >
+             <number>0</number>
+            </property>
+            <property name="topMargin" >
+             <number>0</number>
+            </property>
+            <property name="rightMargin" >
+             <number>0</number>
+            </property>
+            <property name="bottomMargin" >
              <number>0</number>
             </property>
-            <property name="spacing" >
+            <property name="horizontalSpacing" >
+             <number>6</number>
+            </property>
+            <property name="verticalSpacing" >
              <number>6</number>
             </property>
             <item row="10" column="0" >
    </item>
    <item row="0" column="0" >
     <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
      <property name="spacing" >
       <number>6</number>
      </property>
+     <property name="leftMargin" >
+      <number>0</number>
+     </property>
+     <property name="topMargin" >
+      <number>0</number>
+     </property>
+     <property name="rightMargin" >
+      <number>0</number>
+     </property>
+     <property name="bottomMargin" >
+      <number>0</number>
+     </property>
      <item>
       <spacer>
        <property name="orientation" >
      <item>
       <widget class="QLabel" name="headingLabel" >
        <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>0</hsizetype>
-         <vsizetype>0</vsizetype>
+        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
index 5bec9d30165b68febff51c519ccad27be719b2ad..a12c833f9db823a4879df880a889c6ce1078ee7f 100644 (file)
@@ -53,8 +53,7 @@ DirStat::DirStat()
    dockPage();
    m_timer = new QTimer(this);
    QWidget::connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
-   //m_timer->start(mainWin->m_checkMessagesInterval*1000);
-   m_timer->start(10*1000);
+   m_timer->start(mainWin->m_refreshStatusDirInterval*1000);
 }
 
 void DirStat::getFont()
@@ -99,7 +98,7 @@ void DirStat::populateAll()
 void DirStat::timerTriggered()
 {
    bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
-   if ((isDocked() && iscurrent) || (!isDocked())) {
+   if (((isDocked() && iscurrent) || (!isDocked())) && mainWin->m_refreshStatusDir) {
       if (m_console->is_ready())
          populateAll();
    }
index cb4c2359b4d71f04cda728dfe56c66ace08b02a5..de8fbfdab4b769798ad27a18d53079f97c2b017d 100644 (file)
@@ -53,7 +53,6 @@ public slots:
    void populateTerminated();
    void populateScheduled();
    void populateRunning();
-//   virtual void treeWidgetName(QString &);
    void populateAll();
 
 private slots:
@@ -67,7 +66,7 @@ private:
    QTextCursor *m_cursor;
    void getFont();
    QString m_groupText, m_splitText;
-   QTimer * m_timer;
+   QTimer *m_timer;
 };
 
 #endif /* _DIRSTAT_H_ */