]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #660 Move Group is still not implemented
authornds <natalia.donis@opencascade.com>
Mon, 6 Jul 2015 13:35:15 +0000 (16:35 +0300)
committernds <natalia.donis@opencascade.com>
Mon, 6 Jul 2015 13:35:15 +0000 (16:35 +0300)
canMoveFeature is realized to enable/disable popup menu.

src/XGUI/XGUI_ContextMenuMgr.cpp
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h

index bd1f2012fab765c247f8aebe29090346f04bdc2e..8da4ebda28455e529d251aa028209ec78aff7918 100644 (file)
@@ -188,7 +188,9 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu()
           if (!(hasParameter || hasFeature))
             action("SHOW_ONLY_CMD")->setEnabled(true);
         }
-      } 
+        else if (hasFeature && myWorkshop->canMoveFeature())
+          action("MOVE_CMD")->setEnabled(true);
+      }
     } else {
       if (hasResult && (!hasParameter)) {
         action("SHOW_CMD")->setEnabled(true);
@@ -200,9 +202,6 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu()
     }
     if (hasFeature || hasParameter)
       action("DELETE_CMD")->setEnabled(true);
-
-    if (hasFeature || hasParameter)
-      action("MOVE_CMD")->setEnabled(true);
   }
   if (myWorkshop->canChangeColor())
     action("COLOR_CMD")->setEnabled(true);
@@ -294,6 +293,9 @@ void XGUI_ContextMenuMgr::buildObjBrowserMenu()
   aList.append(action("DELETE_CMD"));
   aList.append(action("MOVE_CMD"));
   myObjBrowserMenus[ModelAPI_Feature::group()] = aList;
+
+  aList.clear();
+  aList.append(action("DELETE_CMD"));
   myObjBrowserMenus[ModelAPI_ResultParameter::group()] = aList;
   //-------------------------------------
 }
@@ -348,7 +350,7 @@ QMenu* XGUI_ContextMenuMgr::objBrowserMenu() const
       aActions.append(action("SHOW_ONLY_CMD"));
       aActions.append(mySeparator);
       aActions.append(action("DELETE_CMD"));
-      aActions.append(action("MOVE_CMD"));
+      //aActions.append(action("MOVE_CMD"));
   }
   aMenu->addActions(aActions);
 
index 2614975ff2cc7627f739089299de12cc426cfb91..13f54667788a77b2628161a3d3b1e1861b8c00f6 100644 (file)
@@ -1229,6 +1229,12 @@ bool hasResults(QObjectPtrList theObjects, const std::set<std::string>& theTypes
   return isFoundResultType;
 }
 
+//**************************************************************
+bool XGUI_Workshop::canMoveFeature()
+{
+  return true;
+}
+
 //**************************************************************
 bool XGUI_Workshop::canChangeColor() const
 {
index 79abe20b902c0bb808a765e95119e561818d0ffe..8b44268d0d8442b10a1238b0eee6195826a42133 100644 (file)
@@ -163,6 +163,10 @@ Q_OBJECT
   //! Delete features
   void deleteObjects();
 
+  //! Returns true if the selected feature can be moved to the position after the current feature
+  //! \return boolean value
+  bool canMoveFeature();
+
   //! Move selected features to be after the current feature
   void moveObjects();