]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
#22153: Progress bar missing
authorvtn <vtn@opencascade.com>
Mon, 11 Mar 2013 11:32:19 +0000 (11:32 +0000)
committervtn <vtn@opencascade.com>
Mon, 11 Mar 2013 11:32:19 +0000 (11:32 +0000)
src/PVGUI/PVGUI_Module_widgets.cxx

index 168766a96b3dddf236b98bd60ef35405ac71d63d..3f5265637f6a1ce80810de1bc5aea08bf5a95d2a 100644 (file)
@@ -37,6 +37,7 @@
 #include <QScrollArea>
 #include <QVBoxLayout>
 #include <QShowEvent>
+#include <QToolButton>
 
 #include <pqAnimationViewWidget.h> 
 #include <pqAnimationWidget.h> 
@@ -54,6 +55,7 @@
 #include <pqPVAnimationWidget.h>
 #include <pqSelectionInspectorWidget.h>
 #include <pqProgressWidget.h>
+#include <pqProgressManager.h>
 
 #include <pqAlwaysConnectedBehavior.h>
 #include <pqApplicationCore.h>
@@ -247,9 +249,29 @@ void PVGUI_Module::setupDockWidgets()
   myDockWidgets[memoryInspectorDock] = false; // hidden by default
 
   // Setup the statusbar ...
+  pqProgressManager* progress_manager =
+    pqApplicationCore::instance()->getProgressManager();
+
+  // Progress bar/button management
   pqProgressWidget* aProgress = new pqProgressWidget(desk->statusBar());
-  desk->statusBar()->addPermanentWidget(aProgress);
+  progress_manager->addNonBlockableObject(aProgress);
+  progress_manager->addNonBlockableObject(aProgress->getAbortButton());
   
+  QObject::connect( progress_manager, SIGNAL(enableProgress(bool)),
+                    aProgress,        SLOT(enableProgress(bool)));
+
+  QObject::connect( progress_manager, SIGNAL(progress(const QString&, int)),
+                    aProgress,        SLOT(setProgress(const QString&, int)));
+
+  QObject::connect( progress_manager, SIGNAL(enableAbort(bool)),
+                    aProgress,        SLOT(enableAbort(bool)));
+
+  QObject::connect( aProgress,        SIGNAL(abortPressed()),
+                    progress_manager, SLOT(triggerAbort()));
+
+  desk->statusBar()->addPermanentWidget(aProgress);
+  aProgress->setEnabled(true);
+
   // Set up the dock window corners to give the vertical docks more room.
   desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
   desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);