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();
99 VLMDialog::killInstance();
101 HelpDialog::killInstance();
103 UpdateDialog::killInstance();
105 PluginDialog::killInstance();
106 EpgDialog::killInstance();
109 delete menusUpdateMapper
;
112 delete videoPopupMenu
;
113 delete audioPopupMenu
;
114 delete miscPopupMenu
;
117 QStringList
DialogsProvider::getOpenURL( QWidget
*parent
,
118 const QString
&caption
,
120 const QString
&filter
,
121 QString
*selectedFilter
)
124 QList
<QUrl
> urls
= QFileDialog::getOpenFileUrls( parent
, caption
, QUrl::fromUserInput( dir
), filter
, selectedFilter
);
126 foreach( const QUrl
& url
, urls
)
127 res
.append( url
.toEncoded() );
132 QString
DialogsProvider::getSaveFileName( QWidget
*parent
,
133 const QString
&caption
,
135 const QString
&filter
,
136 QString
*selectedFilter
)
138 return QFileDialog::getSaveFileName( parent
, caption
, dir
, filter
, selectedFilter
);
141 void DialogsProvider::quit()
144 libvlc_Quit( p_intf
->obj
.libvlc
);
147 void DialogsProvider::customEvent( QEvent
*event
)
149 if( event
->type() == DialogEvent::DialogEvent_Type
)
151 DialogEvent
*de
= static_cast<DialogEvent
*>(event
);
152 switch( de
->i_dialog
)
154 case INTF_DIALOG_FILE_SIMPLE
:
155 case INTF_DIALOG_FILE
:
157 case INTF_DIALOG_FILE_GENERIC
:
158 openFileGenericDialog( de
->p_arg
); break;
159 case INTF_DIALOG_DISC
:
160 openDiscDialog(); break;
161 case INTF_DIALOG_NET
:
162 openNetDialog(); break;
163 case INTF_DIALOG_SAT
:
164 case INTF_DIALOG_CAPTURE
:
165 openCaptureDialog(); break;
166 case INTF_DIALOG_DIRECTORY
:
167 PLAppendDir(); break;
168 case INTF_DIALOG_PLAYLIST
:
169 playlistDialog(); break;
170 case INTF_DIALOG_MESSAGES
:
171 messagesDialog(); break;
172 case INTF_DIALOG_FILEINFO
:
173 mediaInfoDialog(); break;
174 case INTF_DIALOG_PREFS
:
175 prefsDialog(); break;
176 case INTF_DIALOG_BOOKMARKS
:
177 bookmarksDialog(); break;
178 case INTF_DIALOG_EXTENDED
:
179 extendedDialog(); break;
180 case INTF_DIALOG_SENDKEY
:
181 sendKey( de
->i_arg
); break;
183 case INTF_DIALOG_VLM
:
186 case INTF_DIALOG_POPUPMENU
:
188 delete popupMenu
; popupMenu
= NULL
;
189 bool show
= (de
->i_arg
!= 0);
192 //popping a QMenu prevents mouse release events to be received,
193 //this ensures the coherency of the vout mouse state.
194 emit
releaseMouseEvents();
195 popupMenu
= VLCMenuBar::PopupMenu( p_intf
, show
);
199 case INTF_DIALOG_AUDIOPOPUPMENU
:
201 delete audioPopupMenu
; audioPopupMenu
= NULL
;
202 bool show
= (de
->i_arg
!= 0);
204 audioPopupMenu
= VLCMenuBar::AudioPopupMenu( p_intf
, show
);
207 case INTF_DIALOG_VIDEOPOPUPMENU
:
209 delete videoPopupMenu
; videoPopupMenu
= NULL
;
210 bool show
= (de
->i_arg
!= 0);
212 videoPopupMenu
= VLCMenuBar::VideoPopupMenu( p_intf
, show
);
215 case INTF_DIALOG_MISCPOPUPMENU
:
217 delete miscPopupMenu
; miscPopupMenu
= NULL
;
218 bool show
= (de
->i_arg
!= 0);
220 miscPopupMenu
= VLCMenuBar::MiscPopupMenu( p_intf
, show
);
223 case INTF_DIALOG_WIZARD
:
224 case INTF_DIALOG_STREAMWIZARD
:
225 openAndStreamingDialogs(); break;
227 case INTF_DIALOG_UPDATEVLC
:
228 updateDialog(); break;
230 case INTF_DIALOG_EXIT
:
233 msg_Warn( p_intf
, "unimplemented dialog" );
238 /****************************************************************************
239 * Individual simple dialogs
240 ****************************************************************************/
241 const QEvent::Type
DialogEvent::DialogEvent_Type
=
242 (QEvent::Type
)QEvent::registerEventType();
244 void DialogsProvider::playlistDialog()
246 PlaylistDialog::getInstance( p_intf
)->toggleVisible();
249 void DialogsProvider::prefsDialog()
251 PrefsDialog
*p
= new PrefsDialog( (QWidget
*)p_intf
->p_sys
->p_mi
, p_intf
);
255 void DialogsProvider::extendedDialog()
257 ExtendedDialog
*extDialog
= ExtendedDialog::getInstance(p_intf
);
259 if( !extDialog
->isVisible() || /* Hidden */
260 extDialog
->currentTab() != 0 ) /* wrong tab */
261 extDialog
->showTab( 0 );
266 void DialogsProvider::synchroDialog()
268 ExtendedDialog
*extDialog
= ExtendedDialog::getInstance(p_intf
);
270 if( !extDialog
->isVisible() || /* Hidden */
271 extDialog
->currentTab() != 2 ) /* wrong tab */
272 extDialog
->showTab( 2 );
277 void DialogsProvider::messagesDialog()
279 MessagesDialog::getInstance( p_intf
)->toggleVisible();
282 void DialogsProvider::gotoTimeDialog()
284 GotoTimeDialog::getInstance( p_intf
)->toggleVisible();
288 void DialogsProvider::vlmDialog()
290 VLMDialog::getInstance( p_intf
)->toggleVisible();
294 void DialogsProvider::helpDialog()
296 HelpDialog::getInstance( p_intf
)->toggleVisible();
300 void DialogsProvider::updateDialog()
302 UpdateDialog::getInstance( p_intf
)->toggleVisible();
306 void DialogsProvider::aboutDialog()
308 AboutDialog::getInstance( p_intf
)->toggleVisible();
311 void DialogsProvider::mediaInfoDialog()
313 MediaInfoDialog::getInstance( p_intf
)->showTab( MediaInfoDialog::META_PANEL
);
316 void DialogsProvider::mediaCodecDialog()
318 MediaInfoDialog::getInstance( p_intf
)->showTab( MediaInfoDialog::INFO_PANEL
);
321 void DialogsProvider::bookmarksDialog()
323 BookmarksDialog::getInstance( p_intf
)->toggleVisible();
326 void DialogsProvider::podcastConfigureDialog()
328 PodcastConfigDialog::getInstance( p_intf
)->toggleVisible();
331 void DialogsProvider::toolbarDialog()
333 ToolbarEditDialog
*toolbarEditor
= new ToolbarEditDialog( (QWidget
*)p_intf
->p_sys
->p_mi
, p_intf
);
334 if( toolbarEditor
->exec() == QDialog::Accepted
)
335 emit
toolBarConfUpdated();
338 void DialogsProvider::pluginDialog()
340 PluginDialog::getInstance( p_intf
)->toggleVisible();
343 void DialogsProvider::epgDialog()
345 EpgDialog::getInstance( p_intf
)->toggleVisible();
348 void DialogsProvider::setPopupMenu()
351 popupMenu
= VLCMenuBar::PopupMenu( p_intf
, true );
354 void DialogsProvider::destroyPopupMenu()
360 /* Generic open file */
361 void DialogsProvider::openFileGenericDialog( intf_dialog_args_t
*p_arg
)
365 msg_Warn( p_intf
, "openFileGenericDialog() called with NULL arg" );
369 /* Replace the extensions to a Qt format */
371 QString extensions
= qfu( p_arg
->psz_extensions
);
372 while ( ( i
= extensions
.indexOf( "|", i
) ) != -1 )
374 if( ( extensions
.count( "|" ) % 2 ) == 0 )
375 extensions
.replace( i
, 1, ");;" );
377 extensions
.replace( i
, 1, "(" );
379 extensions
.replace( ";*", " *" );
380 extensions
.append( ")" );
385 QString file
= getSaveFileName( NULL
,
386 qfu( p_arg
->psz_title
),
387 p_intf
->p_sys
->filepath
, extensions
);
388 if( !file
.isEmpty() )
390 p_arg
->i_results
= 1;
391 p_arg
->psz_results
= (char **)vlc_alloc( p_arg
->i_results
, sizeof( char * ) );
392 p_arg
->psz_results
[0] = strdup( qtu( toNativeSepNoSlash( file
) ) );
395 p_arg
->i_results
= 0;
397 else /* non-save mode */
399 QStringList urls
= getOpenURL( NULL
, qfu( p_arg
->psz_title
),
400 p_intf
->p_sys
->filepath
, extensions
);
401 p_arg
->i_results
= urls
.count();
402 p_arg
->psz_results
= (char **)vlc_alloc( 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( ";*", " *");
496 fileTypes
.chop(2); //remove trailling ";;"
498 QStringList urls
= getOpenURL( NULL
,
499 help
.isEmpty() ? qtr(I_OP_SEL_FILES
) : help
,
500 path
.isEmpty() ? p_intf
->p_sys
->filepath
: path
,
503 if( !urls
.isEmpty() ) savedirpathFromFile( urls
.last() );
510 * pl helps you to choose from playlist or media library,
511 * go to start or enqueue
513 void DialogsProvider::addFromSimple( bool pl
, bool go
)
515 QStringList urls
= DialogsProvider::showSimpleOpen();
519 foreach( const QString
&url
, urls
)
521 Open::openMRL( p_intf
, url
, first
, pl
);
526 void DialogsProvider::simpleOpenDialog()
528 addFromSimple( true, true ); /* Playlist and Go */
531 /* Url & Clipboard */
534 * If the clipboard contains URLs, the first is automatically 'preselected'.
536 void DialogsProvider::openUrlDialog()
538 OpenUrlDialog
oud( p_intf
);
539 if( oud
.exec() != QDialog::Accepted
)
542 QString url
= oud
.url();
546 if( !url
.contains( qfu( "://" ) ) )
548 char *uri
= vlc_path2uri( qtu( url
), NULL
);
555 Open::openMRL( p_intf
, qtu(url
), !oud
.shouldEnqueue() );
561 * pl helps you to choose from playlist or media library,
562 * go to start or enqueue
564 static void openDirectory( intf_thread_t
*p_intf
, bool pl
, bool go
)
566 QString uri
= DialogsProvider::getDirectoryDialog( p_intf
);
568 Open::openMRL( p_intf
, uri
, go
, pl
);
571 QString
DialogsProvider::getDirectoryDialog( intf_thread_t
*p_intf
)
573 QString dir
= QFileDialog::getExistingDirectory( NULL
,
574 qtr( I_OP_DIR_WINTITLE
), p_intf
->p_sys
->filepath
);
576 if( dir
.isEmpty() ) return QString();
578 p_intf
->p_sys
->filepath
= dir
;
580 const char *scheme
= "directory";
581 if( dir
.endsWith( DIR_SEP
"VIDEO_TS", Qt::CaseInsensitive
) )
583 else if( dir
.endsWith( DIR_SEP
"BDMV", Qt::CaseInsensitive
) )
586 dir
.remove( "BDMV" );
589 char *uri
= vlc_path2uri( qtu( toNativeSeparators( dir
) ), scheme
);
590 if( unlikely(uri
== NULL
) )
596 RecentsMRL::getInstance( p_intf
)->addRecent( dir
);
601 void DialogsProvider::PLOpenDir()
603 openDirectory( p_intf
, true, true );
606 void DialogsProvider::PLAppendDir()
608 openDirectory( p_intf
, true, false );
614 void DialogsProvider::openAPlaylist()
616 QStringList urls
= showSimpleOpen( qtr( "Open playlist..." ),
617 EXT_FILTER_PLAYLIST
);
618 foreach( const QString
&url
, urls
)
620 char* psz_path
= vlc_uri2path(qtu( url
));
623 msg_Warn( p_intf
, "unable to load playlist '%s'", qtu( url
) );
626 playlist_Import( THEPL
, psz_path
);
631 void DialogsProvider::savePlayingToPlaylist()
635 char filter_name
[14];
636 char filter_patterns
[5];
639 { N_("XSPF playlist"), "xspf", "export-xspf", },
640 { N_("M3U playlist"), "m3u", "export-m3u", },
641 { N_("M3U8 playlist"), "m3u8", "export-m3u8", },
642 { N_("HTML playlist"), "html", "export-html", },
646 QString ext
= getSettings()->value( "last-playlist-ext" ).toString();
648 for( size_t i
= 0; i
< sizeof (types
) / sizeof (types
[0]); i
++ )
650 QString tmp
= qfu( vlc_gettext( types
[i
].filter_name
) ) + " (*." + types
[i
].filter_patterns
+ ")";
651 if( ext
== qfu( types
[i
].filter_patterns
) )
652 filters
.insert( 0, tmp
);
654 filters
.append( tmp
);
658 QString file
= getSaveFileName( NULL
,
659 qtr( "Save playlist as..." ),
660 p_intf
->p_sys
->filepath
, filters
.join( ";;" ),
662 const char *psz_selected_module
= NULL
;
663 const char *psz_last_playlist_ext
= NULL
;
668 /* First test if the file extension is set, and different to selected filter */
669 for( size_t i
= 0; i
< sizeof (types
) / sizeof (types
[0]); i
++)
671 if ( file
.endsWith( QString( "." ) + qfu( types
[i
].filter_patterns
) ) )
673 psz_selected_module
= types
[i
].module
;
674 psz_last_playlist_ext
= types
[i
].filter_patterns
;
679 /* otherwise apply the selected extension */
680 if ( !psz_last_playlist_ext
)
682 for( size_t i
= 0; i
< sizeof (types
) / sizeof (types
[0]); i
++)
684 if ( selected
.startsWith( qfu( vlc_gettext( types
[i
].filter_name
) ) ) )
686 psz_selected_module
= types
[i
].module
;
687 psz_last_playlist_ext
= types
[i
].filter_patterns
;
688 /* Fix file extension */
689 file
= file
.append( QString( "." ) + qfu( psz_last_playlist_ext
) );
695 if ( psz_selected_module
)
697 playlist_Export( THEPL
, qtu( toNativeSeparators( file
) ),
698 true, psz_selected_module
);
699 getSettings()->setValue( "last-playlist-ext", psz_last_playlist_ext
);
703 /****************************************************************************
705 ****************************************************************************/
707 void DialogsProvider::streamingDialog( QWidget
*parent
,
708 const QStringList
& mrls
,
709 bool b_transcode_only
,
710 QStringList options
)
712 QStringList outputMRLs
;
715 // Does streaming multiple files make sense? I suppose so, just stream one
716 // after the other, but not at the moment.
717 if( !b_transcode_only
)
719 SoutDialog
*s
= new SoutDialog( parent
, p_intf
, mrls
[0] );
720 s
->setAttribute( Qt::WA_QuitOnClose
, false ); // See #4883
721 if( s
->exec() == QDialog::Accepted
)
723 outputMRLs
.append(s
->getMrl());
732 ConvertDialog
*s
= new ConvertDialog( parent
, p_intf
, mrls
);
733 s
->setAttribute( Qt::WA_QuitOnClose
, false ); // See #4883
734 if( s
->exec() == QDialog::Accepted
)
736 /* Clear the playlist. This is because we're going to be populating
738 playlist_Clear( THEPL
, pl_Unlocked
);
740 outputMRLs
= s
->getMrls();
750 if( !outputMRLs
.isEmpty() )
752 /* For all of our MRLs */
753 for(int i
= 0; i
< outputMRLs
.length(); i
++)
756 /* Duplicate the options list. This is because we need to have a
757 copy for every file we add to the playlist.*/
758 QStringList optionsCopy
;
759 for(int j
= 0; j
< options
.length(); j
++)
761 optionsCopy
.append(options
[j
]);
764 optionsCopy
+= outputMRLs
[i
].split( " :");
765 QString title
= "Converting " + mrls
[i
];
767 /* Add each file to convert to our playlist, making sure to not attempt to start playing it.*/
768 Open::openMRLwithOptions( p_intf
, mrls
[i
], &optionsCopy
, false, true, qtu( title
) );
771 /* Start the playlist from the beginning */
772 playlist_Control(THEPL
,PLAYLIST_PLAY
,pl_Unlocked
);
776 void DialogsProvider::openAndStreamingDialogs()
778 OpenDialog::getInstance( p_intf
->p_sys
->p_mi
, p_intf
, false, OPEN_AND_STREAM
)
779 ->showTab( OPEN_FILE_TAB
);
782 void DialogsProvider::openAndTranscodingDialogs()
784 OpenDialog::getInstance( p_intf
->p_sys
->p_mi
, p_intf
, false, OPEN_AND_SAVE
)
785 ->showTab( OPEN_FILE_TAB
);
788 void DialogsProvider::loadSubtitlesFile()
790 input_thread_t
*p_input
= THEMIM
->getInput();
791 if( !p_input
) return;
793 input_item_t
*p_item
= input_GetItem( p_input
);
794 if( !p_item
) return;
796 char *path
= input_item_GetURI( p_item
);
800 path2
= vlc_uri2path( path
);
804 char *sep
= strrchr( path2
, DIR_SEP_CHAR
);
805 if( sep
) *sep
= '\0';
809 QStringList qsl
= showSimpleOpen( qtr( "Open subtitles..." ),
813 foreach( const QString
&qsUrl
, qsl
)
815 if( input_AddSlave( p_input
, SLAVE_TYPE_SPU
, qtu( qsUrl
), true, true, false ) )
816 msg_Warn( p_intf
, "unable to load subtitles from '%s'",
822 /****************************************************************************
824 ****************************************************************************/
826 void DialogsProvider::menuAction( QObject
*data
)
828 VLCMenuBar::DoAction( data
);
831 void DialogsProvider::menuUpdateAction( QObject
*data
)
833 MenuFunc
*func
= qobject_cast
<MenuFunc
*>(data
);
835 func
->doFunc( p_intf
);
838 void DialogsProvider::sendKey( int key
)
840 // translate from a vlc keycode into a Qt sequence
841 QKeySequence
kseq0( VLCKeyToString( key
, true ) );
843 if( popupMenu
== NULL
)
845 // make sure at least a non visible popupmenu is available
846 popupMenu
= VLCMenuBar::PopupMenu( p_intf
, false );
847 if( unlikely( popupMenu
== NULL
) )
851 // test against key accelerators from the popupmenu
852 QList
<QAction
*> actions
= popupMenu
->findChildren
<QAction
*>();
853 for( int i
= 0; i
< actions
.size(); i
++ )
855 QAction
* action
= actions
.at(i
);
856 QKeySequence kseq
= action
->shortcut();
864 // forward key to vlc core when not a key accelerator
865 var_SetInteger( p_intf
->obj
.libvlc
, "key-pressed", key
);