1 /*****************************************************************************
2 * dialogs_provider.cpp : Dialog Provider
3 *****************************************************************************
4 * Copyright (C) 2006-2009 the VideoLAN team
6 * Authors: Clément Stenac <zorglub@videolan.org>
7 * Jean-Baptiste Kempf <jb@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
28 #include <vlc_intf_strings.h>
31 #include "dialogs_provider.hpp"
32 #include "input_manager.hpp" /* Load Subtitles */
34 #include "recents.hpp"
35 #include "util/qt_dirs.hpp"
36 #include "util/customwidgets.hpp" /* VLCKeyToString() */
37 #include "main_interface.hpp"
40 #include "dialogs/playlist.hpp"
41 #include "dialogs/bookmarks.hpp"
42 #include "dialogs/preferences.hpp"
43 #include "dialogs/mediainfo.hpp"
44 #include "dialogs/messages.hpp"
45 #include "dialogs/extended.hpp"
46 #include "dialogs/vlm.hpp"
47 #include "dialogs/sout.hpp"
48 #include "dialogs/convert.hpp"
49 #include "dialogs/open.hpp"
50 #include "dialogs/openurl.hpp"
51 #include "dialogs/help.hpp"
52 #include "dialogs/gototime.hpp"
53 #include "dialogs/podcast_configuration.hpp"
54 #include "dialogs/toolbar.hpp"
55 #include "dialogs/plugins.hpp"
56 #include "dialogs/external.hpp"
57 #include "dialogs/epg.hpp"
58 #include "dialogs/errors.hpp"
61 #include <QApplication>
62 #include <QSignalMapper>
63 #include <QFileDialog>
66 #define I_OP_DIR_WINTITLE I_DIR_OR_FOLDER( N_("Open Directory"), \
69 DialogsProvider
* DialogsProvider::instance
= NULL
;
71 DialogsProvider::DialogsProvider( intf_thread_t
*_p_intf
) :
72 QObject( NULL
), p_intf( _p_intf
),
74 videoPopupMenu( NULL
),
75 audioPopupMenu( NULL
),
80 /* Various signal mappers for the menus */
81 menusMapper
= new QSignalMapper();
82 CONNECT( menusMapper
, mapped(QObject
*), this, menuAction( QObject
*) );
84 menusUpdateMapper
= new QSignalMapper();
85 CONNECT( menusUpdateMapper
, mapped(QObject
*),
86 this, menuUpdateAction( QObject
*) );
88 new DialogHandler (p_intf
, this );
91 DialogsProvider::~DialogsProvider()
93 PlaylistDialog::killInstance();
94 MediaInfoDialog::killInstance();
95 MessagesDialog::killInstance();
96 BookmarksDialog::killInstance();
98 VLMDialog::killInstance();
100 HelpDialog::killInstance();
102 UpdateDialog::killInstance();
104 PluginDialog::killInstance();
105 EpgDialog::killInstance();
108 delete menusUpdateMapper
;
111 delete videoPopupMenu
;
112 delete audioPopupMenu
;
113 delete miscPopupMenu
;
115 /* free parentless menus */
116 VLCMenuBar::freeRecentsMenu();
117 VLCMenuBar::freeRendererMenu();
120 QString
DialogsProvider::getSaveFileName( QWidget
*parent
,
121 const QString
&caption
,
123 const QString
&filter
,
124 QString
*selectedFilter
)
126 const QStringList schemes
= QStringList(QStringLiteral("file"));
127 return QFileDialog::getSaveFileUrl( parent
, caption
, dir
, filter
, selectedFilter
, QFileDialog::Options(), schemes
).toLocalFile();
130 void DialogsProvider::quit()
133 libvlc_Quit( p_intf
->obj
.libvlc
);
136 void DialogsProvider::customEvent( QEvent
*event
)
138 if( event
->type() == DialogEvent::DialogEvent_Type
)
140 DialogEvent
*de
= static_cast<DialogEvent
*>(event
);
141 switch( de
->i_dialog
)
143 case INTF_DIALOG_FILE_SIMPLE
:
144 case INTF_DIALOG_FILE
:
146 case INTF_DIALOG_FILE_GENERIC
:
147 openFileGenericDialog( de
->p_arg
); break;
148 case INTF_DIALOG_DISC
:
149 openDiscDialog(); break;
150 case INTF_DIALOG_NET
:
151 openNetDialog(); break;
152 case INTF_DIALOG_SAT
:
153 case INTF_DIALOG_CAPTURE
:
154 openCaptureDialog(); break;
155 case INTF_DIALOG_DIRECTORY
:
156 PLAppendDir(); break;
157 case INTF_DIALOG_PLAYLIST
:
158 playlistDialog(); break;
159 case INTF_DIALOG_MESSAGES
:
160 messagesDialog(); break;
161 case INTF_DIALOG_FILEINFO
:
162 mediaInfoDialog(); break;
163 case INTF_DIALOG_PREFS
:
164 prefsDialog(); break;
165 case INTF_DIALOG_BOOKMARKS
:
166 bookmarksDialog(); break;
167 case INTF_DIALOG_EXTENDED
:
168 extendedDialog(); break;
169 case INTF_DIALOG_SENDKEY
:
170 sendKey( de
->i_arg
); break;
172 case INTF_DIALOG_VLM
:
175 case INTF_DIALOG_POPUPMENU
:
177 delete popupMenu
; popupMenu
= NULL
;
178 bool show
= (de
->i_arg
!= 0);
181 //popping a QMenu prevents mouse release events to be received,
182 //this ensures the coherency of the vout mouse state.
183 emit
releaseMouseEvents();
184 popupMenu
= VLCMenuBar::PopupMenu( p_intf
, show
);
188 case INTF_DIALOG_AUDIOPOPUPMENU
:
190 delete audioPopupMenu
; audioPopupMenu
= NULL
;
191 bool show
= (de
->i_arg
!= 0);
193 audioPopupMenu
= VLCMenuBar::AudioPopupMenu( p_intf
, show
);
196 case INTF_DIALOG_VIDEOPOPUPMENU
:
198 delete videoPopupMenu
; videoPopupMenu
= NULL
;
199 bool show
= (de
->i_arg
!= 0);
201 videoPopupMenu
= VLCMenuBar::VideoPopupMenu( p_intf
, show
);
204 case INTF_DIALOG_MISCPOPUPMENU
:
206 delete miscPopupMenu
; miscPopupMenu
= NULL
;
207 bool show
= (de
->i_arg
!= 0);
209 miscPopupMenu
= VLCMenuBar::MiscPopupMenu( p_intf
, show
);
212 case INTF_DIALOG_WIZARD
:
213 case INTF_DIALOG_STREAMWIZARD
:
214 openAndStreamingDialogs(); break;
216 case INTF_DIALOG_UPDATEVLC
:
217 updateDialog(); break;
219 case INTF_DIALOG_EXIT
:
222 msg_Warn( p_intf
, "unimplemented dialog" );
227 /****************************************************************************
228 * Individual simple dialogs
229 ****************************************************************************/
230 const QEvent::Type
DialogEvent::DialogEvent_Type
=
231 (QEvent::Type
)QEvent::registerEventType();
233 void DialogsProvider::playlistDialog()
235 PlaylistDialog::getInstance( p_intf
)->toggleVisible();
238 void DialogsProvider::prefsDialog()
240 PrefsDialog
*p
= new PrefsDialog( (QWidget
*)p_intf
->p_sys
->p_mi
, p_intf
);
244 void DialogsProvider::extendedDialog()
246 ExtendedDialog
*extDialog
= ExtendedDialog::getInstance(p_intf
);
248 if( !extDialog
->isVisible() || /* Hidden */
249 extDialog
->currentTab() != 0 ) /* wrong tab */
250 extDialog
->showTab( 0 );
255 void DialogsProvider::synchroDialog()
257 ExtendedDialog
*extDialog
= ExtendedDialog::getInstance(p_intf
);
259 if( !extDialog
->isVisible() || /* Hidden */
260 extDialog
->currentTab() != 2 ) /* wrong tab */
261 extDialog
->showTab( 2 );
266 void DialogsProvider::messagesDialog()
268 MessagesDialog::getInstance( p_intf
)->toggleVisible();
271 void DialogsProvider::gotoTimeDialog()
273 GotoTimeDialog::getInstance( p_intf
)->toggleVisible();
277 void DialogsProvider::vlmDialog()
279 VLMDialog::getInstance( p_intf
)->toggleVisible();
283 void DialogsProvider::helpDialog()
285 HelpDialog::getInstance( p_intf
)->toggleVisible();
289 void DialogsProvider::updateDialog()
291 UpdateDialog::getInstance( p_intf
)->toggleVisible();
295 void DialogsProvider::aboutDialog()
297 AboutDialog::getInstance( p_intf
)->toggleVisible();
300 void DialogsProvider::mediaInfoDialog()
302 MediaInfoDialog
*dialog
= MediaInfoDialog::getInstance( p_intf
);
303 if( !dialog
->isVisible() || dialog
->currentTab() != MediaInfoDialog::META_PANEL
)
304 dialog
->showTab( MediaInfoDialog::META_PANEL
);
309 void DialogsProvider::mediaCodecDialog()
311 MediaInfoDialog
*dialog
= MediaInfoDialog::getInstance( p_intf
);
312 if( !dialog
->isVisible() || dialog
->currentTab() != MediaInfoDialog::INFO_PANEL
)
313 dialog
->showTab( MediaInfoDialog::INFO_PANEL
);
318 void DialogsProvider::bookmarksDialog()
320 BookmarksDialog::getInstance( p_intf
)->toggleVisible();
323 void DialogsProvider::podcastConfigureDialog()
325 PodcastConfigDialog::getInstance( p_intf
)->toggleVisible();
328 void DialogsProvider::toolbarDialog()
330 ToolbarEditDialog
*toolbarEditor
= new ToolbarEditDialog( (QWidget
*)p_intf
->p_sys
->p_mi
, p_intf
);
331 if( toolbarEditor
->exec() == QDialog::Accepted
)
332 emit
toolBarConfUpdated();
335 void DialogsProvider::pluginDialog()
337 PluginDialog::getInstance( p_intf
)->toggleVisible();
340 void DialogsProvider::epgDialog()
342 EpgDialog::getInstance( p_intf
)->toggleVisible();
345 void DialogsProvider::setPopupMenu()
348 popupMenu
= VLCMenuBar::PopupMenu( p_intf
, true );
351 void DialogsProvider::destroyPopupMenu()
357 /* Generic open file */
358 void DialogsProvider::openFileGenericDialog( intf_dialog_args_t
*p_arg
)
362 msg_Warn( p_intf
, "openFileGenericDialog() called with NULL arg" );
366 /* Replace the extensions to a Qt format */
368 QString extensions
= qfu( p_arg
->psz_extensions
);
369 while ( ( i
= extensions
.indexOf( "|", i
) ) != -1 )
371 if( ( extensions
.count( "|" ) % 2 ) == 0 )
372 extensions
.replace( i
, 1, ");;" );
374 extensions
.replace( i
, 1, "(" );
376 extensions
.replace( ";*", " *" );
377 extensions
.append( ")" );
382 QString file
= getSaveFileName( NULL
,
383 qfu( p_arg
->psz_title
),
384 p_intf
->p_sys
->filepath
, extensions
);
385 if( !file
.isEmpty() )
387 p_arg
->i_results
= 1;
388 p_arg
->psz_results
= (char **)vlc_alloc( p_arg
->i_results
, sizeof( char * ) );
389 p_arg
->psz_results
[0] = strdup( qtu( toNativeSepNoSlash( file
) ) );
392 p_arg
->i_results
= 0;
394 else /* non-save mode */
396 QList
<QUrl
> urls
= QFileDialog::getOpenFileUrls( NULL
, qfu( p_arg
->psz_title
),
397 p_intf
->p_sys
->filepath
, extensions
);
398 p_arg
->i_results
= urls
.count();
399 p_arg
->psz_results
= (char **)vlc_alloc( p_arg
->i_results
, sizeof( char * ) );
401 foreach( const QUrl
&uri
, urls
)
402 p_arg
->psz_results
[i
++] = strdup( uri
.toEncoded().constData() );
403 if( !urls
.isEmpty() )
404 p_intf
->p_sys
->filepath
= urls
.last();
408 if( p_arg
->pf_callback
)
409 p_arg
->pf_callback( p_arg
);
411 /* Clean afterwards */
412 if( p_arg
->psz_results
)
414 for( i
= 0; i
< p_arg
->i_results
; i
++ )
415 free( p_arg
->psz_results
[i
] );
416 free( p_arg
->psz_results
);
418 free( p_arg
->psz_title
);
419 free( p_arg
->psz_extensions
);
422 /****************************************************************************
423 * All the open/add stuff
424 * Open Dialog first - Simple Open then
425 ****************************************************************************/
427 void DialogsProvider::openDialog( int i_tab
)
429 OpenDialog::getInstance( p_intf
->p_sys
->p_mi
, p_intf
)->showTab( i_tab
);
431 void DialogsProvider::openDialog()
433 openDialog( OPEN_FILE_TAB
);
435 void DialogsProvider::openFileDialog()
437 openDialog( OPEN_FILE_TAB
);
439 void DialogsProvider::openDiscDialog()
441 openDialog( OPEN_DISC_TAB
);
443 void DialogsProvider::openNetDialog()
445 openDialog( OPEN_NETWORK_TAB
);
447 void DialogsProvider::openCaptureDialog()
449 openDialog( OPEN_CAPTURE_TAB
);
452 /* Same as the open one, but force the enqueue */
453 void DialogsProvider::PLAppendDialog( int tab
)
455 OpenDialog::getInstance( p_intf
->p_sys
->p_mi
, p_intf
, false,
456 OPEN_AND_ENQUEUE
)->showTab( tab
);
462 QStringList
DialogsProvider::showSimpleOpen( const QString
& help
,
466 QString fileTypes
= "";
467 if( filters
& EXT_FILTER_MEDIA
) {
468 ADD_EXT_FILTER( fileTypes
, EXTENSIONS_MEDIA
);
470 if( filters
& EXT_FILTER_VIDEO
) {
471 ADD_EXT_FILTER( fileTypes
, EXTENSIONS_VIDEO
);
473 if( filters
& EXT_FILTER_AUDIO
) {
474 ADD_EXT_FILTER( fileTypes
, EXTENSIONS_AUDIO
);
476 if( filters
& EXT_FILTER_PLAYLIST
) {
477 ADD_EXT_FILTER( fileTypes
, EXTENSIONS_PLAYLIST
);
479 if( filters
& EXT_FILTER_SUBTITLE
) {
480 ADD_EXT_FILTER( fileTypes
, EXTENSIONS_SUBTITLE
);
482 ADD_EXT_FILTER( fileTypes
, EXTENSIONS_ALL
);
483 fileTypes
.replace( ";*", " *");
484 fileTypes
.chop(2); //remove trailling ";;"
486 QList
<QUrl
> urls
= QFileDialog::getOpenFileUrls( NULL
,
487 help
.isEmpty() ? qtr(I_OP_SEL_FILES
) : help
,
488 path
.isEmpty() ? p_intf
->p_sys
->filepath
: path
,
491 if( !urls
.isEmpty() )
492 p_intf
->p_sys
->filepath
= urls
.last();
495 foreach( const QUrl
&url
, urls
)
496 res
<< url
.toEncoded();
501 void DialogsProvider::simpleOpenDialog()
503 QStringList urls
= DialogsProvider::showSimpleOpen();
507 foreach( const QString
&url
, urls
)
509 Open::openMRL( p_intf
, url
, first
);
514 /* Url & Clipboard */
517 * If the clipboard contains URLs, the first is automatically 'preselected'.
519 void DialogsProvider::openUrlDialog()
521 OpenUrlDialog
oud( p_intf
);
522 if( oud
.exec() != QDialog::Accepted
)
525 QString url
= oud
.url();
529 if( !url
.contains( qfu( "://" ) ) )
531 char *uri
= vlc_path2uri( qtu( url
), NULL
);
538 Open::openMRL( p_intf
, qtu(url
), !oud
.shouldEnqueue() );
544 * pl helps you to choose from playlist or media library,
545 * go to start or enqueue
547 static void openDirectory( intf_thread_t
*p_intf
, bool go
)
549 QString uri
= DialogsProvider::getDirectoryDialog( p_intf
);
551 Open::openMRL( p_intf
, uri
, go
);
554 QString
DialogsProvider::getDirectoryDialog( intf_thread_t
*p_intf
)
556 const QStringList schemes
= QStringList(QStringLiteral("file"));
557 QUrl dirurl
= QFileDialog::getExistingDirectoryUrl( NULL
,
558 qtr( I_OP_DIR_WINTITLE
), p_intf
->p_sys
->filepath
,
559 QFileDialog::ShowDirsOnly
, schemes
);
561 if( dirurl
.isEmpty() ) return QString();
563 p_intf
->p_sys
->filepath
= dirurl
;
565 QString dir
= dirurl
.toLocalFile();
566 const char *scheme
= "directory";
567 if( dir
.endsWith( DIR_SEP
"VIDEO_TS", Qt::CaseInsensitive
) )
569 else if( dir
.endsWith( DIR_SEP
"BDMV", Qt::CaseInsensitive
) )
572 dir
.remove( "BDMV" );
575 char *uri
= vlc_path2uri( qtu( toNativeSeparators( dir
) ), scheme
);
576 if( unlikely(uri
== NULL
) )
582 RecentsMRL::getInstance( p_intf
)->addRecent( dir
);
587 void DialogsProvider::PLOpenDir()
589 openDirectory( p_intf
, true );
592 void DialogsProvider::PLAppendDir()
594 openDirectory( p_intf
, false );
600 void DialogsProvider::openAPlaylist()
602 QStringList urls
= showSimpleOpen( qtr( "Open playlist..." ),
603 EXT_FILTER_PLAYLIST
);
604 foreach( const QString
&url
, urls
)
606 char* psz_path
= vlc_uri2path(qtu( url
));
609 msg_Warn( p_intf
, "unable to load playlist '%s'", qtu( url
) );
612 playlist_Import( THEPL
, psz_path
);
617 void DialogsProvider::savePlayingToPlaylist()
621 char filter_name
[14];
622 char filter_patterns
[5];
625 { N_("XSPF playlist"), "xspf", "export-xspf", },
626 { N_("M3U playlist"), "m3u", "export-m3u", },
627 { N_("M3U8 playlist"), "m3u8", "export-m3u8", },
628 { N_("HTML playlist"), "html", "export-html", },
632 QString ext
= getSettings()->value( "last-playlist-ext" ).toString();
634 for( size_t i
= 0; i
< sizeof (types
) / sizeof (types
[0]); i
++ )
636 QString tmp
= qfu( vlc_gettext( types
[i
].filter_name
) ) + " (*." + types
[i
].filter_patterns
+ ")";
637 if( ext
== qfu( types
[i
].filter_patterns
) )
638 filters
.insert( 0, tmp
);
640 filters
.append( tmp
);
644 QString file
= getSaveFileName( NULL
,
645 qtr( "Save playlist as..." ),
646 p_intf
->p_sys
->filepath
, filters
.join( ";;" ),
648 const char *psz_selected_module
= NULL
;
649 const char *psz_last_playlist_ext
= NULL
;
654 /* First test if the file extension is set, and different to selected filter */
655 for( size_t i
= 0; i
< sizeof (types
) / sizeof (types
[0]); i
++)
657 if ( file
.endsWith( QString( "." ) + qfu( types
[i
].filter_patterns
) ) )
659 psz_selected_module
= types
[i
].module
;
660 psz_last_playlist_ext
= types
[i
].filter_patterns
;
665 /* otherwise apply the selected extension */
666 if ( !psz_last_playlist_ext
)
668 for( size_t i
= 0; i
< sizeof (types
) / sizeof (types
[0]); i
++)
670 if ( selected
.startsWith( qfu( vlc_gettext( types
[i
].filter_name
) ) ) )
672 psz_selected_module
= types
[i
].module
;
673 psz_last_playlist_ext
= types
[i
].filter_patterns
;
674 /* Fix file extension */
675 file
= file
.append( QString( "." ) + qfu( psz_last_playlist_ext
) );
681 if ( psz_selected_module
)
683 playlist_Export( THEPL
, qtu( toNativeSeparators( file
) ),
684 psz_selected_module
);
685 getSettings()->setValue( "last-playlist-ext", psz_last_playlist_ext
);
689 /****************************************************************************
691 ****************************************************************************/
693 void DialogsProvider::streamingDialog( QWidget
*parent
,
694 const QStringList
& mrls
,
695 bool b_transcode_only
,
696 QStringList options
)
698 QStringList outputMRLs
;
701 // Does streaming multiple files make sense? I suppose so, just stream one
702 // after the other, but not at the moment.
703 if( !b_transcode_only
)
705 SoutDialog
*s
= new SoutDialog( parent
, p_intf
, mrls
[0] );
706 s
->setAttribute( Qt::WA_QuitOnClose
, false ); // See #4883
707 if( s
->exec() == QDialog::Accepted
)
709 outputMRLs
.append(s
->getMrl());
718 ConvertDialog
*s
= new ConvertDialog( parent
, p_intf
, mrls
);
719 s
->setAttribute( Qt::WA_QuitOnClose
, false ); // See #4883
720 if( s
->exec() == QDialog::Accepted
)
722 /* Clear the playlist. This is because we're going to be populating
724 playlist_Clear( THEPL
, pl_Unlocked
);
726 outputMRLs
= s
->getMrls();
736 if( !outputMRLs
.isEmpty() )
738 /* For all of our MRLs */
739 for(int i
= 0; i
< outputMRLs
.length(); i
++)
742 /* Duplicate the options list. This is because we need to have a
743 copy for every file we add to the playlist.*/
744 QStringList optionsCopy
;
745 for(int j
= 0; j
< options
.length(); j
++)
747 optionsCopy
.append(options
[j
]);
750 optionsCopy
+= outputMRLs
[i
].split( " :");
751 QString title
= "Converting " + mrls
[i
];
753 /* Add each file to convert to our playlist, making sure to not attempt to start playing it.*/
754 Open::openMRLwithOptions( p_intf
, mrls
[i
], &optionsCopy
, false, qtu( title
) );
757 /* Start the playlist from the beginning */
758 playlist_Control(THEPL
,PLAYLIST_PLAY
,pl_Unlocked
);
762 void DialogsProvider::openAndStreamingDialogs()
764 OpenDialog::getInstance( p_intf
->p_sys
->p_mi
, p_intf
, false, OPEN_AND_STREAM
)
765 ->showTab( OPEN_FILE_TAB
);
768 void DialogsProvider::openAndTranscodingDialogs()
770 OpenDialog::getInstance( p_intf
->p_sys
->p_mi
, p_intf
, false, OPEN_AND_SAVE
)
771 ->showTab( OPEN_FILE_TAB
);
774 void DialogsProvider::loadSubtitlesFile()
776 input_thread_t
*p_input
= THEMIM
->getInput();
777 if( !p_input
) return;
779 input_item_t
*p_item
= input_GetItem( p_input
);
780 if( !p_item
) return;
782 char *path
= input_item_GetURI( p_item
);
786 url
.setUrl( qfu(path
) );
787 url
= url
.adjusted(QUrl::RemoveFilename
);
788 if (url
.scheme() != "file")
793 QStringList qsl
= showSimpleOpen( qtr( "Open subtitles..." ),
797 foreach( const QString
&qsUrl
, qsl
)
799 if( input_AddSlave( p_input
, SLAVE_TYPE_SPU
, qtu( qsUrl
), true, true, false ) )
800 msg_Warn( p_intf
, "unable to load subtitles from '%s'",
806 /****************************************************************************
808 ****************************************************************************/
810 void DialogsProvider::menuAction( QObject
*data
)
812 VLCMenuBar::DoAction( data
);
815 void DialogsProvider::menuUpdateAction( QObject
*data
)
817 MenuFunc
*func
= qobject_cast
<MenuFunc
*>(data
);
819 func
->doFunc( p_intf
);
822 void DialogsProvider::sendKey( int key
)
824 // translate from a vlc keycode into a Qt sequence
825 QKeySequence
kseq0( VLCKeyToString( key
, true ) );
827 if( popupMenu
== NULL
)
829 // make sure at least a non visible popupmenu is available
830 popupMenu
= VLCMenuBar::PopupMenu( p_intf
, false );
831 if( unlikely( popupMenu
== NULL
) )
835 // test against key accelerators from the popupmenu
836 QList
<QAction
*> actions
= popupMenu
->findChildren
<QAction
*>();
837 for( int i
= 0; i
< actions
.size(); i
++ )
839 QAction
* action
= actions
.at(i
);
840 QKeySequence kseq
= action
->shortcut();
848 // forward key to vlc core when not a key accelerator
849 var_SetInteger( p_intf
->obj
.libvlc
, "key-pressed", key
);