From: vsv Date: Tue, 25 Aug 2015 09:28:07 +0000 (+0300) Subject: Do not change history in ObjectBrowser if an operation is opened X-Git-Tag: V_1.4.0_beta4~255 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d9359acfaf1fa39e052d117c30af8a28e117b78d;p=modules%2Fshaper.git Do not change history in ObjectBrowser if an operation is opened --- diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index 2f0672cfe..344b4bfc3 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -644,6 +644,9 @@ Qt::ItemFlags XGUI_DataModel::flags(const QModelIndex& theIndex) const aObj = (ModelAPI_Object*) theIndex.internalPointer(); } if (aObj) { + if (aObj->isDisabled()) + return Qt::ItemFlags(); + bool isCompositeSub = false; if (theIndex.column() == 1) { ObjectPtr aObjPtr = aObj->data()->owner(); @@ -664,12 +667,9 @@ Qt::ItemFlags XGUI_DataModel::flags(const QModelIndex& theIndex) const // An object which is sub-object of a composite object can not be accessible in column 1 if (isCompositeSub) return Qt::ItemFlags(); + } - aFlags |= Qt::ItemIsEditable; - if (!aObj->isDisabled()) - aFlags |= Qt::ItemIsEnabled; - } else - aFlags |= Qt::ItemIsEnabled; + aFlags |= Qt::ItemIsEnabled; return aFlags; } diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index 4846e2237..9a28b3292 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -130,12 +130,15 @@ void XGUI_DataTree::onDoubleClick(const QModelIndex& theIndex) { if (theIndex.column() != 1) return; + SessionPtr aMgr = ModelAPI_Session::get(); + // When operation is opened then we can not change history + if (aMgr->isOperation()) + return; ModuleBase_IDocumentDataModel* aModel = dataModel(); if (aModel->flags(theIndex) == 0) return; ObjectPtr aObj = aModel->object(theIndex); - SessionPtr aMgr = ModelAPI_Session::get(); DocumentPtr aDoc = aMgr->activeDocument(); QModelIndex aOldIndex = aModel->lastHistoryIndex();