Commit 89a66deb authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Open Dialog/File. Solve the filters bug and do things in a better way.

parent 9a31042d
...@@ -45,14 +45,6 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -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. rewrite it all. Be careful to your eyes cause there are a few hacks.
Be very careful and test correctly when you modify this. */ 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 */ /* Set Filters for file selection */
QString fileTypes = ""; QString fileTypes = "";
ADD_FILTER_MEDIA( fileTypes ); ADD_FILTER_MEDIA( fileTypes );
...@@ -62,7 +54,13 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -62,7 +54,13 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
ADD_FILTER_ALL( fileTypes ); ADD_FILTER_ALL( fileTypes );
fileTypes.replace(QString(";*"), QString(" *")); 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 // Add it to the layout
ui.gridLayout->addWidget( dialogBox, 0, 0, 1, 3 ); ui.gridLayout->addWidget( dialogBox, 0, 0, 1, 3 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment