Commit d8e39549 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Popup Menu: Add open and help. Correct the tool menu behaviour. Other small fix.

parent 3a9d24fa
...@@ -440,9 +440,23 @@ QMenu *QVLCMenu::HelpMenu() ...@@ -440,9 +440,23 @@ QMenu *QVLCMenu::HelpMenu()
intfmenu->setTitle( qtr("Interfaces" ) ); \ intfmenu->setTitle( qtr("Interfaces" ) ); \
menu->addMenu( intfmenu ); \ menu->addMenu( intfmenu ); \
\ \
QMenu *toolsmenu = ToolsMenu( p_intf, NULL, false, false ); \ QMenu *toolsmenu = ToolsMenu( p_intf, NULL, false, false, false ); \
toolsmenu->setTitle( qtr("Tools" ) ); \ toolsmenu->setTitle( qtr("Tools" ) ); \
menu->addMenu( toolsmenu ); \ menu->addMenu( toolsmenu ); \
\
QMenu *openmenu = new QMenu( qtr("Open") ); \
openmenu->addAction( qtr("Open &File..." ), THEDP, SLOT( openFileDialog() ) ); \
openmenu->addAction( qtr("Open &Disc..." ), THEDP, SLOT( openDiscDialog() ) ); \
openmenu->addAction( qtr("Open &Network..." ), THEDP, SLOT( openNetDialog() ) ); \
openmenu->addAction( qtr("Open &Capture Device..." ), THEDP, \
SLOT( openCaptureDialog() ) ); \
menu->addMenu( openmenu ); \
\
menu->addSeparator(); \
QMenu *helpmenu = HelpMenu(); \
helpmenu->setTitle( qtr("Help") ); \
menu->addMenu( helpmenu ); \
\
DP_SADD( qtr("Quit"), "", "", quit() , "Ctrl+Q" ); DP_SADD( qtr("Quit"), "", "", quit() , "Ctrl+Q" );
void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf ) void QVLCMenu::VideoPopupMenu( intf_thread_t *p_intf )
...@@ -513,55 +527,55 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show ) ...@@ -513,55 +527,55 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
{ {
if( show ) if( show )
{ {
// create a popup if there is none // create a popup if there is none
if( ! p_intf->p_sys->p_popup_menu ) if( ! p_intf->p_sys->p_popup_menu )
{ {
POPUP_BOILERPLATE; POPUP_BOILERPLATE;
if( p_input ) if( p_input )
{ {
vlc_object_yield( p_input ); vlc_object_yield( p_input );
InputAutoMenuBuilder( VLC_OBJECT(p_input), objects, varnames ); InputAutoMenuBuilder( VLC_OBJECT(p_input), objects, varnames );
/* Video menu */ /* Video menu */
PUSH_SEPARATOR; PUSH_SEPARATOR;
varnames.push_back( "video-es" ); varnames.push_back( "video-es" );
objects.push_back( p_input->i_object_id ); objects.push_back( p_input->i_object_id );
varnames.push_back( "spu-es" ); varnames.push_back( "spu-es" );
objects.push_back( p_input->i_object_id ); objects.push_back( p_input->i_object_id );
vlc_object_t *p_vout = (vlc_object_t *)vlc_object_find( p_input, vlc_object_t *p_vout = (vlc_object_t *)vlc_object_find( p_input,
VLC_OBJECT_VOUT, FIND_CHILD ); VLC_OBJECT_VOUT, FIND_CHILD );
if( p_vout ) if( p_vout )
{ {
VideoAutoMenuBuilder( p_vout, objects, varnames ); VideoAutoMenuBuilder( p_vout, objects, varnames );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
} }
/* Audio menu */ /* Audio menu */
PUSH_SEPARATOR PUSH_SEPARATOR
varnames.push_back( "audio-es" ); varnames.push_back( "audio-es" );
objects.push_back( p_input->i_object_id ); objects.push_back( p_input->i_object_id );
vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input, vlc_object_t *p_aout = (vlc_object_t *)vlc_object_find( p_input,
VLC_OBJECT_AOUT, FIND_ANYWHERE ); VLC_OBJECT_AOUT, FIND_ANYWHERE );
if( p_aout ) if( p_aout )
{ {
AudioAutoMenuBuilder( p_aout, objects, varnames ); AudioAutoMenuBuilder( p_aout, objects, varnames );
vlc_object_release( p_aout ); vlc_object_release( p_aout );
} }
} }
QMenu *menu = new QMenu(); QMenu *menu = new QMenu();
Populate( p_intf, menu, varnames, objects ); Populate( p_intf, menu, varnames, objects );
menu->addSeparator(); menu->addSeparator();
POPUP_STATIC_ENTRIES; POPUP_STATIC_ENTRIES;
p_intf->p_sys->p_popup_menu = menu; p_intf->p_sys->p_popup_menu = menu;
} }
p_intf->p_sys->p_popup_menu->popup( QCursor::pos() ); p_intf->p_sys->p_popup_menu->popup( QCursor::pos() );
} }
else else
{ {
// destroy popup if there is one // destroy popup if there is one
delete p_intf->p_sys->p_popup_menu; delete p_intf->p_sys->p_popup_menu;
p_intf->p_sys->p_popup_menu = NULL; p_intf->p_sys->p_popup_menu = NULL;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment