//******************************************************
SHAPERGUI::SHAPERGUI()
: LightApp_Module("SHAPER"),
- mySelector(0), myIsOpened(0), myPopupMgr(0)
+ mySelector(0), myIsOpened(0), myPopupMgr(0), myIsInspectionVisible(false),
+ myInspectionPanel(0)
{
myWorkshop = new XGUI_Workshop(this);
connect(myWorkshop, SIGNAL(commandStatusUpdated()),
//******************************************************
SHAPERGUI::~SHAPERGUI()
{
+ delete myWorkshop;
+ delete myProxyViewer;
}
//******************************************************
{
connect(anApp, SIGNAL(preferenceResetToDefaults()), this, SLOT(onDefaultPreferences()));
}
+
+ int aMenu = createMenu(tr("Inspection"), -1, -1, 30);
+ int aSubMenu = createMenu(tr("Information"), aMenu);
+
+ int aId = myActionsList.size();
+ myActionsList.append("INSPECTION_CMD");
+ SUIT_Desktop* aDesk = application()->desktop();
+ QString aTip = tr("Show inspection window");
+ myWhatIsAction = createAction(aId, aTip, QIcon(":pictures/whatis.png"), tr("What Is"),
+ aTip, QKeySequence(), aDesk, true, this, SLOT(onWhatIs(bool)));
+ myWhatIsAction->setStatusTip(aTip);
+ myWhatIsAction->setData("INSPECTION_CMD");
+ createMenu(aId, aSubMenu, 0);
+
+ int aTool = createTool(tr("Inspection tool"));
+ int aToolId = createTool(myWhatIsAction, aTool);
}
//******************************************************
desktop()->tabifyDockWidget(aObjDoc, myWorkshop->propertyPanel());
}
- QDockWidget* aInspection = myWorkshop->inspectionPanel();
- if (aInspection) {
- QAction* aViewAct = aInspection->toggleViewAction();
- aViewAct->setEnabled(true);
- aInspection->setVisible(true);
+ if (!myInspectionPanel) {
+ myInspectionPanel = myWorkshop->inspectionPanel();
+ QAction* aViewAct = myInspectionPanel->toggleViewAction();
+ connect(aViewAct, SIGNAL(toggled(bool)), this, SLOT(onWhatIs(bool)));
}
+ myInspectionPanel->toggleViewAction()->setEnabled(true);
if (!mySelector) {
ViewManagerList OCCViewManagers;
QAction* aViewAct = aObjDoc->toggleViewAction();
aViewAct->setEnabled(false);
}
- QDockWidget* aInspection = myWorkshop->inspectionPanel();
- if (aInspection) {
- aInspection->setVisible(false);
- QAction* aViewAct = aInspection->toggleViewAction();
- aViewAct->setEnabled(false);
- }
+
+ myIsInspectionVisible = myInspectionPanel->isVisible();
+ myInspectionPanel->hide();
+ QAction* aViewAct = myInspectionPanel->toggleViewAction();
+ aViewAct->setEnabled(false);
// the active operation should be stopped for the next activation.
// There should not be active operation and visualized preview.
{
myWorkshop->menuMgr()->createFeatureActions();
}
+
+void SHAPERGUI::onWhatIs(bool isToggled)
+{
+ if (sender() == myWhatIsAction) {
+ QAction* aViewAct = myInspectionPanel->toggleViewAction();
+ aViewAct->blockSignals(true);
+ aViewAct->setChecked(isToggled);
+ aViewAct->blockSignals(false);
+ myInspectionPanel->setVisible(isToggled);
+ }
+ else {
+ myWhatIsAction->blockSignals(true);
+ myWhatIsAction->setChecked(isToggled);
+ myWhatIsAction->blockSignals(false);
+ myInspectionPanel->setVisible(isToggled);
+ }
+}
+
+void SHAPERGUI::updateModuleVisibilityState()
+{
+ LightApp_Module::updateModuleVisibilityState();
+ onWhatIs(myIsInspectionVisible);
+}