]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs_provider.cpp
Qt4: hopefully fix the last open file path
[vlc] / modules / gui / qt4 / dialogs_provider.cpp
1 /*****************************************************************************
2  * dialogs_provider.cpp : Dialog Provider
3  *****************************************************************************
4  * Copyright (C) 2006-2008 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Jean-Baptiste Kempf <jb@videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifdef HAVE_CONFIG_H
26 # include "config.h"
27 #endif
28
29 #include <vlc_intf_strings.h>
30
31 #include "qt4.hpp"
32 #include "dialogs_provider.hpp"
33 #include "input_manager.hpp" /* Load Subtitles */
34 #include "menus.hpp"
35 #include "recents.hpp"
36 #include "util/qt_dirs.hpp"
37
38 /* The dialogs */
39 #include "dialogs/playlist.hpp"
40 #include "dialogs/bookmarks.hpp"
41 #include "dialogs/preferences.hpp"
42 #include "dialogs/mediainfo.hpp"
43 #include "dialogs/messages.hpp"
44 #include "dialogs/extended.hpp"
45 #include "dialogs/vlm.hpp"
46 #include "dialogs/sout.hpp"
47 #include "dialogs/convert.hpp"
48 #include "dialogs/open.hpp"
49 #include "dialogs/openurl.hpp"
50 #include "dialogs/help.hpp"
51 #include "dialogs/gototime.hpp"
52 #include "dialogs/podcast_configuration.hpp"
53 #include "dialogs/toolbar.hpp"
54 #include "dialogs/plugins.hpp"
55
56 #include <QEvent>
57 #include <QApplication>
58 #include <QSignalMapper>
59 #include <QFileDialog>
60
61
62 DialogsProvider* DialogsProvider::instance = NULL;
63
64 DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
65                                   QObject( NULL ), p_intf( _p_intf )
66 {
67     b_isDying = false;
68
69     /* Various signal mappers for the menus */
70     menusMapper = new QSignalMapper();
71     CONNECT( menusMapper, mapped(QObject *), this, menuAction( QObject *) );
72
73     menusUpdateMapper = new QSignalMapper();
74     CONNECT( menusUpdateMapper, mapped(QObject *),
75              this, menuUpdateAction( QObject *) );
76
77     SDMapper = new QSignalMapper();
78     CONNECT( SDMapper, mapped (QString), this, SDMenuAction( QString ) );
79 }
80
81 DialogsProvider::~DialogsProvider()
82 {
83     PlaylistDialog::killInstance();
84     MediaInfoDialog::killInstance();
85     MessagesDialog::killInstance();
86     ExtendedDialog::killInstance();
87     BookmarksDialog::killInstance();
88     HelpDialog::killInstance();
89 #ifdef UPDATE_CHECK
90     UpdateDialog::killInstance();
91 #endif
92     ToolbarEditDialog::killInstance();
93
94     delete menusMapper;
95     delete menusUpdateMapper;
96     delete SDMapper;
97 }
98
99 void DialogsProvider::quit()
100 {
101     b_isDying = true;
102     libvlc_Quit( p_intf->p_libvlc );
103 }
104
105 void DialogsProvider::customEvent( QEvent *event )
106 {
107     if( event->type() == (int)DialogEvent_Type )
108     {
109         DialogEvent *de = static_cast<DialogEvent*>(event);
110         switch( de->i_dialog )
111         {
112         case INTF_DIALOG_FILE_SIMPLE:
113         case INTF_DIALOG_FILE:
114             openDialog(); break;
115         case INTF_DIALOG_FILE_GENERIC:
116             openFileGenericDialog( de->p_arg ); break;
117         case INTF_DIALOG_DISC:
118             openDiscDialog(); break;
119         case INTF_DIALOG_NET:
120             openNetDialog(); break;
121         case INTF_DIALOG_SAT:
122         case INTF_DIALOG_CAPTURE:
123             openCaptureDialog(); break;
124         case INTF_DIALOG_DIRECTORY:
125             PLAppendDir(); break;
126         case INTF_DIALOG_PLAYLIST:
127             playlistDialog(); break;
128         case INTF_DIALOG_MESSAGES:
129             messagesDialog(); break;
130         case INTF_DIALOG_FILEINFO:
131            mediaInfoDialog(); break;
132         case INTF_DIALOG_PREFS:
133            prefsDialog(); break;
134         case INTF_DIALOG_BOOKMARKS:
135            bookmarksDialog(); break;
136         case INTF_DIALOG_EXTENDED:
137            extendedDialog(); break;
138 #ifdef ENABLE_VLM
139         case INTF_DIALOG_VLM:
140            vlmDialog(); break;
141 #endif
142         case INTF_DIALOG_POPUPMENU:
143            QVLCMenu::PopupMenu( p_intf, (de->i_arg != 0) ); break;
144         case INTF_DIALOG_AUDIOPOPUPMENU:
145            QVLCMenu::AudioPopupMenu( p_intf ); break;
146         case INTF_DIALOG_VIDEOPOPUPMENU:
147            QVLCMenu::VideoPopupMenu( p_intf ); break;
148         case INTF_DIALOG_MISCPOPUPMENU:
149            QVLCMenu::MiscPopupMenu( p_intf ); break;
150         case INTF_DIALOG_WIZARD:
151         case INTF_DIALOG_STREAMWIZARD:
152             openAndStreamingDialogs(); break;
153 #ifdef UPDATE_CHECK
154         case INTF_DIALOG_UPDATEVLC:
155             updateDialog(); break;
156 #endif
157         case INTF_DIALOG_EXIT:
158             quit(); break;
159         default:
160            msg_Warn( p_intf, "unimplemented dialog" );
161         }
162     }
163 }
164
165 /****************************************************************************
166  * Individual simple dialogs
167  ****************************************************************************/
168 void DialogsProvider::playlistDialog()
169 {
170     PlaylistDialog::getInstance( p_intf )->toggleVisible();
171 }
172
173 void DialogsProvider::prefsDialog()
174 {
175     PrefsDialog *p = new PrefsDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
176     p->toggleVisible();
177 }
178
179 void DialogsProvider::extendedDialog()
180 {
181     ExtendedDialog::getInstance( p_intf )->showTab( 0 );
182 }
183
184 void DialogsProvider::synchroDialog()
185 {
186     ExtendedDialog::getInstance( p_intf )->showTab( 2 );
187 }
188
189 void DialogsProvider::messagesDialog()
190 {
191     MessagesDialog::getInstance( p_intf )->toggleVisible();
192 }
193
194 void DialogsProvider::gotoTimeDialog()
195 {
196     GotoTimeDialog::getInstance( p_intf )->toggleVisible();
197 }
198
199 #ifdef ENABLE_VLM
200 void DialogsProvider::vlmDialog()
201 {
202     VLMDialog::getInstance( p_intf )->toggleVisible();
203 }
204 #endif
205
206 void DialogsProvider::helpDialog()
207 {
208     HelpDialog::getInstance( p_intf )->toggleVisible();
209 }
210
211 #ifdef UPDATE_CHECK
212 void DialogsProvider::updateDialog()
213 {
214     UpdateDialog::getInstance( p_intf )->toggleVisible();
215 }
216 #endif
217
218 void DialogsProvider::aboutDialog()
219 {
220     AboutDialog::getInstance( p_intf )->toggleVisible();
221 }
222
223 void DialogsProvider::mediaInfoDialog()
224 {
225     MediaInfoDialog::getInstance( p_intf )->showTab( 0 );
226 }
227
228 void DialogsProvider::mediaCodecDialog()
229 {
230     MediaInfoDialog::getInstance( p_intf )->showTab( 2 );
231 }
232
233 void DialogsProvider::bookmarksDialog()
234 {
235     BookmarksDialog::getInstance( p_intf )->toggleVisible();
236 }
237
238 void DialogsProvider::podcastConfigureDialog()
239 {
240     PodcastConfigDialog::getInstance( p_intf )->toggleVisible();
241 }
242
243 void DialogsProvider::toolbarDialog()
244 {
245     ToolbarEditDialog::getInstance( p_intf )->toggleVisible();
246 }
247
248 void DialogsProvider::pluginDialog()
249 {
250     PluginDialog *diag = new PluginDialog( p_intf );
251     diag->show();
252 }
253
254 /* Generic open file */
255 void DialogsProvider::openFileGenericDialog( intf_dialog_args_t *p_arg )
256 {
257     if( p_arg == NULL )
258     {
259         msg_Warn( p_intf, "openFileGenericDialog() called with NULL arg" );
260         return;
261     }
262
263     /* Replace the extensions to a Qt format */
264     int i = 0;
265     QString extensions = qfu( p_arg->psz_extensions );
266     while ( ( i = extensions.indexOf( "|", i ) ) != -1 )
267     {
268         if( ( extensions.count( "|" ) % 2 ) == 0 )
269             extensions.replace( i, 1, ");;" );
270         else
271             extensions.replace( i, 1, "(" );
272     }
273     extensions.replace(QString(";*"), QString(" *"));
274     extensions.append( ")" );
275
276     /* Save */
277     if( p_arg->b_save )
278     {
279         QString file = QFileDialog::getSaveFileName( NULL, p_arg->psz_title,
280                                         p_intf->p_sys->filepath, extensions );
281         if( !file.isEmpty() )
282         {
283             p_arg->i_results = 1;
284             p_arg->psz_results = (char **)malloc( p_arg->i_results * sizeof( char * ) );
285             p_arg->psz_results[0] = strdup( qtu( toNativeSepNoSlash( file ) ) );
286         }
287         else
288             p_arg->i_results = 0;
289     }
290     else /* non-save mode */
291     {
292         QStringList files = QFileDialog::getOpenFileNames( NULL,
293                 p_arg->psz_title, p_intf->p_sys->filepath,
294                 extensions );
295         p_arg->i_results = files.count();
296         p_arg->psz_results = (char **)malloc( p_arg->i_results * sizeof( char * ) );
297         i = 0;
298         foreach( const QString &file, files )
299             p_arg->psz_results[i++] = strdup( qtu( toNativeSepNoSlash( file ) ) );
300     }
301
302     /* Callback */
303     if( p_arg->pf_callback )
304         p_arg->pf_callback( p_arg );
305
306     /* Clean afterwards */
307     if( p_arg->psz_results )
308     {
309         for( i = 0; i < p_arg->i_results; i++ )
310             free( p_arg->psz_results[i] );
311         free( p_arg->psz_results );
312     }
313     free( p_arg->psz_title );
314     free( p_arg->psz_extensions );
315     free( p_arg );
316 }
317 /****************************************************************************
318  * All the open/add stuff
319  * Open Dialog first - Simple Open then
320  ****************************************************************************/
321
322 void DialogsProvider::openDialog( int i_tab )
323 {
324     OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf )->showTab( i_tab );
325 }
326 void DialogsProvider::openDialog()
327 {
328     openDialog( OPEN_FILE_TAB );
329 }
330 void DialogsProvider::openFileDialog()
331 {
332     openDialog( OPEN_FILE_TAB );
333 }
334 void DialogsProvider::openDiscDialog()
335 {
336     openDialog( OPEN_DISC_TAB );
337 }
338 void DialogsProvider::openNetDialog()
339 {
340     openDialog( OPEN_NETWORK_TAB );
341 }
342 void DialogsProvider::openCaptureDialog()
343 {
344     openDialog( OPEN_CAPTURE_TAB );
345 }
346
347 /* Same as the open one, but force the enqueue */
348 void DialogsProvider::PLAppendDialog()
349 {
350     OpenDialog::getInstance( p_intf->p_sys->p_mi, p_intf, false,
351                              OPEN_AND_ENQUEUE )->showTab( OPEN_FILE_TAB );
352 }
353
354 void DialogsProvider::MLAppendDialog()
355 {
356     OpenDialog::getInstance( p_intf->p_sys->p_mi, p_intf, false,
357                             OPEN_AND_ENQUEUE, false, false )
358                                     ->showTab( OPEN_FILE_TAB );
359 }
360
361 /**
362  * Simple open
363  ***/
364 QStringList DialogsProvider::showSimpleOpen( QString help,
365                                              int filters,
366                                              QString path )
367 {
368     QString fileTypes = "";
369     if( filters & EXT_FILTER_MEDIA ) {
370         ADD_FILTER_MEDIA( fileTypes );
371     }
372     if( filters & EXT_FILTER_VIDEO ) {
373         ADD_FILTER_VIDEO( fileTypes );
374     }
375     if( filters & EXT_FILTER_AUDIO ) {
376         ADD_FILTER_AUDIO( fileTypes );
377     }
378     if( filters & EXT_FILTER_PLAYLIST ) {
379         ADD_FILTER_PLAYLIST( fileTypes );
380     }
381     if( filters & EXT_FILTER_SUBTITLE ) {
382         ADD_FILTER_SUBTITLE( fileTypes );
383     }
384     ADD_FILTER_ALL( fileTypes );
385     fileTypes.replace(QString(";*"), QString(" *"));
386
387     return QFileDialog::getOpenFileNames( NULL,
388         help.isEmpty() ? qtr(I_OP_SEL_FILES ) : help,
389         path.isEmpty() ? p_intf->p_sys->filepath : path,
390         fileTypes );
391 }
392
393 /**
394  * Open a file,
395  * pl helps you to choose from playlist or media library,
396  * go to start or enqueue
397  **/
398 void DialogsProvider::addFromSimple( bool pl, bool go)
399 {
400     QStringList files = DialogsProvider::showSimpleOpen();
401     int i = 0;
402         files.sort();
403     foreach( const QString &file, files )
404     {
405         playlist_Add( THEPL, qtu( toNativeSeparators( file ) ), NULL,
406                       go ? ( PLAYLIST_APPEND | ( i ? 0 : PLAYLIST_GO ) |
407                                                ( i ? PLAYLIST_PREPARSE : 0 ) )
408                          : ( PLAYLIST_APPEND | PLAYLIST_PREPARSE ),
409                       PLAYLIST_END,
410                       pl ? true : false, false );
411         RecentsMRL::getInstance( p_intf )->addRecent(
412                 toNativeSeparators( file ) );
413         i++;
414     }
415 }
416
417 void DialogsProvider::simpleOpenDialog()
418 {
419     addFromSimple( true, true ); /* Playlist and Go */
420 }
421
422 void DialogsProvider::simplePLAppendDialog()
423 {
424     addFromSimple( true, false );
425 }
426
427 void DialogsProvider::simpleMLAppendDialog()
428 {
429     addFromSimple( false, false );
430 }
431
432 /* Url & Clipboard */
433 /**
434  * Open a MRL.
435  * If the clipboard contains URLs, the first is automatically 'preselected'.
436  **/
437 void DialogsProvider::openUrlDialog()
438 {
439     OpenUrlDialog *oud = OpenUrlDialog::getInstance( p_intf->p_sys->p_mi,
440                                                      p_intf );
441     if( oud->exec() == QDialog::Accepted )
442     {
443         QString url = oud->url();
444         if( !url.isEmpty() )
445         {
446             playlist_Add( THEPL, qtu( url ),
447                           NULL, !oud->shouldEnqueue() ?
448                                   ( PLAYLIST_APPEND | PLAYLIST_GO )
449                                 : ( PLAYLIST_APPEND | PLAYLIST_PREPARSE ),
450                           PLAYLIST_END, true, false );
451             RecentsMRL::getInstance( p_intf )->addRecent( url );
452         }
453     }
454 }
455
456 /* Directory */
457 /**
458  * Open a directory,
459  * pl helps you to choose from playlist or media library,
460  * go to start or enqueue
461  **/
462 static void openDirectory( intf_thread_t *p_intf, bool pl, bool go )
463 {
464     QString dir = QFileDialog::getExistingDirectory( NULL, qtr("Open Directory") );
465
466     if (!dir.isEmpty() )
467     {
468         QString mrl = dir.endsWith( "VIDEO_TS", Qt::CaseInsensitive ) ?
469             "dvd://" : "directory://" + toNativeSeparators( dir );
470         input_item_t *p_input = input_item_New( THEPL, qtu( mrl ), NULL );
471
472         /* FIXME: playlist_AddInput() can fail */
473         playlist_AddInput( THEPL, p_input,
474                        go ? ( PLAYLIST_APPEND | PLAYLIST_GO ) : PLAYLIST_APPEND,
475                        PLAYLIST_END, pl, pl_Unlocked );
476         RecentsMRL::getInstance( p_intf )->addRecent( mrl );
477         if( !go )
478             input_Read( THEPL, p_input, true );
479         vlc_gc_decref( p_input );
480     }
481 }
482
483 void DialogsProvider::PLOpenDir()
484 {
485     openDirectory( p_intf, true, true );
486 }
487
488 void DialogsProvider::PLAppendDir()
489 {
490     openDirectory( p_intf, true, false );
491 }
492
493 void DialogsProvider::MLAppendDir()
494 {
495     openDirectory( p_intf, false , false );
496 }
497
498 /****************
499  * Playlist     *
500  ****************/
501 void DialogsProvider::openAPlaylist()
502 {
503     QStringList files = showSimpleOpen( qtr( "Open playlist..." ),
504                                         EXT_FILTER_PLAYLIST );
505     foreach( const QString &file, files )
506     {
507         playlist_Import( THEPL, qtu( toNativeSeparators( file ) ) );
508     }
509 }
510
511 void DialogsProvider::saveAPlaylist()
512 {
513     QFileDialog *qfd = new QFileDialog( NULL,
514                                    qtr( "Save playlist as..." ),
515                                    p_intf->p_sys->filepath,
516                                    qtr( "XSPF playlist (*.xspf);; " ) +
517                                    qtr( "M3U playlist (*.m3u);; " ) +
518                                    qtr( "HTML playlist (*.html)" ) );
519     qfd->setFileMode( QFileDialog::AnyFile );
520     qfd->setAcceptMode( QFileDialog::AcceptSave );
521     qfd->setConfirmOverwrite( true );
522
523     if( qfd->exec() == QDialog::Accepted )
524     {
525         if( qfd->selectedFiles().count() > 0 )
526         {
527             static const char psz_xspf[] = "export-xspf",
528                               psz_m3u[] = "export-m3u",
529                               psz_html[] = "export-html";
530             const char *psz_module;
531
532             QString file = qfd->selectedFiles().first();
533             QString filter = qfd->selectedFilter();
534
535             if( file.contains( ".xsp" ) || filter.contains( "XSPF" ) )
536             {
537                 psz_module = psz_xspf;
538                 if( !file.contains( ".xsp" ) )
539                     file.append( ".xspf" );
540             }
541             else if( file.contains( ".m3u" )  || filter.contains( "M3U" ) )
542             {
543                 psz_module = psz_m3u;
544                 if( !file.contains( ".m3u" ) )
545                     file.append( ".m3u" );
546             }
547             else if( file.contains(".html" ) || filter.contains( "HTML" ) )
548             {
549                 psz_module = psz_html;
550                 if( !file.contains( "html" ) )
551                     file.append( ".html" );
552             }
553             else
554             {
555                 msg_Err( p_intf, "Impossible to recognise the file type" );
556                 delete qfd;
557                 return;
558             }
559
560             playlist_Export( THEPL, qtu( toNativeSeparators( file ) ),
561                         THEPL->p_local_category, psz_module);
562         }
563     }
564     delete qfd;
565 }
566
567 /****************************************************************************
568  * Sout emulation
569  ****************************************************************************/
570
571 void DialogsProvider::streamingDialog( QWidget *parent,
572                                        QString mrl,
573                                        bool b_transcode_only,
574                                        QStringList options )
575 {
576     char *psz_soutoption;
577
578     /* Stream */
579     if( !b_transcode_only )
580     {
581         SoutDialog *s = new SoutDialog( parent, p_intf, mrl );
582         if( s->exec() == QDialog::Accepted )
583         {
584             psz_soutoption = strdup( qtu( s->getMrl() ) );
585             delete s;
586         }
587         else
588         {
589             delete s; return;
590         }
591     } else {
592     /* Convert */
593         ConvertDialog *s = new ConvertDialog( parent, p_intf, mrl );
594         if( s->exec() == QDialog::Accepted )
595         {
596             psz_soutoption = strdup( qtu( s->getMrl() ) );
597             delete s;
598         }
599         else
600         {
601             delete s; return;
602         }
603     }
604
605     /* Get SoutMRL */
606     if( !EMPTY_STR( psz_soutoption ) )
607     {
608         /* Create Input */
609         input_item_t *p_input;
610         p_input = input_item_New( p_intf, qtu( mrl ), _("Streaming") );
611
612         /* Add normal Options */
613         for( int j = 0; j < options.size(); j++ )
614         {
615             QString qs = colon_unescape( options[j] );
616             if( !qs.isEmpty() )
617             {
618                 input_item_AddOption( p_input, qtu( qs ),
619                         VLC_INPUT_OPTION_TRUSTED );
620             }
621         }
622
623         /* Add SoutMRL */
624         msg_Dbg( p_intf, "Streaming MRL is: %s", psz_soutoption );
625         input_item_AddOption( p_input, psz_soutoption, VLC_INPUT_OPTION_TRUSTED );
626
627         /* Switch between enqueuing and starting the item */
628         /* FIXME: playlist_AddInput() can fail */
629         playlist_AddInput( THEPL, p_input,
630                 PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END, true, pl_Unlocked );
631         vlc_gc_decref( p_input );
632
633         RecentsMRL::getInstance( p_intf )->addRecent( mrl );
634     }
635     free( psz_soutoption );
636 }
637
638 void DialogsProvider::openAndStreamingDialogs()
639 {
640     OpenDialog::getInstance( p_intf->p_sys->p_mi, p_intf, false, OPEN_AND_STREAM )
641                                 ->showTab( OPEN_FILE_TAB );
642 }
643
644 void DialogsProvider::openAndTranscodingDialogs()
645 {
646     OpenDialog::getInstance( p_intf->p_sys->p_mi , p_intf, false, OPEN_AND_SAVE )
647                                 ->showTab( OPEN_FILE_TAB );
648 }
649
650 void DialogsProvider::loadSubtitlesFile()
651 {
652     input_thread_t *p_input = THEMIM->getInput();
653     if( !p_input ) return;
654
655     input_item_t *p_item = input_GetItem( p_input );
656     if( !p_item ) return;
657
658     char *path = input_item_GetURI( p_item );
659     if( !path ) path = strdup( "" );
660
661     char *sep = strrchr( path, DIR_SEP_CHAR );
662     if( sep ) *sep = '\0';
663
664     QStringList qsl = showSimpleOpen( qtr( "Open subtitles..." ),
665                                       EXT_FILTER_SUBTITLE,
666                                       path );
667     free( path );
668     foreach( const QString &qsFile, qsl )
669     {
670         if( input_AddSubtitle( p_input, qtu( toNativeSeparators( qsFile ) ),
671                     true ) )
672             msg_Warn( p_intf, "unable to load subtitles from '%s'",
673                       qtu( qsFile ) );
674     }
675 }
676
677
678 /****************************************************************************
679  * Menus
680  ****************************************************************************/
681
682 void DialogsProvider::menuAction( QObject *data )
683 {
684     QVLCMenu::DoAction( data );
685 }
686
687 void DialogsProvider::menuUpdateAction( QObject *data )
688 {
689     MenuFunc *func = qobject_cast<MenuFunc *>(data);
690     assert( func );
691     func->doFunc( p_intf );
692 }
693
694 void DialogsProvider::SDMenuAction( QString data )
695 {
696     char *psz_sd = strdup( qtu( data ) );
697     if( !playlist_IsServicesDiscoveryLoaded( THEPL, psz_sd ) )
698         playlist_ServicesDiscoveryAdd( THEPL, psz_sd );
699     else
700         playlist_ServicesDiscoveryRemove( THEPL, psz_sd );
701     free( psz_sd );
702 }
703
704 /**
705  * Play the MRL contained in the Recently played menu.
706  **/
707 void DialogsProvider::playMRL( const QString &mrl )
708 {
709     playlist_Add( THEPL, qtu( mrl ) , NULL,
710            PLAYLIST_APPEND | PLAYLIST_GO , PLAYLIST_END, true, false );
711
712     RecentsMRL::getInstance( p_intf )->addRecent( mrl );
713 }