]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Boolean correction: clean the validation cash by other widget value change if it...
authornds <nds@opencascade.com>
Mon, 15 Feb 2016 13:06:11 +0000 (16:06 +0300)
committerdbv <dbv@opencascade.com>
Tue, 16 Feb 2016 14:04:47 +0000 (17:04 +0300)
src/ModuleBase/ModuleBase_WidgetValidated.cpp
src/ModuleBase/ModuleBase_WidgetValidated.h
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h

index 0dab2cee1fe64a4a32a37fdcddaa1f5c4944d361..89315cd4b829db1413656b9e16f19ba008910b51 100644 (file)
@@ -60,6 +60,13 @@ ObjectPtr ModuleBase_WidgetValidated::findPresentedObject(const AISObjectPtr& th
   return myPresentedObject;
 }
 
+//********************************************************************
+void ModuleBase_WidgetValidated::clearValidatedCash()
+{
+  myValidPrs.clear();
+  myInvalidPrs.clear();
+}
+
 //********************************************************************
 void ModuleBase_WidgetValidated::storeAttributeValue()
 {
index 60ed4edc9551367d7f288f28bee1d8808046e04b..ecd107e99481be25bc7a387e3b250f5c6ab03be9 100644 (file)
@@ -67,6 +67,9 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidated : public ModuleBase_ModelWidg
   //! Returns data object by AIS
   ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const;
 
+  //! Clear all validated cash in the widget
+  void clearValidatedCash();
+
 protected:
   /// Creates a backup of the current values of the attribute
   /// It should be realized in the specific widget because of different
index eebe7c38bc7354caad96142ce4e277105f1b7231..feb5405db4d9996f8307efbd05b7f6c55c656db5 100755 (executable)
@@ -66,6 +66,8 @@
 #include <ModuleBase_WidgetFactory.h>
 #include <ModuleBase_OperationFeature.h>
 #include <ModuleBase_OperationAction.h>
+#include <ModuleBase_PagedContainer.h>
+#include <ModuleBase_WidgetValidated.h>
 
 #include <Config_Common.h>
 #include <Config_FeatureMessage.h>
@@ -621,11 +623,13 @@ void XGUI_Workshop::connectToPropertyPanel(const bool isToConnect)
     const QList<ModuleBase_ModelWidget*>& aWidgets = aPropertyPanel->modelWidgets();
     foreach (ModuleBase_ModelWidget* aWidget, aWidgets) {
        myModule->connectToPropertyPanel(aWidget, isToConnect);
-      if (isToConnect) {
+       if (isToConnect) {
         connect(aWidget, SIGNAL(valueStateChanged(int)), this, SLOT(onWidgetStateChanged(int)));
+        connect(aWidget, SIGNAL(valuesChanged()), this, SLOT(onValuesChanged()));
       }
       else {
         disconnect(aWidget, SIGNAL(valueStateChanged(int)), this, SLOT(onWidgetStateChanged(int)));
+        disconnect(aWidget, SIGNAL(valuesChanged()), this, SLOT(onValuesChanged()));
       }
     }
   }
@@ -898,6 +902,27 @@ void XGUI_Workshop::onWidgetStateChanged(int thePreviousState)
   myModule->widgetStateChanged(thePreviousState);
 }
 
+//******************************************************
+void XGUI_Workshop::onValuesChanged()
+{
+  ModuleBase_ModelWidget* aSenderWidget = (ModuleBase_ModelWidget*)(sender());
+  if (!aSenderWidget || aSenderWidget->canSetValue())
+    return;
+
+  ModuleBase_ModelWidget* anActiveWidget = 0;
+  ModuleBase_Operation* anOperation = myOperationMgr->currentOperation();
+  if (anOperation) {
+    ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel();
+    if (aPanel)
+      anActiveWidget = aPanel->activeWidget();
+  }
+  if (anActiveWidget) {
+    ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast<ModuleBase_WidgetValidated*>
+                                                                           (anActiveWidget);
+    aWidgetValidated->clearValidatedCash();
+  }
+}
+
 ModuleBase_IModule* XGUI_Workshop::loadModule(const QString& theModule)
 {
   QString libName = QString::fromStdString(library(theModule.toStdString()));
index 66c08f0854b1af97d939dfd0d324cadba71a578d..00245d70e0f0f26370957a44fe4c4e45c60671c3 100755 (executable)
@@ -307,6 +307,10 @@ signals:
   /// \param thePreviousState the previous state of the widget
   void onWidgetStateChanged(int thePreviousState);
 
+  /// Calls activate of the current widget again. It is possible that selection filters are
+  /// differs in the new state of paged container
+  void onValuesChanged();
+
   /// Show property panel
   void showPropertyPanel();