-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <QMenu>
#include <QToolBar>
-#define SALOME_PATCH_FOR_CTRL_WHEEL
+#if OCC_VERSION_HEX < 0x070400
+ #define SALOME_PATCH_FOR_CTRL_WHEEL
+#endif
extern "C" {
SHAPERGUI_EXPORT CAM_Module* createModule()
SHAPERGUI::SHAPERGUI()
: LightApp_Module("SHAPER"),
mySelector(0), myIsOpened(0), myPopupMgr(0), myIsInspectionVisible(false),
- myInspectionPanel(0), myIsToolbarsModified(false)
+ myInspectionPanel(0), myIsFacesPanelVisible(false), myIsToolbarsModified(false)
{
myWorkshop = new XGUI_Workshop(this);
connect(myWorkshop, SIGNAL(commandStatusUpdated()),
}
int aMenu = createMenu(tr("Inspection"), -1, -1, 30);
- int aSubMenu = createMenu(tr("Information"), aMenu);
+ int aSubMenu = createMenu(tr("Information"), aMenu, -1, -1, 0);
int aId = getNextCommandId();
myActionsList.append(aId);
myWhatIsAction->setData("INSPECTION_CMD");
createMenu(aId, aSubMenu, 0);
- QString aToolName = tr("Inspection tool");
+ QString aToolName = tr("Inspection");
int aTool = createTool(aToolName);
int aToolId = createTool(myWhatIsAction, aTool);
registerCommandToolbar(aToolName, aId);
QObject* aObj = myWorkshop->objectBrowser()->parent();
QDockWidget* aObjDoc = dynamic_cast<QDockWidget*>(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);
+
+ myWorkshop->facesPanel()->toggleViewAction()->setVisible(true);
+ if (myIsFacesPanelVisible)
+ myWorkshop->facesPanel()->show();
+ myWorkshop->propertyPanel()->toggleViewAction()->setVisible(true);
if (!mySelector) {
ViewManagerList OCCViewManagers;
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);
+
+ myIsFacesPanelVisible = myWorkshop->facesPanel()->isVisible();
+ myWorkshop->facesPanel()->hide();
+ myWorkshop->facesPanel()->toggleViewAction()->setVisible(false);
+
+ myWorkshop->propertyPanel()->hide();
+ myWorkshop->propertyPanel()->toggleViewAction()->setVisible(false);
// the active operation should be stopped for the next activation.
// There should not be active operation and visualized preview.
//}
myWorkshop->displayer()->setSelectionColor(myOldSelectionColor);
myProxyViewer->setSelector(0);
+
+ LightApp_SelectionMgr* aMgr = getApp()->selectionMgr();
+ QList<SUIT_Selector*> aList;
+ aMgr->selectors(aList);
+ foreach(SUIT_Selector* aSel, aList) {
+ aSel->setEnabled(aSel != mySelector);
+ }
+
delete mySelector;
mySelector = 0;
}
connect(getApp()->action(LightApp_Application::FileSaveAsId), SIGNAL(triggered(bool)),
getApp(), SLOT(onSaveAsDoc()));
+ publishToStudy();
+
return LightApp_Module::deactivateModule(theStudy);
}
QAction* SHAPERGUI::addDesktopCommand(const QString& theId, const QString& theTitle,
const QString& theTip, const QIcon& theIcon,
const QKeySequence& theKeys, bool isCheckable,
- const char* theMenuSourceText, const int theMenuPosition)
+ const char* theMenuSourceText,
+ const QString& theSubMenu,
+ const int theMenuPosition,
+ const int theSuibMenuPosition)
{
int aMenu = createMenu(tr(theMenuSourceText), -1, -1);
+ if (!theSubMenu.isNull())
+ aMenu = createMenu(theSubMenu, aMenu, -1, theSuibMenuPosition);
int aId = getNextCommandId();
myActionsList.append(aId);
SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
aResMgr->remove(ToolbarsSection);
}
+
+void SHAPERGUI::publishToStudy()
+{
+ if (isActiveModule())
+ myWorkshop->module()->launchOperation("PublishToStudy", false);
+}