From: Dirk H Bartley Date: Sun, 7 Mar 2010 17:29:59 +0000 (-0500) Subject: This adds the ability to once again have classes that don't neccesarily dock. It... X-Git-Tag: Release-5.2.1~1622 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8706ead8e682475f89d69bb0fda32fb678b4be3f;p=bacula%2Fbacula This adds the ability to once again have classes that don't neccesarily dock. It also shows the example of having the run page not dock like it once did not. --- diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index 10cccd0bf1..0530ba56d7 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -515,9 +515,7 @@ void MainWin::treeItemChanged(QTreeWidgetItem *currentitem, QTreeWidgetItem *pre } /* set the value for the currently active console */ int stackindex = tabWidget->indexOf(nextPage); - if (!nextPage->isOnceDocked()) { - nextPage->dockPage(); - } + nextPage->firstUseDock(); /* Is this page currently on the stack or is it undocked */ if (stackindex >= 0) { diff --git a/bacula/src/qt-console/pages.cpp b/bacula/src/qt-console/pages.cpp index e99ad6d7a3..1efc60a101 100644 --- a/bacula/src/qt-console/pages.cpp +++ b/bacula/src/qt-console/pages.cpp @@ -57,6 +57,15 @@ Pages::Pages() m_docked = false; m_onceDocked = false; m_closeable = true; + m_dockOnFirstUse = true; +} + +/* first Use Dock */ +void Pages::firstUseDock() +{ + if (!m_onceDocked && m_dockOnFirstUse) { + dockPage(); + } } /* diff --git a/bacula/src/qt-console/pages.h b/bacula/src/qt-console/pages.h index b938465b99..6e619aa322 100644 --- a/bacula/src/qt-console/pages.h +++ b/bacula/src/qt-console/pages.h @@ -78,6 +78,7 @@ public: QString &name() { return m_name; }; void getVolumeList(QStringList &); void getStatusList(QStringList &); + void firstUseDock(); public slots: /* closeEvent is a virtual function inherited from QWidget */ @@ -94,6 +95,7 @@ protected: bool m_closeable; bool m_docked; bool m_onceDocked; + bool m_dockOnFirstUse; Console *m_console; QString m_name; }; diff --git a/bacula/src/qt-console/run/run.cpp b/bacula/src/qt-console/run/run.cpp index 714aac3f35..587cabc0e5 100644 --- a/bacula/src/qt-console/run/run.cpp +++ b/bacula/src/qt-console/run/run.cpp @@ -46,6 +46,7 @@ runPage::runPage() runPage::runPage(const QString &defJob) { + m_dockOnFirstUse = false; init(); if (defJob != "") jobCombo->setCurrentIndex(jobCombo->findText(defJob, Qt::MatchExactly)); @@ -57,6 +58,7 @@ runPage::runPage(const QString &defJob, const QString &level, const QString &pool, const QString &storage, const QString &client, const QString &fileset) { + m_dockOnFirstUse = false; init(); jobCombo->setCurrentIndex(jobCombo->findText(defJob, Qt::MatchExactly)); job_name_change(0);