]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/pages.cpp
Massive bat notifier rewrite + fix seg fault + implement text input dialog
[bacula/bacula] / bacula / src / qt-console / pages.cpp
index 293bf70758f63e1ccc3e727c474abdcf63027ee1..8537604b029a31d0f9ffa4c0870a571867bb49e0 100644 (file)
@@ -6,7 +6,7 @@
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -51,6 +51,23 @@ bool isWin32Path(QString &fullPath)
    return toret;
 }
 
+/* Need to initialize variables here */
+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();
+   }
+}
+
 /*
  * dockPage
  * This function is intended to be called from within the Pages class to pull
@@ -87,10 +104,10 @@ void Pages::dockPage()
 
    /* Set docked flag */
    m_docked = true;
+   m_onceDocked = true;
    mainWin->tabWidget->setCurrentWidget(this);
    /* lets set the page selectors action for docking or undocking */
    setContextMenuDockText();
-
 }
 
 /*
@@ -140,6 +157,17 @@ bool Pages::isDocked()
    return m_docked;
 }
 
+/*
+ * This function is because after the tabbed widget was added I could not tell
+ * from is docked if it had been docked yet.  To prevent status pages from requesting
+ * status from the director
+ */
+bool Pages::isOnceDocked()
+{
+   return m_onceDocked;
+}
+
+
 /*
  * To keep m_closeable protected as well
  */
@@ -221,6 +249,7 @@ void Pages::pgInitialize(const QString &name)
 void Pages::pgInitialize(const QString &tname, QTreeWidgetItem *parentTreeWidgetItem)
 {
    m_docked = false;
+   m_onceDocked = false;
    if (tname.size()) {
       m_name = tname;
    }
@@ -260,7 +289,7 @@ void Pages::consoleCommand(QString &command, bool setCurrent)
 {
    int conn;
    bool donotify = false;
-   if (m_console->availableDirComm(conn))  {
+   if (m_console->getDirComm(conn))  {
       if (m_console->is_notify_enabled(conn)) {
          donotify = true;
          m_console->notify(conn, false);