Salome HOME
Fix for the issue #910: never fully remove the results, just make them disabled when...
[modules/shaper.git] / src / PartSet / PartSet_DocumentDataModel.cpp
index 3ffc164cb2c53c91252970d7d74b728f75426b13..84ac7a1697ea1820628022c43d0111c696a38c67 100644 (file)
@@ -289,7 +289,20 @@ QVariant PartSet_DocumentDataModel::data(const QModelIndex& theIndex, int theRol
           case Qt::DecorationRole:
             return featureIcon(aFeature);
           case Qt::ToolTipRole:
-            return tr("Feature object");
+            {
+              ResultPtr aResult = aFeature->firstResult();
+              bool isResultAndNotLoaded = false;
+              if( aResult.get() )
+              {
+                ResultPartPtr aResultPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>( aResult );
+                if( aResultPart.get() )
+                  isResultAndNotLoaded = !aResultPart->isActivated();
+              }
+              if( isResultAndNotLoaded )
+                return tr( "The part should be activated before the user may edit it" );
+              else
+                return tr( "Feature object" );
+            }
           case Qt::ForegroundRole:
             if (theIndex.row() > lastHistoryRow())
               return QBrush(Qt::lightGray);
@@ -802,6 +815,8 @@ void PartSet_DocumentDataModel::onMouseDoubleClick(const QModelIndex& theIndex)
 {
   if (theIndex.column() != 1)
     return;
+  if (flags(theIndex) == 0)
+    return;
   QTreeView* aTreeView = dynamic_cast<QTreeView*>(sender());
   if ((theIndex.internalId() >= PartsFolder) && (theIndex.internalId() <= PartResult)) {
     if (myActivePartModel)