From 4725b6d71721fcbfc2172f4cca67af92cd14854e Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 14 Sep 2022 19:10:41 +0300 Subject: [PATCH] [bos #29098] Help panel for SHAPER module. Eliminate the limitation on store/restore GUI states of Shaper module. --- src/SHAPERGUI/SHAPERGUI.cpp | 18 ++++++++++-------- src/XGUI/XGUI_Workshop.cpp | 5 ++++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index e8850f627..acc61de03 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -335,14 +335,6 @@ bool SHAPERGUI::activateModule(SUIT_Study* theStudy) myIsEditEnabled = getApp()->isEditEnabled(); getApp()->setEditEnabled(false); - // this following row is caused by #187 bug. - // SALOME saves the dock widget positions before deactivateModule() and - // load it after the module activation. So, if the panel is visible before - // deactivate, it becomes visible after activate. - // In order to avoid the visible property panel, the widget position save is - // switch off in this module - aResMgr->setValue("Study", "store_positions", false); - // Synchronize displayed objects Handle(AIS_InteractiveContext) aContext; if (mySelector && mySelector->viewer()) @@ -1058,6 +1050,16 @@ void SHAPERGUI::updateModuleVisibilityState() { LightApp_Module::updateModuleVisibilityState(); onWhatIs(myIsInspectionVisible); + + // the following code is caused by #187 bug. + // SALOME saves the dock widget positions before deactivateModule() and + // load it after the module activation. So, if the panel is visible before + // deactivate, it becomes visible after activate. + // In order to avoid the visible property panel, we hide it here + ModuleBase_Operation* anOperation = myWorkshop->module()->currentOperation(); + if (!anOperation) { + myWorkshop->hidePanel(myWorkshop->propertyPanel()); + } } void SHAPERGUI::onEditToolbars() diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 8859ef654..124ac7bc1 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1728,11 +1728,14 @@ void XGUI_Workshop::showPanel(QDockWidget* theDockWidget) //****************************************************** void XGUI_Workshop::hidePanel(QDockWidget* theDockWidget) { - if (theDockWidget && theDockWidget == myPropertyPanel) { + if (!theDockWidget) return; + + if (theDockWidget == myPropertyPanel) { QAction* aViewAct = theDockWidget->toggleViewAction(); ///setEnabled(false); } + theDockWidget->hide(); // the property panel is active window of the desktop, when it is -- 2.39.2