From: Dirk H Bartley Date: Tue, 19 Feb 2008 20:28:13 +0000 (+0000) Subject: Add preference to have the status dir screen auto refresh. X-Git-Tag: Release-7.0.0~4994 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=391002036482334947e00223b4774d7ec80e563a;p=bacula%2Fbacula Add preference to have the status dir screen auto refresh. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6447 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index 20335059c6..0465ac3cd9 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -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(); diff --git a/bacula/src/qt-console/mainwin.h b/bacula/src/qt-console/mainwin.h index 911c964202..d96b5885c8 100644 --- a/bacula/src/qt-console/mainwin.h +++ b/bacula/src/qt-console/mainwin.h @@ -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; diff --git a/bacula/src/qt-console/prefs.ui b/bacula/src/qt-console/prefs.ui index 9f2e0aee19..a0b0bc2aa9 100644 --- a/bacula/src/qt-console/prefs.ui +++ b/bacula/src/qt-console/prefs.ui @@ -5,14 +5,12 @@ 0 0 - 435 - 499 + 470 + 533 - - 0 - 0 + 0 0 @@ -24,91 +22,180 @@ images/bat.png - + 9 - + + 9 + + + 9 + + + 9 + + + 6 + + 6 - 2 + 0 - Messages + Timers - - - 9 + + + + 60 + 60 + 180 + 106 + - - 6 + + + 0 + 0 + - - - - - 0 - 0 - 0 - 0 - - - - Messages Options - - - - 9 - - - 6 - - - - - Message check interval in seconds - - - - - - - Check Messages - - - - - - - 3600 - - - - - - - + + Messages Options + + + + + 11 + 81 + 158 + 16 + + + + Message check interval in seconds + + + + + + 11 + 25 + 158 + 20 + + + + Check Messages + + + + + + 11 + 51 + 158 + 24 + + + + 3600 + + + + + + + 60 + 200 + 180 + 106 + + + + + 0 + 0 + + + + Status Dir + + + + + 11 + 81 + 158 + 16 + + + + Refresh Status Dir Interval + + + + + + 11 + 25 + 158 + 20 + + + + Refresh Status Dir + + + + + + 11 + 51 + 158 + 24 + + + + 20 + + + 3600 + + + Joblist - + 9 - + + 9 + + + 9 + + + 9 + + + 6 + + 6 - - 0 - 0 + 0 0 @@ -117,18 +204,42 @@ Jolist Limit Options - + + 9 + + + 9 + + + 9 + + 9 - + + 6 + + 6 - + + 0 + + 0 - + + 0 + + + 0 + + + 6 + + 6 @@ -140,12 +251,12 @@ - - 10000 - 1 + + 10000 + 7 @@ -153,12 +264,12 @@ - - 10000 - 1 + + 10000 + 25 @@ -247,10 +358,22 @@ Context Sensitive List Commands - + + 9 + + + 9 + + 9 - + + 9 + + + 6 + + 6 @@ -272,7 +395,7 @@ - GroupBox + Open Pages @@ -320,18 +443,28 @@ Debug - + + 9 + + 9 - + + 9 + + + 9 + + + 6 + + 6 - - 0 - 0 + 0 0 @@ -340,18 +473,42 @@ Debugging Options - + 9 - + + 9 + + + 9 + + + 9 + + + 6 + + 6 - + + 0 + + 0 - + + 0 + + + 0 + + + 6 + + 6 @@ -401,18 +558,28 @@ RestoreTree - + + 9 + + + 9 + + + 9 + + 9 - + + 6 + + 6 - - 0 - 0 + 0 0 @@ -421,18 +588,42 @@ Debugging Options - + + 9 + + + 9 + + 9 - + + 9 + + + 6 + + 6 - + + 0 + + + 0 + + + 0 + + 0 - + + 6 + + 6 @@ -540,12 +731,21 @@ - - 0 - 6 + + 0 + + + 0 + + + 0 + + + 0 + @@ -562,9 +762,7 @@ - - 0 - 0 + 0 0 diff --git a/bacula/src/qt-console/status/dirstat.cpp b/bacula/src/qt-console/status/dirstat.cpp index 5bec9d3016..a12c833f9d 100644 --- a/bacula/src/qt-console/status/dirstat.cpp +++ b/bacula/src/qt-console/status/dirstat.cpp @@ -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(); } diff --git a/bacula/src/qt-console/status/dirstat.h b/bacula/src/qt-console/status/dirstat.h index cb4c2359b4..de8fbfdab4 100644 --- a/bacula/src/qt-console/status/dirstat.h +++ b/bacula/src/qt-console/status/dirstat.h @@ -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_ */