From: jfa Date: Wed, 14 Sep 2022 16:10:41 +0000 (+0300) Subject: [bos #29098] Help panel for SHAPER module. Eliminate the limitation on store/restore... X-Git-Tag: V9_10_0a1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4725b6d71721fcbfc2172f4cca67af92cd14854e;p=modules%2Fshaper.git [bos #29098] Help panel for SHAPER module. Eliminate the limitation on store/restore GUI states of Shaper module. --- 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