Salome HOME
Issue #529 : 4.07. Import IGES, export to BREP, STEP, IGES - Export IGES
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetFileSelector.h
index 3b183d7031a83f71c86059d3143d45d99fd09382..b89531cde6d414665d4aa0b58a6ce3b9efea863c 100644 (file)
@@ -27,6 +27,7 @@ class QLineEdit;
 *  \code
 *      <file_selector
 *          id="import_file_selector"
+*          type="open"
 *          title="Import file"
 *          path="">
 *          <validator id="ExchangePlugin_ImportFormat" parameters="BREP:BREPImport,STEP:STEPImport" />
@@ -46,12 +47,8 @@ class MODULEBASE_EXPORT ModuleBase_WidgetFileSelector : public ModuleBase_ModelW
                                 const std::string& theParentId);
   virtual ~ModuleBase_WidgetFileSelector();
 
-  virtual bool storeValue() const;
-
   virtual bool restoreValue();
 
-  QWidget* getControl() const;
-
   virtual QList<QWidget*> getControls() const;
 
   /// Returns true if a file on the current path in the line edit
@@ -65,23 +62,31 @@ class MODULEBASE_EXPORT ModuleBase_WidgetFileSelector : public ModuleBase_ModelW
   /// Processing of path changing
   void onPathChanged();
 
+protected:
+  /// Saves the internal parameters to the given feature
+  /// \return True in success
+  virtual bool storeValueCustom() const;
+
  protected:
    /// Returns string containing formats
-  QString formatsString() const;
+  QString filterString() const;
 
-  /// Return list of validator formats
+  /// Returns list of validator formats
   QStringList getValidatorFormats() const;
 
+  /// Returns a format received from theArgument
+  QString getFormat( const std::string& theArgument ) const;
+
  private:
    /// A control for path input
   QLineEdit* myPathField;
 
-  /// Container
-  QWidget* myMainWidget;
-
   /// A title of open file dialog box
   QString myTitle;
 
+  /// A title of open file dialog box
+  enum { WFS_OPEN, WFS_SAVE } myType;
+
   /// Default path
   QString myDefaultPath;
 };