[vlc-commits] commit: Qt4: use open file dialog for loadfile items (fix #4247) ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Thu Oct 14 18:41:48 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 14 19:39:49 2010 +0300| [fe4011fd1505c3535eafca5865debb35360d92f8] | committer: Rémi Denis-Courmont 

Qt4: use open file dialog for loadfile items (fix #4247)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fe4011fd1505c3535eafca5865debb35360d92f8
---

 modules/gui/qt4/components/preferences_widgets.cpp |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 88a99e4..718c187 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -345,8 +345,15 @@ FileConfigControl::FileConfigControl( vlc_object_t *_p_this,
 
 void FileConfigControl::updateField()
 {
-    QString file = QFileDialog::getSaveFileName( NULL,
-                  qtr( "Select File" ), QVLCUserDir( VLC_HOME_DIR ) );
+    QString file;
+
+    if (p_item->i_type == CONFIG_ITEM_SAVEFILE)
+        file = QFileDialog::getSaveFileName( NULL, qtr( "Save File" ),
+                                             QVLCUserDir( VLC_HOME_DIR ) );
+    else
+        file = QFileDialog::getOpenFileName( NULL, qtr( "Select File" ),
+                                             QVLCUserDir( VLC_HOME_DIR ) );
+
     if( file.isNull() ) return;
     text->setText( toNativeSeparators( file ) );
 }



More information about the vlc-commits mailing list