From: sbh Date: Thu, 22 May 2014 09:46:23 +0000 (+0400) Subject: Merge branch 'master' of newgeom:newgeom.git X-Git-Tag: V_0.2~29 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=503b5444d4a5fa95a3046a754f69f5b79e677e33;p=modules%2Fshaper.git Merge branch 'master' of newgeom:newgeom.git Conflicts: src/XGUI/XGUI_Workshop.h --- 503b5444d4a5fa95a3046a754f69f5b79e677e33 diff --cc src/XGUI/XGUI_Workshop.cpp index cb7a3c790,65450b189..9d064f210 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@@ -200,11 -204,27 +204,29 @@@ void XGUI_Workshop::processEvent(const static Events_ID aFeatureLoadedId = Events_Loop::loop()->eventByName(EVENT_FEATURE_LOADED); if (theMessage->eventID() == aFeatureLoadedId) { const Config_FeatureMessage* aFeatureMsg = dynamic_cast(theMessage); - addFeature(aFeatureMsg); + if(!aFeatureMsg->isInternal()) { + addFeature(aFeatureMsg); + } return; } + // Process creation of Part + if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_CREATED)) { + const Model_FeatureUpdatedMessage* aUpdMsg = dynamic_cast(theMessage); + FeaturePtr aFeature = aUpdMsg->feature(); + if (aFeature->getKind() == "Part") { + //The created part will be created in Object Browser later and we have to activate it + // only when it is created everywere + QTimer::singleShot(50, this, SLOT(activateLastPart())); + } + } + + // Process deletion of a part + if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_DELETED)) { + PluginManagerPtr aMgr = ModelAPI_PluginManager::get(); + if (aMgr->currentDocument() == aMgr->rootDocument()) + activatePart(FeaturePtr()); // Activate PartSet + } + //Update property panel on corresponding message. If there is no current operation (no //property panel), or received message has different feature to the current - do nothing. static Events_ID aFeatureUpdatedId = Events_Loop::loop()->eventByName(EVENT_FEATURE_UPDATED); diff --cc src/XGUI/XGUI_Workshop.h index 306e6d644,21ee4a87b..8ffb703b8 --- a/src/XGUI/XGUI_Workshop.h +++ b/src/XGUI/XGUI_Workshop.h @@@ -153,10 -158,7 +158,6 @@@ private // Creates Dock widgets: Object browser and Property panel void createDockWidgets(); - //! Activates or deactivates currently selected part - void activatePart(bool toActivate); - - QString myCurrentDir; - QString myCurrentFile; XGUI_MainWindow* myMainWindow; XGUI_Module* myPartSetModule; XGUI_ObjectsBrowser* myObjectBrowser; @@@ -170,6 -172,6 +171,7 @@@ XGUI_ViewerProxy* myViewerProxy; XGUI_ContextMenuMgr* myContextMenuMgr; ++ QString myCurrentDir; static QMap myIcons; };