From: Kern Sibbald Date: Wed, 29 Oct 2008 20:42:30 +0000 (+0000) Subject: Apply pane freezing during updates patch from Riccardo Ghetta. X-Git-Tag: Release-7.0.0~3819 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=589d6ae4905bb783e3395a2c8045ad1d628badff;p=bacula%2Fbacula Apply pane freezing during updates patch from Riccardo Ghetta. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7943 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/AUTHORS b/bacula/AUTHORS index e2b696d26f..74d59acefb 100644 --- a/bacula/AUTHORS +++ b/bacula/AUTHORS @@ -46,6 +46,7 @@ Frank Kardel Frank Sweetser Howard Thomson Jaime Ventura +James Harper Jan Kesten Joao Henrique Freitas John Goerzen diff --git a/bacula/src/qt-console/clients/clients.cpp b/bacula/src/qt-console/clients/clients.cpp index ff30579a82..a458c414c7 100644 --- a/bacula/src/qt-console/clients/clients.cpp +++ b/bacula/src/qt-console/clients/clients.cpp @@ -76,7 +76,7 @@ void Clients::populateTable() return; m_populated = true; - QBrush blackBrush(Qt::black); + Freeze frz(*tableWidget); /* disable updating*/ QStringList headerlist = (QStringList() << tr("Client Name") << tr("File Retention") << tr("Job Retention") << tr("AutoPrune") << tr("ClientId") << tr("Uname") ); diff --git a/bacula/src/qt-console/fileset/fileset.cpp b/bacula/src/qt-console/fileset/fileset.cpp index 4ca07c1c07..20e8192605 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -75,7 +75,7 @@ void FileSet::populateTable() return; m_populated = true; - QBrush blackBrush(Qt::black); + Freeze frz(*tableWidget); /* disable updating*/ m_checkcurwidget = false; tableWidget->clear(); diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index 91c13e355e..56078a5d0d 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -115,6 +115,8 @@ void JobList::populateTable() prepareFilterWidgets(); m_populated = true; + Freeze frz(*mp_tableWidget); /* disable updating*/ + /* Set up query */ QString query; fillQueryString(query); diff --git a/bacula/src/qt-console/jobs/jobs.cpp b/bacula/src/qt-console/jobs/jobs.cpp index ed1d653471..777a6f459e 100644 --- a/bacula/src/qt-console/jobs/jobs.cpp +++ b/bacula/src/qt-console/jobs/jobs.cpp @@ -72,6 +72,9 @@ void Jobs::populateTable() if (!m_console->preventInUseConnect()) return; m_populated = true; + + Freeze frz(*tableWidget); /* disable updating*/ + QBrush blackBrush(Qt::black); m_checkcurwidget = false; tableWidget->clear(); diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index ab1a877f89..90a6acdb79 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -80,11 +80,11 @@ void MediaList::populateTree() writeExpandedSettings(); m_populated = true; - QTreeWidgetItem *pooltreeitem; - if (!m_console->preventInUseConnect()) return; + Freeze frz(*mp_treeWidget); /* disable updating*/ + QStringList headerlist = (QStringList() << tr("Volume Name") << tr("Id") << tr("Status") << tr("Enabled") << tr("Bytes") << tr("Files") << tr("Jobs") << tr("Retention") << tr("Media Type") << tr("Slot") << tr("Use Duration") @@ -106,6 +106,7 @@ void MediaList::populateTree() settings.beginGroup("MediaListTreeExpanded"); QString query; + QTreeWidgetItem *pooltreeitem; foreach (QString pool_listItem, m_console->pool_list) { pooltreeitem = new QTreeWidgetItem(m_topItem); pooltreeitem->setText(0, pool_listItem); diff --git a/bacula/src/qt-console/storage/storage.cpp b/bacula/src/qt-console/storage/storage.cpp index c6fe69c922..4c6c7dce12 100644 --- a/bacula/src/qt-console/storage/storage.cpp +++ b/bacula/src/qt-console/storage/storage.cpp @@ -81,6 +81,8 @@ void Storage::populateTree() writeExpandedSettings(); m_populated = true; + Freeze frz(*mp_treeWidget); /* disable updating*/ + m_checkcurwidget = false; mp_treeWidget->clear(); m_checkcurwidget = true; diff --git a/bacula/src/qt-console/util/fmtwidgetitem.cpp b/bacula/src/qt-console/util/fmtwidgetitem.cpp index 18d49fd6a5..476e931a74 100644 --- a/bacula/src/qt-console/util/fmtwidgetitem.cpp +++ b/bacula/src/qt-console/util/fmtwidgetitem.cpp @@ -63,6 +63,24 @@ QString convertJobStatus(const QString &sts) return QString(buf); } +/* + * disable widget updating + */ +Freeze::Freeze(QWidget &q): +qw(&q) +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + qw->setUpdatesEnabled(false); +} + +Freeze::~Freeze() +{ + if (qw) { + qw->setUpdatesEnabled(true); + QApplication::restoreOverrideCursor(); + } +} + /*********************************************** * * ItemFormatterBase static members diff --git a/bacula/src/qt-console/util/fmtwidgetitem.h b/bacula/src/qt-console/util/fmtwidgetitem.h index 6acc0cb317..af44c23100 100644 --- a/bacula/src/qt-console/util/fmtwidgetitem.h +++ b/bacula/src/qt-console/util/fmtwidgetitem.h @@ -33,6 +33,7 @@ * TreeView formatting helpers - Riccardo Ghetta, May 2008 */ +class QWidget; class QTreeWidgetItem; class QTableWidget; class QTableWidgetItem; @@ -46,6 +47,20 @@ class QBrush; */ QString convertJobStatus(const QString &sts); +/* + * disable widget updating + */ +class Freeze +{ +private: + QWidget *qw; + + public: + Freeze(QWidget &q); + ~Freeze(); +}; + + /* * base class for formatters diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 2b079d2bc0..e5acfaad41 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -11,6 +11,7 @@ mixed priorities General: 29Oct08 +kes Apply pane freezing during updates patch from Riccardo Ghetta. kes Rework next_vol and autoprune a bit due to failure in recycle-test. prune_volumes() now returns no status, but should prune at least one Volume, if possible.