Salome HOME
Added unit test for the issue #1806
[modules/shaper.git] / src / ParametersPlugin / ParametersPlugin_WidgetParamsMgr.h
index 5780c4b557f83dd96693cbb33299c6bbb4b8f381..4946ca1a362e54d7e02e4e3fd5606cf9f68d82f9 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef ParametersPlugin_WidgetParamsMgr_H_
 #define ParametersPlugin_WidgetParamsMgr_H_
 
-#include <ModuleBase_ModelWidget.h>
+#include <ModuleBase_ModelDialogWidget.h>
 #include <QModelIndex>
 #include <QAbstractItemDelegate>
 #include <QTreeWidget>
@@ -18,13 +18,22 @@ class QPushButton;
 class QToolButton;
 
 
+/*!
+ * \ingroup GUI
+ * Redefinition of QTreeWidget for processing of closeEditor event
+ */
 class ParametersPlugin_TreeWidget: public QTreeWidget
 {
  Q_OBJECT
 public:
+  /// Constructor
+  /// \param theParent a parent widget
   ParametersPlugin_TreeWidget(QWidget* theParent = 0) : QTreeWidget(theParent) {}
 
 protected slots:
+  /// Redefinition of virtual method
+  /// \param theEditor a editor widget
+  /// \param theHint end of editing hint
   virtual void closeEditor(QWidget* theEditor, QAbstractItemDelegate::EndEditHint theHint);
 };
 
@@ -34,7 +43,7 @@ protected slots:
  * \ingroup GUI
  * Represent a content of the property panel to show/modify parameters of some feature.
  */
-class ParametersPlugin_WidgetParamsMgr : public ModuleBase_ModelWidget
+class ParametersPlugin_WidgetParamsMgr : public ModuleBase_ModelDialogWidget
 {
  Q_OBJECT
 public:
@@ -95,7 +104,7 @@ private:
   FeaturePtr createParameter() const;
 
   /// Creates a new item
-  QTreeWidgetItem* createNewItem() const;
+  QTreeWidgetItem* createNewItem(QTreeWidgetItem* theParent) const;
 
   /// Returns currently selected item
   QTreeWidgetItem* selectedItem() const;
@@ -110,10 +119,17 @@ private:
 
   void updateParametersPart();
 
+  /// Returns true if values in the widget are valid
+  bool isValid();
+
   /// Returns true if parameter with the given name already exists
   bool hasName(const QString& theName) const;
 
-  QList<QStringList> featuresItems(const QList<FeaturePtr>& theFeatures) const;
+  /// Enable or disable buttons for parameters managemnt
+  void enableButtons(bool theEnable);
+
+  QList<QStringList> featuresItems(const QList<FeaturePtr>& theFeatures,
+                                   QList<FeaturePtr>& theFeatureList) const;
   QList<QStringList> parametersItems(const QList<FeaturePtr>& theFeatures) const;
 
   void updateParametersFeatures();