X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNewGeom%2FNewGeom_Module.cpp;h=fc07f5d55bf7f280db540e4aed232fa1fc4e5585;hb=2b4f4bf278c841500eb29bb5d204690427b0d56b;hp=7ef9d61f18c100692f12f54a3bec8d58f1196d1c;hpb=13386fb08ef3453b9560d9459ce72885ef9a0afb;p=modules%2Fshaper.git diff --git a/src/NewGeom/NewGeom_Module.cpp b/src/NewGeom/NewGeom_Module.cpp index 7ef9d61f1..fc07f5d55 100644 --- a/src/NewGeom/NewGeom_Module.cpp +++ b/src/NewGeom/NewGeom_Module.cpp @@ -5,18 +5,24 @@ #include "NewGeom_OCCSelector.h" #include +#include +#include #include #include #include #include -#include +#include #include #include +#include #include +#include +#include + extern "C" { NewGeom_EXPORT CAM_Module* createModule() { return new NewGeom_Module(); @@ -76,10 +82,22 @@ bool NewGeom_Module::activateModule(SUIT_Study* theStudy) mySelector = createSelector(OCCViewManagers.first()); } } + myWorkshop->propertyPanel()->hide(); + QtxPopupMgr* aMgr = popupMgr(); // Create popup manager + action(myEraseAll)->setEnabled(false); } return isDone; } +//****************************************************** +bool NewGeom_Module::deactivateModule(SUIT_Study* theStudy) +{ + setMenuShown( false ); + setToolShown( false ); + //myWorkshop->contextMenuMgr()->disconnectViewer(); + return LightApp_Module::deactivateModule(theStudy); +} + //****************************************************** void NewGeom_Module::onViewManagerAdded( SUIT_ViewManager* theMgr ) { @@ -107,14 +125,6 @@ NewGeom_OCCSelector* NewGeom_Module::createSelector(SUIT_ViewManager* theMgr) return 0; } -//****************************************************** -bool NewGeom_Module::deactivateModule(SUIT_Study* theStudy) -{ - setMenuShown( false ); - setToolShown( false ); - return LightApp_Module::deactivateModule(theStudy); -} - //****************************************************** CAM_DataModel* NewGeom_Module::createDataModel() { @@ -122,15 +132,13 @@ CAM_DataModel* NewGeom_Module::createDataModel() } //****************************************************** -void NewGeom_Module::addFeature(const QString& theWBName, - const QString& theId, - const QString& theTitle, - const QString& theTip, - const QIcon& theIcon, - bool isCheckable, - QObject* theReciever, - const char* theMember, - const QKeySequence& theKeys) +QAction* NewGeom_Module::addFeature(const QString& theWBName, + const QString& theId, + const QString& theTitle, + const QString& theTip, + const QIcon& theIcon, + const QKeySequence& theKeys, + bool isCheckable) { int aMenu = createMenu(theWBName, -1, -1, 50); int aTool = createTool(theWBName); @@ -141,21 +149,21 @@ void NewGeom_Module::addFeature(const QString& theWBName, int aKeys = 0; for (int i = 0; i < theKeys.count(); i++) aKeys += theKeys[i]; - createAction(aId, theTip, theIcon, theTitle, theTip, aKeys, aDesk, - isCheckable, theReciever, theMember); + QAction* aAction = createAction(aId, theTip, theIcon, theTitle, theTip, aKeys, aDesk, + isCheckable); + aAction->setData(theId); int aItemId = createMenu( aId, aMenu, -1, 10 ); int aToolId = createTool( aId, aTool ); + return aAction; } //****************************************************** -void NewGeom_Module::addEditCommand(const QString& theId, - const QString& theTitle, - const QString& theTip, - const QIcon& theIcon, - bool isCheckable, - QObject* theReciever, - const char* theMember, - const QKeySequence& theKeys) +QAction* NewGeom_Module::addEditCommand(const QString& theId, + const QString& theTitle, + const QString& theTip, + const QIcon& theIcon, + const QKeySequence& theKeys, + bool isCheckable) { int aMenu = createMenu(tr( "MEN_DESK_EDIT" ), -1, -1); @@ -165,9 +173,11 @@ void NewGeom_Module::addEditCommand(const QString& theId, int aKeys = 0; for (int i = 0; i < theKeys.count(); i++) aKeys += theKeys[i]; - createAction(aId, theTip, theIcon, theTitle, theTip, aKeys, aDesk, - isCheckable, theReciever, theMember); + QAction* aAction = createAction(aId, theTip, theIcon, theTitle, theTip, aKeys, aDesk, + isCheckable); + aAction->setData(theId); createMenu( aId, aMenu, 10 ); + return aAction; } //****************************************************** @@ -177,6 +187,21 @@ void NewGeom_Module::addEditMenuSeparator() createMenu( separator(), aMenu, -1, 10 ); } +//****************************************************** +QList NewGeom_Module::commandList() const +{ + QList aActions; + for (int i = 0; i < myActionsList.size(); i++) + aActions.append(action(i)); + return aActions; +} + +//****************************************************** +QStringList NewGeom_Module::commandIdList() const +{ + return myActionsList; +} + //****************************************************** QMainWindow* NewGeom_Module::desktop() const { @@ -222,3 +247,10 @@ void NewGeom_Module::selectionChanged() LightApp_Module::selectionChanged(); myWorkshop->salomeViewerSelectionChanged(); } + +//****************************************************** +void NewGeom_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle) +{ + myWorkshop->contextMenuMgr()->addViewerItems(theMenu); + LightApp_Module::contextMenuPopup(theClient, theMenu, theTitle); +} \ No newline at end of file