]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'Dev_0.6' of newgeom:newgeom into Dev_0.6
authormpv <mikhail.ponikarov@opencascade.com>
Mon, 8 Dec 2014 07:16:44 +0000 (10:16 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Mon, 8 Dec 2014 07:16:44 +0000 (10:16 +0300)
src/ModuleBase/ModuleBase_ModelWidget.h
src/ModuleBase/ModuleBase_Operation.cpp
src/ModuleBase/ModuleBase_WidgetLabel.h

index 9f55dab1e56e48bc4799670bfb66a4c56f53ab5a..c8a91fb93a04f42b2d04c4377bc065c35154fd2b 100644 (file)
@@ -51,6 +51,10 @@ Q_OBJECT
   /// Defines if it is supposed that the widget should interact with the viewer.
   virtual bool isViewerSelector() { return false; }
 
+  /// Defines if it is supported to set the value in this widget
+  /// By default it returns true
+  virtual bool canSetValue() const { return true; };
+
   /// Set the given wrapped value to the current widget
   /// This value should be processed in the widget according to the needs
   /// \param theValue the wrapped widget value
index 5ee3daa6e6f8d88dc18427c03ed76542a05c4d52..eca9c1c2ae9097aa802bee7b97d48c91c4cfa9ce 100644 (file)
@@ -247,9 +247,13 @@ bool ModuleBase_Operation::activateByPreselection()
   bool isSet = false;
   for (aWIt = aWidgets.constBegin(), aPIt = myPreSelection.constBegin();
        (aWIt != aWidgets.constEnd()) && (aPIt != myPreSelection.constEnd());
-       ++aWIt, ++aPIt) {
+       ++aWIt) {
     aWgt = (*aWIt);
     ModuleBase_WidgetValueFeature* aValue = (*aPIt);
+    if (!aWgt->canSetValue())
+      continue;
+
+    ++aPIt;
     if (!aWgt->setValue(aValue)) {
       isSet = false;
       break;
index 81c7be59239fa714ae81ed2c170a6eb335392a55..7935316dace0ce9fe9eabe8e36af1c3e326c96b3 100644 (file)
@@ -19,6 +19,10 @@ Q_OBJECT
 
   virtual ~ModuleBase_WidgetLabel();
 
+  /// Defines if it is supported to set the value in this widget
+  /// It returns false because this is an info widget
+  virtual bool canSetValue() const { return false; };
+
   virtual bool storeValue() const
   {
     return true;