From: vsr Date: Fri, 12 Nov 2010 16:13:06 +0000 (+0000) Subject: Merge from V5_1_5_BR branch 12/11/2010 X-Git-Tag: V5_1_main_FINAL~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cd393e3c98fd061e7d6f648051583c0a7f43dc97;p=modules%2Fjobmanager.git Merge from V5_1_5_BR branch 12/11/2010 --- diff --git a/src/salomegui/BL_SalomeGui.cxx b/src/salomegui/BL_SalomeGui.cxx index 4d23041..ba62dcd 100644 --- a/src/salomegui/BL_SalomeGui.cxx +++ b/src/salomegui/BL_SalomeGui.cxx @@ -41,6 +41,9 @@ BL::SalomeGui::initialize(CAM_Application* app) DEBTRACE("Entering in initialize"); SalomeApp_Module::initialize(app); // MANDATORY -> Otherwise SISEGV... connect( getApp(), SIGNAL(studyClosed()), this, SLOT(studyClosed())); + if ( app && app->desktop() ) + connect( app->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ), + this, SLOT(onWindowActivated( SUIT_ViewWindow* )) ); } void @@ -51,6 +54,7 @@ BL::SalomeGui::studyClosed() _gengui->deleteDockWidget(); delete _gengui; _gengui = NULL; + _viewWin = NULL; } } @@ -107,6 +111,18 @@ BL::SalomeGui::deactivateModule(SUIT_Study* theStudy) return bOk; } +void +BL::SalomeGui::onWindowActivated( SUIT_ViewWindow* svw) +{ + DEBTRACE("BL::SalomeGui::onWindowActivated"); + DEBTRACE("activeModule()->moduleName() " << (getApp()->activeModule() ? getApp()->activeModule()->moduleName().toStdString() : "") ); + + if (_viewWin) // Be sure to have a _viewWindow + if (svw->getId() == _viewWin->getId()) // Same Id ? + if (getApp()->activeModule() && getApp()->activeModule()->moduleName().compare("JobManager") != 0) // JobManager already activated ? + getApp()->activateModule("JobManager"); +} + // --- Export the module extern "C" { diff --git a/src/salomegui/BL_SalomeGui.hxx b/src/salomegui/BL_SalomeGui.hxx index 5ca85de..f6069a9 100644 --- a/src/salomegui/BL_SalomeGui.hxx +++ b/src/salomegui/BL_SalomeGui.hxx @@ -46,6 +46,9 @@ namespace BL bool activateModule( SUIT_Study* theStudy); void studyClosed(); + protected slots: + void onWindowActivated( SUIT_ViewWindow* svw); + protected: BL::GenericGui * _gengui; };