From 37dbaa2553cdff6a537a61e8aea358c4464ae0f1 Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Sun, 7 Mar 2010 12:29:59 -0500 Subject: [PATCH] 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. --- bacula/src/qt-console/mainwin.cpp | 4 +--- bacula/src/qt-console/pages.cpp | 9 +++++++++ bacula/src/qt-console/pages.h | 2 ++ bacula/src/qt-console/run/run.cpp | 2 ++ 4 files changed, 14 insertions(+), 3 deletions(-) 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); -- 2.39.5