Salome HOME
Fix for the issue #593: do not remove naming attribute, but use TNaming_Builder for...
[modules/shaper.git] / src / NewGeom / NewGeom_Module.cpp
index 6e27289e38c5230b8e80f8ef95b9576339a65b2e..8265e654c66668f3b30c4acf870cb8d99f3b802a 100644 (file)
@@ -165,7 +165,9 @@ bool NewGeom_Module::activateModule(SUIT_Study* theStudy)
       myWorkshop->objectBrowser()->rebuildDataTree();
       myWorkshop->updateCommandStatus();
       myIsOpened = false;
-      QTimer::singleShot(1000, myWorkshop, SLOT(displayAllResults()));
+      // the display all results is not necessary anymore, it was commented in XGUI_Workshop,
+      // so it should be commented here
+      //QTimer::singleShot(1000, myWorkshop, SLOT(displayAllResults()));
     }
     else
       myWorkshop->updateCommandStatus();
@@ -205,9 +207,11 @@ bool NewGeom_Module::activateModule(SUIT_Study* theStudy)
         }
       }
       if (!aFound) {
-        aDisp->erase(aObj, false);
+        aObj->setDisplayed(false);
+        //aDisp->erase(aObj, false);
       }
     }
+    Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
   }
 
   return isDone;
@@ -269,7 +273,11 @@ void NewGeom_Module::onViewManagerRemoved(SUIT_ViewManager* theMgr)
     if (theMgr->getType() == OCCViewer_Viewer::Type()) {
       OCCViewer_Viewer* aViewer = static_cast<OCCViewer_Viewer*>(theMgr->getViewModel());
       if (mySelector->viewer() == aViewer) {
-        myWorkshop->displayer()->eraseAll(false);
+        XGUI_Displayer* aDisp = myWorkshop->displayer();
+        QObjectPtrList aObjects = aDisp->displayedObjects();
+        foreach(ObjectPtr aObj, aObjects)
+          aObj->setDisplayed(false);
+        Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
         myProxyViewer->setSelector(0);
         delete mySelector;
         mySelector = 0;
@@ -341,7 +349,8 @@ QAction* NewGeom_Module::addFeature(const QString& theWBName, const ActionInfo&
                     theInfo.text,
                     theInfo.toolTip,
                     theInfo.icon,
-                    theInfo.shortcut);
+                    theInfo.shortcut,
+                    theInfo.checkable);
 }
 
 //******************************************************
@@ -505,7 +514,7 @@ void NewGeom_Module::selectionChanged()
 //******************************************************
 void NewGeom_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle)
 {
-  myWorkshop->contextMenuMgr()->addViewerItems(theMenu);
+  myWorkshop->contextMenuMgr()->addViewerMenu(theMenu);
   LightApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
 }