Salome HOME
Merge branch 'Dev_1.1.1' of newgeom:newgeom into Dev_1.2.0
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetFileSelector.h
index 4f64d215ca7ebdeec9fdfd2192d1f7fd6f4ddb7c..2ddc684acc015d75b8320b8f51d3b2a5f7d84157 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" />
@@ -48,8 +49,6 @@ class MODULEBASE_EXPORT ModuleBase_WidgetFileSelector : public ModuleBase_ModelW
 
   virtual bool restoreValue();
 
-  QWidget* getControl() const;
-
   virtual QList<QWidget*> getControls() const;
 
   /// Returns true if a file on the current path in the line edit
@@ -68,23 +67,29 @@ protected:
   /// \return True in success
   virtual bool storeValueCustom() const;
 
- protected:
-   /// Returns string containing formats
-  QString formatsString() const;
+protected:
+  /// Converts format to filter string
+  static QString formatToFilter( const QString & theFormat );
 
-  /// Return list of validator formats
+  /// Returns list of validator formats
   QStringList getValidatorFormats() const;
 
- private:
+  /// Returns string containing formats
+  QString filterString() const;
+
+protected:
    /// A control for path input
   QLineEdit* myPathField;
 
-  /// Container
-  QWidget* myMainWidget;
-
   /// A title of open file dialog box
   QString myTitle;
 
+  /// A current format
+  QString mySelectedFilter;
+
+  /// A title of open file dialog box
+  enum { WFS_OPEN, WFS_SAVE } myType;
+
   /// Default path
   QString myDefaultPath;
 };