From fce0c0fa8dd3bd2c24a5d0d5c6f24cad99115d98 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 2 Apr 2020 14:10:47 +0300 Subject: [PATCH 1/1] bos #18834 When SHAPER is deactivated, its panel should not be available in desktop, even via menu (part 1) --- src/SHAPERGUI/SHAPERGUI.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index ee1b07deb..51ff98cd9 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -269,19 +269,17 @@ bool SHAPERGUI::activateModule(SUIT_Study* theStudy) QObject* aObj = myWorkshop->objectBrowser()->parent(); QDockWidget* aObjDoc = dynamic_cast(aObj); if (aObjDoc) { - QAction* aViewAct = aObjDoc->toggleViewAction(); - aViewAct->setEnabled(true); myWorkshop->objectBrowser()->setVisible(true); aObjDoc->setVisible(true); desktop()->tabifyDockWidget(aObjDoc, myWorkshop->propertyPanel()); + aObjDoc->toggleViewAction()->setVisible(true); } if (!myInspectionPanel) { myInspectionPanel = myWorkshop->inspectionPanel(); - QAction* aViewAct = myInspectionPanel->toggleViewAction(); - connect(aViewAct, SIGNAL(toggled(bool)), this, SLOT(onWhatIs(bool))); + connect(myInspectionPanel->toggleViewAction(), SIGNAL(toggled(bool)), this, SLOT(onWhatIs(bool))); } - myInspectionPanel->toggleViewAction()->setEnabled(true); + myInspectionPanel->toggleViewAction()->setVisible(true); if (!mySelector) { ViewManagerList OCCViewManagers; @@ -389,14 +387,12 @@ bool SHAPERGUI::deactivateModule(SUIT_Study* theStudy) if (aObjDoc) { aObjDoc->setVisible(false); myWorkshop->objectBrowser()->setVisible(false); - QAction* aViewAct = aObjDoc->toggleViewAction(); - aViewAct->setEnabled(false); + aObjDoc->toggleViewAction()->setVisible(false); } myIsInspectionVisible = myInspectionPanel->isVisible(); myInspectionPanel->hide(); - QAction* aViewAct = myInspectionPanel->toggleViewAction(); - aViewAct->setEnabled(false); + myInspectionPanel->toggleViewAction()->setVisible(false); // the active operation should be stopped for the next activation. // There should not be active operation and visualized preview. -- 2.39.2