+ addFromSimple( false, false );
+}
+
+void DialogsProvider::simpleOpenDialog()
+{
+ addFromSimple( true, true );
+}
+
+void DialogsProvider::openPlaylist()
+{
+ QStringList files = showSimpleOpen();
+ foreach( QString file, files )
+ {
+ playlist_Import( THEPL, qtu(file) );
+ }
+}
+
+void DialogsProvider::savePlaylist()
+{
+ QFileDialog *qfd = new QFileDialog( NULL,
+ qtr("Choose a filename to save playlist"),
+ p_intf->p_libvlc->psz_homedir,
+ qfu("XSPF playlist (*.xspf);; ") +
+ qfu("M3U playlist (*.m3u);; Any (*.*) ") );
+ qfd->setFileMode( QFileDialog::AnyFile );
+ qfd->setAcceptMode( QFileDialog::AcceptSave );
+ qfd->setConfirmOverwrite( true );
+
+ if( qfd->exec() == QDialog::Accepted )
+ {
+ if( qfd->selectedFiles().count() > 0 )
+ {
+ char *psz_module, *psz_m3u = "export-m3u",
+ *psz_xspf = "export-xspf";
+
+ QString file = qfd->selectedFiles().first();
+ QString filter = qfd->selectedFilter();
+
+ if( file.contains(".xsp") ||
+ ( filter.contains(".xspf") && !file.contains(".m3u") ) )
+ {
+ psz_module = psz_xspf;
+ if( !file.contains( ".xsp" ) )
+ file.append( ".xspf" );
+ }
+ else
+ {
+ psz_module = psz_m3u;
+ if( !file.contains( ".m3u" ) )
+ file.append( ".m3u" );
+ }
+
+ playlist_Export( THEPL, qtu(file), THEPL->p_playlist_category,
+ psz_module);
+ }
+ }
+ delete qfd;
+}
+
+static void openDirectory( intf_thread_t* p_intf, bool pl, bool go )
+{
+ QString dir = QFileDialog::getExistingDirectory ( 0,
+ _("Open directory") );
+ input_item_t *p_input = input_ItemNewExt( THEPL, qtu(dir), NULL,
+ 0, NULL, -1 );
+ playlist_AddInput( THEPL, p_input,
+ go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND,
+ PLAYLIST_END, pl);
+ input_Read( THEPL, p_input, VLC_FALSE );
+}
+
+void DialogsProvider::PLAppendDir()
+{
+ openDirectory( p_intf, true, false );
+}
+
+void DialogsProvider::MLAppendDir()
+{
+ openDirectory( p_intf, false , false );