]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/mainwin.cpp
kes Close bat console windows first to eliminate error message
[bacula/bacula] / bacula / src / qt-console / mainwin.cpp
index 4f073cf1a539ca231c5d04971719fd88ef88c2f3..079c2a2f7a6baa6e401832048330013a74a7bdd9 100644 (file)
@@ -122,7 +122,7 @@ void MainWin::createPages()
       item = new QTreeWidgetItem(topItem);
       item->setText(0, "Console");
       if (!m_firstItem){ m_firstItem = item; }
-      item->setIcon(0,QIcon(QString::fromUtf8(":images/utilities-terminal.svg")));
+      item->setIcon(0,QIcon(QString::fromUtf8(":images/utilities-terminal.png")));
 
       /* insert the cosole and tree widget item into the hashes */
       hashInsert(item, m_currentConsole);
@@ -143,12 +143,12 @@ void MainWin::createPages()
       new FileSet();
       new Jobs();
       createPageJobList("", "", "", "", NULL);
-      new MediaList();
-      new Storage();
-      new restoreTree();
       JobPlotPass pass;
       pass.use = false;
       new JobPlot(NULL, pass);
+      new MediaList();
+      new Storage();
+      new restoreTree();
 
       treeWidget->expandItem(topItem);
       stackedWidget->setCurrentWidget(m_currentConsole);
@@ -247,6 +247,16 @@ void MainWin::closeEvent(QCloseEvent *event)
 {
    m_isClosing = true;
    writeSettings();
+   /*
+    * Close the console pages before non-console pages so that
+    *  the notifier is turned off. Otherwise it prints an error when
+    *  the page it is using gets destroyed.
+    */
+   foreach(Console *console, m_consoleHash){
+      console->writeSettings();
+      console->terminate();
+      console->closeStackPage();
+   }
    /* close all non console pages, this will call settings in destructors */
    while (m_consoleHash.count() < m_pagehash.count()) {
       foreach(Pages *page, m_pagehash) {
@@ -259,12 +269,6 @@ void MainWin::closeEvent(QCloseEvent *event)
          }
       }
    }
-   /* close the console pages and terminate connection */
-   foreach(Console *console, m_consoleHash){
-      console->writeSettings();
-      console->terminate();
-      console->closeStackPage();
-   }
    event->accept();
 }