1 /*****************************************************************************
2 * dialogs_provider.cpp : Dialog Provider
3 *****************************************************************************
4 * Copyright (C) 2006-2009 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Baptiste Kempf <jb@videolan.org>
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.
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.
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 *****************************************************************************/
29 #include <vlc_intf_strings.h>
32 #include "dialogs_provider.hpp"
33 #include "input_manager.hpp" /* Load Subtitles */
35 #include "recents.hpp"
36 #include "util/qt_dirs.hpp"
37 #include "util/customwidgets.hpp" /* VLCKeyToString() */
38 #include "main_interface.hpp"
41 #include "dialogs/playlist.hpp"
42 #include "dialogs/bookmarks.hpp"
43 #include "dialogs/preferences.hpp"
44 #include "dialogs/mediainfo.hpp"
45 #include "dialogs/messages.hpp"
46 #include "dialogs/extended.hpp"
47 #include "dialogs/vlm.hpp"
48 #include "dialogs/sout.hpp"
49 #include "dialogs/convert.hpp"
50 #include "dialogs/open.hpp"
51 #include "dialogs/openurl.hpp"
52 #include "dialogs/help.hpp"
53 #include "dialogs/gototime.hpp"
54 #include "dialogs/podcast_configuration.hpp"
55 #include "dialogs/toolbar.hpp"
56 #include "dialogs/plugins.hpp"
57 #include "dialogs/external.hpp"
58 #include "dialogs/epg.hpp"
59 #include "dialogs/errors.hpp"
62 #include <QApplication>
63 #include <QSignalMapper>
64 #include <QFileDialog>
67 #define I_OP_DIR_WINTITLE I_DIR_OR_FOLDER( N_("Open Directory"), \
70 DialogsProvider
* DialogsProvider::instance
= NULL
;
72 DialogsProvider::DialogsProvider( intf_thread_t
*_p_intf
) :
73 QObject( NULL
), p_intf( _p_intf
),
75 videoPopupMenu( NULL
),
76 audioPopupMenu( NULL
),
81 /* Various signal mappers for the menus */
82 menusMapper
= new QSignalMapper();
83 CONNECT( menusMapper
, mapped(QObject
*), this, menuAction( QObject
*) );
85 menusUpdateMapper
= new QSignalMapper();
86 CONNECT( menusUpdateMapper
, mapped(QObject
*),
87 this, menuUpdateAction( QObject
*) );
89 new DialogHandler (p_intf
, this );
92 DialogsProvider::~DialogsProvider()
94 PlaylistDialog::killInstance();
95 MediaInfoDialog::killInstance();
96 MessagesDialog::killInstance();
97 BookmarksDialog::killInstance();
98 HelpDialog::killInstance();
100 UpdateDialog::killInstance();
102 PluginDialog::killInstance();
103 EpgDialog::killInstance();
106 delete menusUpdateMapper
;
109 delete videoPopupMenu
;
110 delete audioPopupMenu
;
111 delete miscPopupMenu
;
114 QStringList
DialogsProvider::getOpenURL( intf_thread_t
* p_intf
, QWidget
*parent
,
115 const QString
&caption
,
117 const QString
&filter
,
118 QString
*selectedFilter
)
123 QList
<QUrl
> urls
= QFileDialog::getOpenFileUrls( parent
, caption
, QUrl::fromUserInput( dir
), filter
, selectedFilter
);
125 foreach( const QUrl
& url
, urls
)
126 res
.append( url
.toEncoded() );
128 QStringList files
= QFileDialog::getOpenFileNames( parent
, caption
, dir
, filter
, selectedFilter
);
129 foreach ( const QString
& file
, files
)
130 res
.append( toURI( toNativeSeparators( file
) ) );
136 QString
DialogsProvider::getSaveFileName( QWidget
*parent
,
137 const QString
&caption
,
139 const QString
&filter
,
140 QString
*selectedFilter
)
142 return QFileDialog::getSaveFileName( parent
, caption
, dir
, filter
, selectedFilter
);
145 void DialogsProvider::quit()
148 libvlc_Quit( p_intf
->obj
.libvlc
);
151 void DialogsProvider::customEvent( QEvent
*event
)
153 if( event
->type() == DialogEvent::DialogEvent_Type
)
155 DialogEvent
*de
= static_cast<DialogEvent
*>(event
);
156 switch( de
->i_dialog
)
158 case INTF_DIALOG_FILE_SIMPLE
:
159 case INTF_DIALOG_FILE
:
161 case INTF_DIALOG_FILE_GENERIC
:
162 openFileGenericDialog( de
->p_arg
); break;
163 case INTF_DIALOG_DISC
:
164 openDiscDialog(); break;
165 case INTF_DIALOG_NET
:
166 openNetDialog(); break;
167 case INTF_DIALOG_SAT
:
168 case INTF_DIALOG_CAPTURE
:
169 openCaptureDialog(); break;
170 case INTF_DIALOG_DIRECTORY
:
171 PLAppendDir(); break;
172 case INTF_DIALOG_PLAYLIST
:
173 playlistDialog(); break;
174 case INTF_DIALOG_MESSAGES
:
175 messagesDialog(); break;
176 case INTF_DIALOG_FILEINFO
:
177 mediaInfoDialog(); break;
178 case INTF_DIALOG_PREFS
:
179 prefsDialog(); break;
180 case INTF_DIALOG_BOOKMARKS
:
181 bookmarksDialog(); break;
182 case INTF_DIALOG_EXTENDED
:
183 extendedDialog(); break;
184 case INTF_DIALOG_SENDKEY
:
185 sendKey( de
->i_arg
); break;
187 case INTF_DIALOG_VLM
:
190 case INTF_DIALOG_POPUPMENU
:
192 delete popupMenu
; popupMenu
= NULL
;
193 bool show
= (de
->i_arg
!= 0);
195 popupMenu
= VLCMenuBar::PopupMenu( p_intf
, show
);
198 case INTF_DIALOG_AUDIOPOPUPMENU
:
200 delete audioPopupMenu
; audioPopupMenu
= NULL
;
201 bool show
= (de
->i_arg
!= 0);
203 audioPopupMenu
= VLCMenuBar::AudioPopupMenu( p_intf
, show
);
206 case INTF_DIALOG_VIDEOPOPUPMENU
:
208 delete videoPopupMenu
; videoPopupMenu
= NULL
;
209 bool show
= (de
->i_arg
!= 0);
211 videoPopupMenu
= VLCMenuBar::VideoPopupMenu( p_intf
, show
);
214 case INTF_DIALOG_MISCPOPUPMENU
:
216 delete miscPopupMenu
; miscPopupMenu
= NULL
;
217 bool show
= (de
->i_arg
!= 0);
219 miscPopupMenu
= VLCMenuBar::MiscPopupMenu( p_intf
, show
);
222 case INTF_DIALOG_WIZARD
:
223 case INTF_DIALOG_STREAMWIZARD
:
224 openAndStreamingDialogs(); break;
226 case INTF_DIALOG_UPDATEVLC
:
227 updateDialog(); break;
229 case INTF_DIALOG_EXIT
:
232 msg_Warn( p_intf
, "unimplemented dialog" );
237 /****************************************************************************
238 * Individual simple dialogs
239 ****************************************************************************/
240 const QEvent::Type
DialogEvent::DialogEvent_Type
=
241 (QEvent::Type
)QEvent::registerEventType();
243 void DialogsProvider::playlistDialog()
245 PlaylistDialog::getInstance( p_intf
)->toggleVisible();
248 void DialogsProvider::prefsDialog()
250 PrefsDialog
*p
= new PrefsDialog( (QWidget
*)p_intf
->p_sys
->p_mi
, p_intf
);
254 void DialogsProvider::extendedDialog()
256 ExtendedDialog
*extDialog
= ExtendedDialog::getInstance(p_intf
);
258 if( !extDialog
->isVisible() || /* Hidden */
259 extDialog
->currentTab() != 0 ) /* wrong tab */
260 extDialog
->showTab( 0 );
265 void DialogsProvider::synchroDialog()
267 ExtendedDialog
*extDialog
= ExtendedDialog::getInstance(p_intf
);
269 if( !extDialog
->isVisible() || /* Hidden */
270 extDialog
->currentTab() != 2 ) /* wrong tab */
271 extDialog
->showTab( 2 );
276 void DialogsProvider::messagesDialog()
278 MessagesDialog::getInstance( p_intf
)->toggleVisible();
281 void DialogsProvider::gotoTimeDialog()
283 GotoTimeDialog::getInstance( p_intf
)->toggleVisible();
287 void DialogsProvider::vlmDialog()
289 VLMDialog::getInstance( p_intf
)->toggleVisible();
293 void DialogsProvider::helpDialog()
295 HelpDialog::getInstance( p_intf
)->toggleVisible();
299 void DialogsProvider::updateDialog()
301 UpdateDialog::getInstance( p_intf
)->toggleVisible();
305 void DialogsProvider::aboutDialog()
307 AboutDialog::getInstance( p_intf
)->toggleVisible();
310 void DialogsProvider::mediaInfoDialog()
312 MediaInfoDialog::getInstance( p_intf
)->showTab( MediaInfoDialog::META_PANEL
);
315 void DialogsProvider::mediaCodecDialog()
317 MediaInfoDialog::getInstance( p_intf
)->showTab( MediaInfoDialog::INFO_PANEL
);
320 void DialogsProvider::bookmarksDialog()
322 BookmarksDialog::getInstance( p_intf
)->toggleVisible();
325 void DialogsProvider::podcastConfigureDialog()
327 PodcastConfigDialog::getInstance( p_intf
)->toggleVisible();
330 void DialogsProvider::toolbarDialog()
332 ToolbarEditDialog
*toolbarEditor
= new ToolbarEditDialog( (QWidget
*)p_intf
->p_sys
->p_mi
, p_intf
);
333 if( toolbarEditor
->exec() == QDialog::Accepted
)
334 emit
toolBarConfUpdated();
337 void DialogsProvider::pluginDialog()
339 PluginDialog::getInstance( p_intf
)->toggleVisible();
342 void DialogsProvider::epgDialog()
344 EpgDialog::getInstance( p_intf
)->toggleVisible();
347 void DialogsProvider::setPopupMenu()
350 popupMenu
= VLCMenuBar::PopupMenu( p_intf
, true );
353 void DialogsProvider::destroyPopupMenu()
359 /* Generic open file */
360 void DialogsProvider::openFileGenericDialog( intf_dialog_args_t
*p_arg
)
364 msg_Warn( p_intf
, "openFileGenericDialog() called with NULL arg" );
368 /* Replace the extensions to a Qt format */
370 QString extensions
= qfu( p_arg
->psz_extensions
);
371 while ( ( i
= extensions
.indexOf( "|", i
) ) != -1 )
373 if( ( extensions
.count( "|" ) % 2 ) == 0 )
374 extensions
.replace( i
, 1, ");;" );
376 extensions
.replace( i
, 1, "(" );
378 extensions
.replace( ";*", " *" );
379 extensions
.append( ")" );
384 QString file
= getSaveFileName( NULL
,
385 qfu( p_arg
->psz_title
),
386 p_intf
->p_sys
->filepath
, extensions
);
387 if( !file
.isEmpty() )
389 p_arg
->i_results
= 1;
390 p_arg
->psz_results
= (char **)malloc( p_arg
->i_results
* sizeof( char * ) );
391 p_arg
->psz_results
[0] = strdup( qtu( toNativeSepNoSlash( file
) ) );
394 p_arg
->i_results
= 0;
396 else /* non-save mode */
398 QStringList urls
= getOpenURL( p_intf
, NULL
,
399 qfu( p_arg
->psz_title
), p_intf
->p_sys
->filepath
,
401 p_arg
->i_results
= urls
.count();
402 p_arg
->psz_results
= (char **)malloc( p_arg
->i_results
* sizeof( char * ) );
404 foreach( const QString
&uri
, urls
)
405 p_arg
->psz_results
[i
++] = strdup( qtu( uri
) );
407 p_intf
->p_sys
->filepath
= QString::fromLatin1("");
409 p_intf
->p_sys
->filepath
= qfu( p_arg
->psz_results
[i
-1] );
413 if( p_arg
->pf_callback
)
414 p_arg
->pf_callback( p_arg
);
416 /* Clean afterwards */
417 if( p_arg
->psz_results
)
419 for( i
= 0; i
< p_arg
->i_results
; i
++ )
420 free( p_arg
->psz_results
[i
] );
421 free( p_arg
->psz_results
);
423 free( p_arg
->psz_title
);
424 free( p_arg
->psz_extensions
);
427 /****************************************************************************
428 * All the open/add stuff
429 * Open Dialog first - Simple Open then
430 ****************************************************************************/
432 void DialogsProvider::openDialog( int i_tab
)
434 OpenDialog::getInstance( p_intf
->p_sys
->p_mi
, p_intf
)->showTab( i_tab
);
436 void DialogsProvider::openDialog()
438 openDialog( OPEN_FILE_TAB
);
440 void DialogsProvider::openFileDialog()
442 openDialog( OPEN_FILE_TAB
);
444 void DialogsProvider::openDiscDialog()
446 openDialog( OPEN_DISC_TAB
);
448 void DialogsProvider::openNetDialog()
450 openDialog( OPEN_NETWORK_TAB
);
452 void DialogsProvider::openCaptureDialog()
454 openDialog( OPEN_CAPTURE_TAB
);
457 /* Same as the open one, but force the enqueue */
458 void DialogsProvider::PLAppendDialog( int tab
)
460 OpenDialog::getInstance( p_intf
->p_sys
->p_mi
, p_intf
, false,
461 OPEN_AND_ENQUEUE
)->showTab( tab
);
464 void DialogsProvider::MLAppendDialog( int tab
)
466 OpenDialog::getInstance( p_intf
->p_sys
->p_mi
, p_intf
, false,
467 OPEN_AND_ENQUEUE
, false, false )
474 QStringList
DialogsProvider::showSimpleOpen( const QString
& help
,
476 const QString
& path
)
478 QString fileTypes
= "";
479 if( filters
& EXT_FILTER_MEDIA
) {
480 ADD_EXT_FILTER( fileTypes
, EXTENSIONS_MEDIA
);
482 if( filters
& EXT_FILTER_VIDEO
) {
483 ADD_EXT_FILTER( fileTypes
, EXTENSIONS_VIDEO
);
485 if( filters
& EXT_FILTER_AUDIO
) {
486 ADD_EXT_FILTER( fileTypes
, EXTENSIONS_AUDIO
);
488 if( filters
& EXT_FILTER_PLAYLIST
) {
489 ADD_EXT_FILTER( fileTypes
, EXTENSIONS_PLAYLIST
);
491 if( filters
& EXT_FILTER_SUBTITLE
) {
492 ADD_EXT_FILTER( fileTypes
, EXTENSIONS_SUBTITLE
);
494 ADD_EXT_FILTER( fileTypes
, EXTENSIONS_ALL
);
495 fileTypes
.replace( ";*", " *");
497 QStringList urls
= getOpenURL( p_intf
, NULL
,
498 help
.isEmpty() ? qtr(I_OP_SEL_FILES
) : help
,
499 path
.isEmpty() ? p_intf
->p_sys
->filepath
: path
,
502 if( !urls
.isEmpty() ) savedirpathFromFile( urls
.last() );
509 * pl helps you to choose from playlist or media library,
510 * go to start or enqueue
512 void DialogsProvider::addFromSimple( bool pl
, bool go
)
514 QStringList urls
= DialogsProvider::showSimpleOpen();
518 foreach( const QString
&url
, urls
)
520 Open::openMRL( p_intf
, url
, first
, pl
);
525 void DialogsProvider::simpleOpenDialog()
527 addFromSimple( true, true ); /* Playlist and Go */
530 /* Url & Clipboard */
533 * If the clipboard contains URLs, the first is automatically 'preselected'.
535 void DialogsProvider::openUrlDialog()
537 OpenUrlDialog
oud( p_intf
);
538 if( oud
.exec() != QDialog::Accepted
)
541 QString url
= oud
.url();
545 if( !url
.contains( qfu( "://" ) ) )
547 char *uri
= vlc_path2uri( qtu( url
), NULL
);
554 Open::openMRL( p_intf
, qtu(url
), !oud
.shouldEnqueue() );
560 * pl helps you to choose from playlist or media library,
561 * go to start or enqueue
563 static void openDirectory( intf_thread_t
*p_intf
, bool pl
, bool go
)
565 QString uri
= DialogsProvider::getDirectoryDialog( p_intf
);
567 Open::openMRL( p_intf
, uri
, go
, pl
);
570 QString
DialogsProvider::getDirectoryDialog( intf_thread_t
*p_intf
)
572 QString dir
= QFileDialog::getExistingDirectory( NULL
,
573 qtr( I_OP_DIR_WINTITLE
), p_intf
->p_sys
->filepath
);
575 if( dir
.isEmpty() ) return QString();
577 p_intf
->p_sys
->filepath
= dir
;
579 const char *scheme
= "directory";
580 if( dir
.endsWith( DIR_SEP
"VIDEO_TS", Qt::CaseInsensitive
) )
582 else if( dir
.endsWith( DIR_SEP
"BDMV", Qt::CaseInsensitive
) )
585 dir
.remove( "BDMV" );
588 char *uri
= vlc_path2uri( qtu( toNativeSeparators( dir
) ), scheme
);
589 if( unlikely(uri
== NULL
) )
595 RecentsMRL::getInstance( p_intf
)->addRecent( dir
);
600 void DialogsProvider::PLOpenDir()
602 openDirectory( p_intf
, true, true );
605 void DialogsProvider::PLAppendDir()
607 openDirectory( p_intf
, true, false );
613 void DialogsProvider::openAPlaylist()
615 QStringList urls
= showSimpleOpen( qtr( "Open playlist..." ),
616 EXT_FILTER_PLAYLIST
);
617 foreach( const QString
&url
, urls
)
619 playlist_Import( THEPL
, qtu( url
) );
623 void DialogsProvider::savePlayingToPlaylist()
627 char filter_name
[14];
628 char filter_patterns
[5];
631 { N_("XSPF playlist"), "xspf", "export-xspf", },
632 { N_("M3U playlist"), "m3u", "export-m3u", },
633 { N_("M3U8 playlist"), "m3u8", "export-m3u8", },
634 { N_("HTML playlist"), "html", "export-html", },
638 QString ext
= getSettings()->value( "last-playlist-ext" ).toString();
640 for( size_t i
= 0; i
< sizeof (types
) / sizeof (types
[0]); i
++ )
642 QString tmp
= qfu( vlc_gettext( types
[i
].filter_name
) ) + " (*." + types
[i
].filter_patterns
+ ")";
643 if( ext
== qfu( types
[i
].filter_patterns
) )
644 filters
.insert( 0, tmp
);
646 filters
.append( tmp
);
650 QString file
= getSaveFileName( NULL
,
651 qtr( "Save playlist as..." ),
652 p_intf
->p_sys
->filepath
, filters
.join( ";;" ),
654 const char *psz_selected_module
= NULL
;
655 const char *psz_last_playlist_ext
= NULL
;
660 /* First test if the file extension is set, and different to selected filter */
661 for( size_t i
= 0; i
< sizeof (types
) / sizeof (types
[0]); i
++)
663 if ( file
.endsWith( QString( "." ) + qfu( types
[i
].filter_patterns
) ) )
665 psz_selected_module
= types
[i
].module
;
666 psz_last_playlist_ext
= types
[i
].filter_patterns
;
671 /* otherwise apply the selected extension */
672 if ( !psz_last_playlist_ext
)
674 for( size_t i
= 0; i
< sizeof (types
) / sizeof (types
[0]); i
++)
676 if ( selected
.startsWith( qfu( vlc_gettext( types
[i
].filter_name
) ) ) )
678 psz_selected_module
= types
[i
].module
;
679 psz_last_playlist_ext
= types
[i
].filter_patterns
;
680 /* Fix file extension */
681 file
= file
.append( QString( "." ) + qfu( psz_last_playlist_ext
) );
687 if ( psz_selected_module
)
689 playlist_Export( THEPL
, qtu( toNativeSeparators( file
) ),
690 true, psz_selected_module
);
691 getSettings()->setValue( "last-playlist-ext", psz_last_playlist_ext
);
695 /****************************************************************************
697 ****************************************************************************/
699 void DialogsProvider::streamingDialog( QWidget
*parent
,
700 const QStringList
& mrls
,
701 bool b_transcode_only
,
702 QStringList options
)
704 QStringList outputMRLs
;
707 // Does streaming multiple files make sense? I suppose so, just stream one
708 // after the other, but not at the moment.
709 if( !b_transcode_only
)
711 SoutDialog
*s
= new SoutDialog( parent
, p_intf
, mrls
[0] );
712 s
->setAttribute( Qt::WA_QuitOnClose
, false ); // See #4883
713 if( s
->exec() == QDialog::Accepted
)
715 outputMRLs
.append(s
->getMrl());
724 ConvertDialog
*s
= new ConvertDialog( parent
, p_intf
, mrls
);
725 s
->setAttribute( Qt::WA_QuitOnClose
, false ); // See #4883
726 if( s
->exec() == QDialog::Accepted
)
728 /* Clear the playlist. This is because we're going to be populating
730 playlist_Clear( THEPL
, pl_Unlocked
);
732 outputMRLs
= s
->getMrls();
742 if( !outputMRLs
.isEmpty() )
744 /* For all of our MRLs */
745 for(int i
= 0; i
< outputMRLs
.length(); i
++)
748 /* Duplicate the options list. This is because we need to have a
749 copy for every file we add to the playlist.*/
750 QStringList optionsCopy
;
751 for(int j
= 0; j
< options
.length(); j
++)
753 optionsCopy
.append(options
[j
]);
756 optionsCopy
+= outputMRLs
[i
].split( " :");
757 QString title
= "Converting " + mrls
[i
];
759 /* Add each file to convert to our playlist, making sure to not attempt to start playing it.*/
760 Open::openMRLwithOptions( p_intf
, mrls
[i
], &optionsCopy
, false, true, qtu( title
) );
763 /* Start the playlist from the beginning */
764 playlist_Control(THEPL
,PLAYLIST_PLAY
,pl_Unlocked
);
768 void DialogsProvider::openAndStreamingDialogs()
770 OpenDialog::getInstance( p_intf
->p_sys
->p_mi
, p_intf
, false, OPEN_AND_STREAM
)
771 ->showTab( OPEN_FILE_TAB
);
774 void DialogsProvider::openAndTranscodingDialogs()
776 OpenDialog::getInstance( p_intf
->p_sys
->p_mi
, p_intf
, false, OPEN_AND_SAVE
)
777 ->showTab( OPEN_FILE_TAB
);
780 void DialogsProvider::loadSubtitlesFile()
782 input_thread_t
*p_input
= THEMIM
->getInput();
783 if( !p_input
) return;
785 input_item_t
*p_item
= input_GetItem( p_input
);
786 if( !p_item
) return;
788 char *path
= input_item_GetURI( p_item
);
792 path2
= vlc_uri2path( path
);
796 char *sep
= strrchr( path2
, DIR_SEP_CHAR
);
797 if( sep
) *sep
= '\0';
801 QStringList qsl
= showSimpleOpen( qtr( "Open subtitles..." ),
805 foreach( const QString
&qsUrl
, qsl
)
807 if( input_AddSubtitleOSD( p_input
, qtu( toNativeSeparators( QUrl( qsUrl
).toLocalFile() ) ),
809 msg_Warn( p_intf
, "unable to load subtitles from '%s'",
815 /****************************************************************************
817 ****************************************************************************/
819 void DialogsProvider::menuAction( QObject
*data
)
821 VLCMenuBar::DoAction( data
);
824 void DialogsProvider::menuUpdateAction( QObject
*data
)
826 MenuFunc
*func
= qobject_cast
<MenuFunc
*>(data
);
828 func
->doFunc( p_intf
);
831 void DialogsProvider::sendKey( int key
)
833 // translate from a vlc keycode into a Qt sequence
834 QKeySequence
kseq0( VLCKeyToString( key
, true ) );
836 if( popupMenu
== NULL
)
838 // make sure at least a non visible popupmenu is available
839 popupMenu
= VLCMenuBar::PopupMenu( p_intf
, false );
840 if( unlikely( popupMenu
== NULL
) )
844 // test against key accelerators from the popupmenu
845 QList
<QAction
*> actions
= popupMenu
->findChildren
<QAction
*>();
846 for( int i
= 0; i
< actions
.size(); i
++ )
848 QAction
* action
= actions
.at(i
);
849 QKeySequence kseq
= action
->shortcut();
857 // forward key to vlc core when not a key accelerator
858 var_SetInteger( p_intf
->obj
.libvlc
, "key-pressed", key
);