From: vsv Date: Tue, 13 Dec 2016 13:36:59 +0000 (+0300) Subject: Issue #1906: Use validators for the field panel X-Git-Tag: before_porting_8.2.0~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2ef1e4ebed52958d8c82f2b7d1ec594fd8168df5;p=modules%2Fshaper.git Issue #1906: Use validators for the field panel --- diff --git a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp index de74d3c46..fbf743557 100644 --- a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp +++ b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp @@ -793,7 +793,7 @@ void CollectionPlugin_WidgetField::onStepMove(int theStep) //********************************************************************************** bool CollectionPlugin_WidgetField:: - isValidSelection(const std::shared_ptr& thePrs) + isValidSelectionCustom(const std::shared_ptr& thePrs) { return (myShapeTypeCombo->currentIndex() == 5)? false : true; } @@ -812,8 +812,7 @@ void CollectionPlugin_WidgetField::onSelectionChanged() if (myShapeTypeCombo->currentIndex() == 5) return; - QList aSelected = - myWorkshop->selection()->getSelected(ModuleBase_ISelection::AllControls); + QList aSelected = getFilteredSelected(); AttributeSelectionListPtr aSelList = myFeature->data()->selectionList(CollectionPlugin_Field::SELECTED_ID()); diff --git a/src/CollectionPlugin/CollectionPlugin_WidgetField.h b/src/CollectionPlugin/CollectionPlugin_WidgetField.h index 5f202f551..d732d99d4 100644 --- a/src/CollectionPlugin/CollectionPlugin_WidgetField.h +++ b/src/CollectionPlugin/CollectionPlugin_WidgetField.h @@ -51,7 +51,7 @@ public: /// Checks the widget validity. By default, it returns true. /// \param thePrs a selected presentation in the view /// \return a boolean value - virtual bool isValidSelection(const std::shared_ptr& theValue); + virtual bool isValidSelectionCustom(const std::shared_ptr& theValue); /// Returns true if the event is processed. virtual bool processEnter(); diff --git a/src/CollectionPlugin/plugin-Collection.xml b/src/CollectionPlugin/plugin-Collection.xml index 33042ac49..6ebd05466 100644 --- a/src/CollectionPlugin/plugin-Collection.xml +++ b/src/CollectionPlugin/plugin-Collection.xml @@ -14,7 +14,9 @@ title="Field" tooltip="Create create fields for selected shapes" icon="icons/Collection/field.png"> - + + +