]> git.sur5r.net Git - bacula/bacula/commitdiff
Set up splitter settings for easy version changes.
authorDirk H Bartley <dbartley@schupan.com>
Wed, 8 Aug 2007 00:33:08 +0000 (00:33 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Wed, 8 Aug 2007 00:33:08 +0000 (00:33 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5301 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/joblist/joblist.cpp
bacula/src/qt-console/joblist/joblist.h
bacula/src/qt-console/restore/restoretree.cpp
bacula/src/qt-console/restore/restoretree.h

index f01eaaf7630b8aef41cfd4069e6149914f86d6d5..3b2deb3668c247b4e5f54b7598ac0673ae2ed1bc 100644 (file)
@@ -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();
 }
index ad7b5d896a8d8451bf98a55d2ac86a22dc4169f1..4faa11df0eac80c1007eaffa011da35f9f0d0352 100644 (file)
@@ -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;
index a4de6eb0dfcd57f0bf94b6b8bd46afd6430c2dc4..1d8a6cede99679872581f6ed911d00e051f3081b 100644 (file)
@@ -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();
 }
 
index f6121a9280d064d6d068374b81132e067f05b64b..fee9cf65c7750236518d70f20e1e1ba05384ef8c 100644 (file)
@@ -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;