]> git.sur5r.net Git - bacula/bacula/commitdiff
I was getting multiple preferences boxes because of being connected more than once...
authorDirk H Bartley <dbartley@schupan.com>
Sun, 29 Mar 2009 18:14:44 +0000 (18:14 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Sun, 29 Mar 2009 18:14:44 +0000 (18:14 +0000)
should prevent that.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8644 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/mainwin.cpp
bacula/src/qt-console/mainwin.h

index 73a67f233757bad511d0ed5a83d5b3b98b80f5fc..effb77869ccc5ec01c262a3df96680cec10df6eb 100644 (file)
@@ -69,6 +69,7 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
    app->setOverrideCursor(QCursor(Qt::WaitCursor));
    m_isClosing = false;
    m_waitState = false;
+   m_doConnect = false;
    m_dtformat = "yyyy-MM-dd HH:mm:ss";
    mainWin = this;
    setupUi(this);                     /* Setup UI defined by main.ui (designer) */
@@ -95,8 +96,7 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
    foreach(Console *console, m_consoleHash)
       console->connect_dir();
    m_currentConsole = (Console*)getFromHash(m_firstItem);
-   m_currentConsole->setCurrent();
-   QTimer::singleShot(2000, this, SLOT(popLists()));
+   QTimer::singleShot(750, this, SLOT(popLists()));
    if (m_miscDebug) {
       QString directoryResourceName;
       m_currentConsole->getDirResName(directoryResourceName);
@@ -108,9 +108,11 @@ void MainWin::popLists()
 {
    foreach(Console *console, m_consoleHash)
       console->populateLists(true);
+   app->restoreOverrideCursor();
+   m_currentConsole->setCurrent();
+   m_doConnect = true;
    connectConsoleSignals();
    connectSignals();
-   app->restoreOverrideCursor();
 }
 
 void MainWin::createPages()
@@ -316,8 +318,10 @@ void MainWin::waitExit()
    app->restoreOverrideCursor();
    if (m_waitTreeItem != treeWidget->currentItem())
       treeWidget->setCurrentItem(m_waitTreeItem);
-   connectSignals();
-   connectConsoleSignals();
+   if (m_doConnect) {
+      connectSignals();
+      connectConsoleSignals();
+   }
 }
 
 void MainWin::connectConsoleSignals()
index 330476db8d6e6e872ce116976b73dcf0cce79362..bb85056a90c246f9f340cb0532dd2f53825ccdd9 100644 (file)
@@ -151,6 +151,7 @@ private:
    QTreeWidgetItem *m_waitTreeItem;
    bool m_isClosing;
    bool m_waitState;
+   bool m_doConnect;
 };
 
 #include "ui_prefs.h"