static Events_ID aFeatureLoadedId = Events_Loop::loop()->eventByName(EVENT_FEATURE_LOADED);
if (theMessage->eventID() == aFeatureLoadedId) {
const Config_FeatureMessage* aFeatureMsg = dynamic_cast<const Config_FeatureMessage*>(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<const Model_FeatureUpdatedMessage*>(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);
// 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;
XGUI_ViewerProxy* myViewerProxy;
XGUI_ContextMenuMgr* myContextMenuMgr;
++ QString myCurrentDir;
static QMap<QString, QString> myIcons;
};