From: Dirk H Bartley Date: Wed, 8 Aug 2007 00:33:08 +0000 (+0000) Subject: Set up splitter settings for easy version changes. X-Git-Tag: Release-7.0.0~5885 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f5f7653a65823450bdc99a97722185c076a531b2;p=bacula%2Fbacula Set up splitter settings for easy version changes. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5301 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index f01eaaf763..3b2deb3668 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -71,25 +71,25 @@ JobList::JobList(const QString &mediaName, const QString &clientName, daysSpinBox->setValue(mainWin->m_daysLimitVal); dockPage(); - QGridLayout *m_gridLayout = new QGridLayout(this); - m_gridLayout->setSpacing(6); - m_gridLayout->setMargin(9); - m_gridLayout->setObjectName(QString::fromUtf8("m_gridLayout")); + QGridLayout *gridLayout = new QGridLayout(this); + gridLayout->setSpacing(6); + gridLayout->setMargin(9); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - splitter = new QSplitter(Qt::Vertical, this); + m_splitter = new QSplitter(Qt::Vertical, this); QScrollArea *area = new QScrollArea(); area->setObjectName(QString::fromUtf8("area")); area->setWidget(frame); area->setWidgetResizable(true); - splitter->addWidget(mp_tableWidget); - splitter->addWidget(area); + m_splitter->addWidget(mp_tableWidget); + m_splitter->addWidget(area); - m_gridLayout->addWidget(splitter, 0, 0, 1, 1); + gridLayout->addWidget(m_splitter, 0, 0, 1, 1); readSettings(); } /* - * Write the splitter settings in the destructor + * Write the m_splitter settings in the destructor */ JobList::~JobList() { @@ -592,8 +592,8 @@ void JobList::graphTable() void JobList::writeSettings() { QSettings settings(m_console->m_dir->name(), "bat"); - settings.beginGroup("JobListPage"); - settings.setValue("splitterSizes", splitter->saveState()); + settings.beginGroup(m_groupText); + settings.setValue(m_splitText, m_splitter->saveState()); settings.endGroup(); } @@ -602,8 +602,10 @@ void JobList::writeSettings() */ void JobList::readSettings() { + m_groupText = "JobListPage"; + m_splitText = "splitterSizes_1"; QSettings settings(m_console->m_dir->name(), "bat"); - settings.beginGroup("JobListPage"); - splitter->restoreState(settings.value("splitterSizes").toByteArray()); + settings.beginGroup(m_groupText); + m_splitter->restoreState(settings.value(m_splitText).toByteArray()); settings.endGroup(); } diff --git a/bacula/src/qt-console/joblist/joblist.h b/bacula/src/qt-console/joblist/joblist.h index ad7b5d896a..4faa11df0e 100644 --- a/bacula/src/qt-console/joblist/joblist.h +++ b/bacula/src/qt-console/joblist/joblist.h @@ -74,7 +74,9 @@ private: void setStatusColor(QTableWidgetItem *item, QString &field); void writeSettings(); void readSettings(); - QSplitter *splitter; + QSplitter *m_splitter; + QString m_groupText; + QString m_splitText; QString m_mediaName; QString m_clientName; QString m_jobName; diff --git a/bacula/src/qt-console/restore/restoretree.cpp b/bacula/src/qt-console/restore/restoretree.cpp index a4de6eb0df..1d8a6cede9 100644 --- a/bacula/src/qt-console/restore/restoretree.cpp +++ b/bacula/src/qt-console/restore/restoretree.cpp @@ -57,20 +57,20 @@ restoreTree::restoreTree() m_debugCnt = 0; m_debugTrap = true; - QGridLayout *m_gridLayout = new QGridLayout(this); - m_gridLayout->setSpacing(6); - m_gridLayout->setMargin(9); - m_gridLayout->setObjectName(QString::fromUtf8("m_gridLayout")); + QGridLayout *gridLayout = new QGridLayout(this); + gridLayout->setSpacing(6); + gridLayout->setMargin(9); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - splitter_2 = new QSplitter(Qt::Vertical, this); + m_splitter = new QSplitter(Qt::Vertical, this); QScrollArea *area = new QScrollArea(); area->setObjectName(QString::fromUtf8("area")); area->setWidget(widget); area->setWidgetResizable(true); - splitter_2->addWidget(splitter); - splitter_2->addWidget(area); + m_splitter->addWidget(splitter); + m_splitter->addWidget(area); - m_gridLayout->addWidget(splitter_2, 0, 0, 1, 1); + gridLayout->addWidget(m_splitter, 0, 0, 1, 1); /* progress widgets */ prBar1->setVisible(false); @@ -618,9 +618,8 @@ void restoreTree::fileCurrentItemChanged(QTableWidgetItem *fileTableItem, QTable void restoreTree::writeSettings() { QSettings settings(m_console->m_dir->name(), "bat"); - settings.beginGroup("RestoreTree"); - settings.setValue("splitterSizes", splitter->saveState()); - settings.setValue("splitter_2Sizes", splitter_2->saveState()); + settings.beginGroup(m_groupText); + settings.setValue(m_splitText, m_splitter->saveState()); settings.endGroup(); } @@ -629,10 +628,11 @@ void restoreTree::writeSettings() */ void restoreTree::readSettings() { + m_groupText = "RestoreTreePage"; + m_splitText = "splitterSizes_1"; QSettings settings(m_console->m_dir->name(), "bat"); - settings.beginGroup("RestoreTree"); - splitter->restoreState(settings.value("splitterSizes").toByteArray()); - splitter_2->restoreState(settings.value("splitter_2Sizes").toByteArray()); + settings.beginGroup(m_groupText); + m_splitter->restoreState(settings.value(m_splitText).toByteArray()); settings.endGroup(); } diff --git a/bacula/src/qt-console/restore/restoretree.h b/bacula/src/qt-console/restore/restoretree.h index f6121a9280..fee9cf65c7 100644 --- a/bacula/src/qt-console/restore/restoretree.h +++ b/bacula/src/qt-console/restore/restoretree.h @@ -95,7 +95,9 @@ private: void setJobsCheckedList(); int queryFileIndex(QString &fullPath, int jobID); - QSplitter *splitter_2; + QSplitter *m_splitter; + QString m_groupText; + QString m_splitText; bool m_populated; bool m_dropdownChanged; QRegExp m_winRegExpDrive;