/* Summary */
_dw_summary = new QDockWidget(_dock_parent);
_dw_summary->setWindowTitle("Summary");
- _summary = new BL::Summary(_dock_parent, _jobs_manager);
+ _summary = new BL::Summary(_dw_summary, _jobs_manager);
_summary->setModel(_model);
_dw_summary->setWidget(_summary);
/* ResourceCatalog */
_dw_resource_catalog = new QDockWidget(_dock_parent);
_dw_resource_catalog->setWindowTitle("Resource Catalog");
- _resource_catalog = new JM::ResourceCatalog(_dock_parent, _salome_services);
+ _resource_catalog = new JM::ResourceCatalog(_dw_resource_catalog, _salome_services);
_dw_resource_catalog->setWidget(_resource_catalog);
/* Main Dock Window */
BL::GenericGui::~GenericGui()
{
DEBTRACE("Destroying BL::GenericGui");
-
delete _salome_services;
}
+void
+BL::GenericGui::deleteDockWidget()
+{
+ // Specific for SALOME...
+ _dock_parent->removeDockWidget(_dw_summary);
+ delete _dw_summary;
+ _dock_parent->removeDockWidget(_dw_resource_catalog);
+ delete _dw_resource_catalog;
+ _dock_parent->removeDockWidget(_jobs_manager);
+ delete _jobs_manager;
+}
+
void
BL::GenericGui::showDockWidgets(bool isVisible)
{
BL::SalomeGui::~SalomeGui()
{
DEBTRACE("Destroying BL::SalomeGui");
+ if (getApp())
+ disconnect(getApp(), SIGNAL(studyClosed()), this, SLOT(studyClosed()));
+ if (_gengui)
+ delete _gengui;
}
void
{
DEBTRACE("Entering in initialize");
SalomeApp_Module::initialize(app); // MANDATORY -> Otherwise SISEGV...
- BL::MainWindows_SALOME::initialize(getApp());
+ connect( getApp(), SIGNAL(studyClosed()), this, SLOT(studyClosed()));
+}
- _gengui = new BL::GenericGui(this);
- _gengui->createActions();
- _gengui->createMenus();
- _gengui->updateButtonsStates();
+void
+BL::SalomeGui::studyClosed()
+{
+ if (_gengui)
+ {
+ _gengui->deleteDockWidget();
+ delete _gengui;
+ _gengui = NULL;
+ }
}
bool
{
DEBTRACE("Entering in BL::SalomeGui::activateModule");
+ if (!_gengui)
+ {
+ BL::MainWindows_SALOME::initialize(getApp());
+ _gengui = new BL::GenericGui(this);
+ _gengui->createActions();
+ _gengui->createMenus();
+ _gengui->updateButtonsStates();
+ }
+
bool bOk = SalomeApp_Module::activateModule(theStudy);
setMenuShown(true);
-
_gengui->showDockWidgets(true);
return bOk;
}
BL::SalomeGui::deactivateModule(SUIT_Study* theStudy)
{
DEBTRACE("Entering in BL::SalomeGui::deactivateModule");
-
setMenuShown(false);
- _gengui->showDockWidgets(false);
+ if (_gengui)
+ _gengui->showDockWidgets(false);
bool bOk = SalomeApp_Module::deactivateModule(theStudy);
return bOk;
}