]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Processing "Move to the end" event
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 7 Sep 2015 09:31:32 +0000 (12:31 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 7 Sep 2015 09:31:32 +0000 (12:31 +0300)
src/XGUI/XGUI_ContextMenuMgr.cpp
src/XGUI/XGUI_DataModel.cpp

index 73889e19a89ce15912144e87ad9a2626d8908ca2..ad3ce3ea8e4b537be2190ecc55ed9e7c06654b3b 100644 (file)
@@ -60,7 +60,7 @@ void XGUI_ContextMenuMgr::createActions()
   addAction("RENAME_CMD", aAction);
   connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onRename()));
 
-  aAction = new QAction(QIcon(":pictures/move.png"), tr("Move down"), this);
+  aAction = new QAction(QIcon(":pictures/move.png"), tr("Move to the end"), this);
   addAction("MOVE_CMD", aAction);
 
   aAction = new QAction(QIcon(":pictures/color.png"), tr("Color..."), this);
index 76fc27da027fa7d9c895b428f7a6f16d64b65487..5aec6885cc0d3e5a886470598179a5d076cad40c 100644 (file)
@@ -64,6 +64,7 @@ XGUI_DataModel::XGUI_DataModel(QObject* theParent) : ModuleBase_IDocumentDataMod
   Events_Loop* aLoop = Events_Loop::loop();
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED));
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_DELETED));
+  aLoop->registerListener(this, Events_Loop::eventByName(EVENT_ORDER_UPDATED));
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_DOCUMENT_CHANGED));
 }
 
@@ -205,6 +206,21 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
 #endif
       }
     }
+  } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_ORDER_UPDATED)) {
+    std::shared_ptr<ModelAPI_ObjectUpdatedMessage> aUpdMsg =
+        std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
+    std::set<ObjectPtr> aObjects = aUpdMsg->objects();
+
+    std::set<ObjectPtr>::const_iterator aIt;
+    std::string aObjType;
+    for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) {
+      ObjectPtr aObject = (*aIt);
+      // We do not show objects which not has to be shown in object browser
+      if (!aObject->isInHistory())
+        continue;
+      QModelIndex aIndex = objectIndex(aObject);
+      QModelIndex aParent = parent(aIndex);
+    }
   } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_DOCUMENT_CHANGED)) {
     DocumentPtr aDoc = ModelAPI_Session::get()->activeDocument();
     if (aDoc != aRootDoc) {