]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/mainwin.cpp
Fix bat seg fault
[bacula/bacula] / bacula / src / qt-console / mainwin.cpp
index 00261525c3805e053766a02335334909d2bf9356..eca18bd28d4c407fdf5a755c8785fdccb39ebbd5 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.
@@ -98,7 +98,7 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
       console->connect_dir();
    }
    m_currentConsole = (Console*)getFromHash(m_firstItem);
-   QTimer::singleShot(5000, this, SLOT(popLists()));
+   QTimer::singleShot(2000, this, SLOT(popLists()));
    if (m_miscDebug) {
       QString directoryResourceName;
       m_currentConsole->getDirResName(directoryResourceName);
@@ -151,6 +151,7 @@ void MainWin::createPages()
 
       /* insert the cosole and tree widget item into the hashes */
       hashInsert(item, m_currentConsole);
+      m_currentConsole->dockPage();
 
       /* Set Color of treeWidgetItem for the console
       * It will be set to green in the console class if the connection is made.
@@ -183,8 +184,6 @@ void MainWin::createPages()
 
       treeWidget->expandItem(topItem);
       tabWidget->setCurrentWidget(m_currentConsole);
-      m_currentConsole->undockPage();
-      m_currentConsole->dockPage();
    }
    UnlockRes();
 }
@@ -312,8 +311,7 @@ void MainWin::waitEnter()
       return;
    }
    m_waitState = true;
-   if (mainWin->m_connDebug)
-      Pmsg0(000, "Entering Wait State\n");
+   if (mainWin->m_connDebug) Pmsg0(000, "Entering Wait State\n");
    app->setOverrideCursor(QCursor(Qt::WaitCursor));
    disconnectSignals();
    disconnectConsoleSignals(m_currentConsole);
@@ -517,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->isDocked()) {
-         nextPage->dockPage();
-      }
+      nextPage->firstUseDock();
    
       /* Is this page currently on the stack or is it undocked */
       if (stackindex >= 0) {
@@ -583,6 +579,7 @@ void MainWin::statusPageButtonClicked()
 void MainWin::restoreButtonClicked() 
 {
    new prerestorePage();
+   if (mainWin->m_miscDebug) Pmsg0(000, "in restoreButtonClicked after prerestorePage\n");
 }
 
 void MainWin::jobPlotButtonClicked()