]> git.sesse.net Git - vlc/commitdiff
Qt4 - Open Dialog/File. Solve the filters bug and do things in a better way.
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 20 Mar 2007 19:20:42 +0000 (19:20 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 20 Mar 2007 19:20:42 +0000 (19:20 +0000)
modules/gui/qt4/components/open.cpp
modules/gui/qt4/dialogs_provider.hpp

index 0ed990ff9f77eb6bca2848e9ecdb6a1554fbb4a6..9e2f3fdd534b6d6b8e2ce5ead9b8390e035b189d 100644 (file)
@@ -45,14 +45,6 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
        rewrite it all. Be careful to your eyes cause there are a few hacks.
        Be very careful and test correctly when you modify this. */
 
-    // Make this QFileDialog a child of tempWidget from the ui.
-    dialogBox = new QFileDialog( ui.tempWidget );
-    dialogBox->setFileMode( QFileDialog::ExistingFiles );
-    dialogBox->setDirectory( qfu( p_intf->p_libvlc->psz_homedir ) );
-    /* We don't want to see a grip in the middle of the window, do we? */
-    dialogBox->setSizeGripEnabled( false );
-    dialogBox->setToolTip( qtr( "Select one or multiple files, or a folder" ));
-
     /* Set Filters for file selection */
     QString fileTypes = "";
     ADD_FILTER_MEDIA( fileTypes );
@@ -62,7 +54,13 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     ADD_FILTER_ALL( fileTypes );
     fileTypes.replace(QString(";*"), QString(" *"));
 
-    dialogBox->setFilter( fileTypes );
+    // Make this QFileDialog a child of tempWidget from the ui.
+    dialogBox = new QFileDialog( ui.tempWidget, NULL, 
+            qfu( p_intf->p_libvlc->psz_homedir ), fileTypes );
+    dialogBox->setFileMode( QFileDialog::ExistingFiles );
+    /* We don't want to see a grip in the middle of the window, do we? */
+    dialogBox->setSizeGripEnabled( false );
+    dialogBox->setToolTip( qtr( "Select one or multiple files, or a folder" ));
 
     // Add it to the layout
     ui.gridLayout->addWidget( dialogBox, 0, 0, 1, 3 );
index c608451a8e1d697639ea44b50e8e35d5224406f3..6afbefff97cafefc4b9180bf956e292b7843ec16 100644 (file)
 #include <vlc/vlc.h>
 #include <vlc_interface.h>
 
-#define ADD_FILTER_MEDIA( string )       \
+#define ADD_FILTER_MEDIA( string )   \
     string += _("Media Files");      \
     string += " ( ";                 \
     string += EXTENSIONS_MEDIA;      \
     string += ");;";
-#define ADD_FILTER_VIDEO( string )       \
+#define ADD_FILTER_VIDEO( string )   \
     string += _("Video Files");      \
     string += " ( ";                 \
     string += EXTENSIONS_VIDEO;      \
     string += ");;";
-#define ADD_FILTER_AUDIO( string )       \
+#define ADD_FILTER_AUDIO( string )   \
     string += _("Audio Files");      \
     string += " ( ";                 \
     string += EXTENSIONS_AUDIO;      \