From: vsv Date: Mon, 7 Sep 2015 09:31:32 +0000 (+0300) Subject: Processing "Move to the end" event X-Git-Tag: V_1.4.0_beta4~98 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d954d40632e449ce0e96f31755239f2344347239;p=modules%2Fshaper.git Processing "Move to the end" event --- diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 73889e19a..ad3ce3ea8 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -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); diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index 76fc27da0..5aec6885c 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -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& theMess #endif } } + } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_ORDER_UPDATED)) { + std::shared_ptr aUpdMsg = + std::dynamic_pointer_cast(theMessage); + std::set aObjects = aUpdMsg->objects(); + + std::set::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) {