Salome HOME
Add file dialog options in QtxPathEdit
[modules/gui.git] / src / Qtx / QtxPagePrefMgr.cxx
index 412e178d40ac0d41ddd7a5009e37a23ef7d5788a..d0d861ed0060b74e1b4c7ab772bbd8f3f2b3436c 100644 (file)
@@ -3932,6 +3932,27 @@ void QtxPagePrefPathItem::setPathFilter( const QString& f )
   myPath->setPathFilter( f );
 }
 
+/*!
+  \brief Get currently used path widget options.
+  \return file or directory path options
+  \sa setPathOptions()
+*/
+QFileDialog::Options QtxPagePrefPathItem::pathOptions() const
+{
+  return myPath->pathOptions();
+}
+
+/*!
+  \brief Set path widget options.
+  \param f new file or directory path options
+  \sa pathOptions()
+*/
+void QtxPagePrefPathItem::setPathOptions( const QFileDialog::Options options )
+{
+  myPath->setPathOptions( options );
+}
+
+
 /*!
   \brief Store preference item to the resource manager.
   \sa retrieve()
@@ -3962,6 +3983,8 @@ QVariant QtxPagePrefPathItem::optionValue( const QString& name ) const
     return pathType();
   else if ( name == "path_filter" )
     return pathFilter();
+  else if ( name == "path_options" )
+    return QVariant::fromValue(pathOptions());
   else
     return QtxPageNamedPrefItem::optionValue( name );
 }
@@ -3984,6 +4007,11 @@ void QtxPagePrefPathItem::setOptionValue( const QString& name, const QVariant& v
     if ( val.canConvert( QVariant::String ) )
       setPathFilter( val.toString() );
   }
+  else if ( name == "path_options" )
+  {
+    if ( val.canConvert( QVariant::Int ) )
+      setPathOptions( (QFileDialog::Options)val.toInt() );
+  }
   else
     QtxPageNamedPrefItem::setOptionValue( name, val );
 }