Commit de832a15 authored by Jean-Philippe André's avatar Jean-Philippe André Committed by Jean-Baptiste Kempf

Better patch to fix bug introduced by 0448c670 See:...

Better patch to fix bug introduced by 0448c670 See: http://dinauz.org/~jpeg/VideoLAN/capture32.png (after left-click in the video output)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9565a093
...@@ -179,13 +179,13 @@ void QVLCMenu::createMenuBar( MainInterface *mi, ...@@ -179,13 +179,13 @@ void QVLCMenu::createMenuBar( MainInterface *mi,
QMenuBar *bar = mi->menuBar(); QMenuBar *bar = mi->menuBar();
BAR_ADD( FileMenu(), qtr( "&Media" ) ); BAR_ADD( FileMenu(), qtr( "&Media" ) );
BAR_ADD( PlaylistMenu( p_intf, mi ), qtr( "&Playlist" ) ); BAR_ADD( PlaylistMenu( p_intf, mi ), qtr( "&Playlist" ) );
BAR_ADD( ToolsMenu( p_intf, mi, visual_selector_enabled, true ), BAR_ADD( ToolsMenu( p_intf, NULL, mi, visual_selector_enabled, true ),
qtr( "&Tools" ) ); qtr( "&Tools" ) );
BAR_DADD( AudioMenu( p_intf, NULL ), qtr( "&Audio" ), 2 ); BAR_DADD( AudioMenu( p_intf, NULL ), qtr( "&Audio" ), 2 );
BAR_DADD( VideoMenu( p_intf, NULL ), qtr( "&Video" ), 1 ); BAR_DADD( VideoMenu( p_intf, NULL ), qtr( "&Video" ), 1 );
BAR_DADD( NavigMenu( p_intf, NULL ), qtr( "&Playback" ), 3 ); BAR_DADD( NavigMenu( p_intf, NULL ), qtr( "&Playback" ), 3 );
BAR_ADD( HelpMenu(), qtr( "&Help" ) ); BAR_ADD( HelpMenu( NULL ), qtr( "&Help" ) );
} }
#undef BAR_ADD #undef BAR_ADD
#undef BAR_DADD #undef BAR_DADD
...@@ -249,11 +249,12 @@ QMenu *QVLCMenu::PlaylistMenu( intf_thread_t *p_intf, MainInterface *mi ) ...@@ -249,11 +249,12 @@ QMenu *QVLCMenu::PlaylistMenu( intf_thread_t *p_intf, MainInterface *mi )
* This menu can be an interface menu but also a right click menu. * This menu can be an interface menu but also a right click menu.
**/ **/
QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf,
QMenu *current,
MainInterface *mi, MainInterface *mi,
bool visual_selector_enabled, bool visual_selector_enabled,
bool with_intf ) bool with_intf )
{ {
QMenu *menu = new QMenu; QMenu *menu = new QMenu( current );
if( mi ) if( mi )
{ {
menu->addAction( QIcon( ":/pixmaps/playlist_16px.png" ), menu->addAction( QIcon( ":/pixmaps/playlist_16px.png" ),
...@@ -268,7 +269,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, ...@@ -268,7 +269,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf,
if( with_intf ) if( with_intf )
{ {
QMenu *intfmenu = InterfacesMenu( p_intf, NULL ); QMenu *intfmenu = InterfacesMenu( p_intf, menu );
intfmenu->setTitle( qtr( "Add Interfaces" ) ); intfmenu->setTitle( qtr( "Add Interfaces" ) );
menu->addMenu( intfmenu ); menu->addMenu( intfmenu );
menu->addSeparator(); menu->addSeparator();
...@@ -333,7 +334,8 @@ QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current ) ...@@ -333,7 +334,8 @@ QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current )
varnames.push_back( "intf-add" ); varnames.push_back( "intf-add" );
objects.push_back( VLC_OBJECT(p_intf) ); objects.push_back( VLC_OBJECT(p_intf) );
QMenu *menu = Populate( p_intf, current, varnames, objects ); QMenu *submenu = new QMenu( current );
QMenu *menu = Populate( p_intf, submenu, varnames, objects );
CONNECT( menu, aboutToShow(), THEDP->menusUpdateMapper, map() ); CONNECT( menu, aboutToShow(), THEDP->menusUpdateMapper, map() );
THEDP->menusUpdateMapper->setMapping( menu, 4 ); THEDP->menusUpdateMapper->setMapping( menu, 4 );
...@@ -399,7 +401,7 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current ) ...@@ -399,7 +401,7 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
* Navigation Menu * Navigation Menu
* For DVD, MP4, MOV and other chapter based format * For DVD, MP4, MOV and other chapter based format
**/ **/
QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *navMenu ) QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *menu )
{ {
vlc_object_t *p_object; vlc_object_t *p_object;
vector<vlc_object_t *> objects; vector<vlc_object_t *> objects;
...@@ -414,7 +416,7 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *navMenu ) ...@@ -414,7 +416,7 @@ QMenu *QVLCMenu::NavigMenu( intf_thread_t *p_intf, QMenu *navMenu )
PUSH_VAR( "prev-chapter" ); PUSH_VAR( "next-chapter" ); PUSH_VAR( "prev-chapter" ); PUSH_VAR( "next-chapter" );
vlc_object_release( p_object ); vlc_object_release( p_object );
} }
navMenu = new QMenu(); QMenu *navMenu = new QMenu( menu );
addDPStaticEntry( navMenu, qtr( I_MENU_GOTOTIME ), "","", addDPStaticEntry( navMenu, qtr( I_MENU_GOTOTIME ), "","",
SLOT( gotoTimeDialog() ), "Ctrl+T" ); SLOT( gotoTimeDialog() ), "Ctrl+T" );
navMenu->addSeparator(); navMenu->addSeparator();
...@@ -462,9 +464,9 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf ) ...@@ -462,9 +464,9 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
/** /**
* Help/About Menu * Help/About Menu
**/ **/
QMenu *QVLCMenu::HelpMenu() QMenu *QVLCMenu::HelpMenu( QMenu *current )
{ {
QMenu *menu = new QMenu(); QMenu *menu = new QMenu( current );
addDPStaticEntry( menu, qtr( "Help..." ) , "", addDPStaticEntry( menu, qtr( "Help..." ) , "",
":/pixmaps/menus_help_16px.png", SLOT( helpDialog() ), "F1" ); ":/pixmaps/menus_help_16px.png", SLOT( helpDialog() ), "F1" );
#ifdef UPDATE_CHECK #ifdef UPDATE_CHECK
...@@ -522,11 +524,11 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu, ...@@ -522,11 +524,11 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu,
void QVLCMenu::PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu ) void QVLCMenu::PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu )
{ {
QMenu *toolsmenu = ToolsMenu( p_intf, NULL, false, true ); QMenu *toolsmenu = ToolsMenu( p_intf, menu, false, true );
toolsmenu->setTitle( qtr( "Tools" ) ); toolsmenu->setTitle( qtr( "Tools" ) );
menu->addMenu( toolsmenu ); menu->addMenu( toolsmenu );
QMenu *openmenu = new QMenu( qtr( "Open" ) ); QMenu *openmenu = new QMenu( qtr( "Open" ), menu );
openmenu->addAction( qtr( "Open &File..." ), THEDP, openmenu->addAction( qtr( "Open &File..." ), THEDP,
SLOT( openFileDialog() ) ); SLOT( openFileDialog() ) );
openmenu->addAction( qtr( "Open &Disc..." ), THEDP, openmenu->addAction( qtr( "Open &Disc..." ), THEDP,
...@@ -538,7 +540,7 @@ void QVLCMenu::PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu ) ...@@ -538,7 +540,7 @@ void QVLCMenu::PopupMenuStaticEntries( intf_thread_t *p_intf, QMenu *menu )
menu->addMenu( openmenu ); menu->addMenu( openmenu );
menu->addSeparator(); menu->addSeparator();
QMenu *helpmenu = HelpMenu(); QMenu *helpmenu = HelpMenu( menu );
helpmenu->setTitle( qtr( "Help" ) ); helpmenu->setTitle( qtr( "Help" ) );
menu->addMenu( helpmenu ); menu->addMenu( helpmenu );
...@@ -862,7 +864,7 @@ void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var, ...@@ -862,7 +864,7 @@ void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var,
/* Append choices menu */ /* Append choices menu */
if( b_submenu ) if( b_submenu )
{ {
QMenu *submenu = new QMenu(); QMenu *submenu = new QMenu( menu );
submenu->setTitle( qfu( text.psz_string ? submenu->setTitle( qfu( text.psz_string ?
text.psz_string : psz_var ) ); text.psz_string : psz_var ) );
if( CreateChoicesMenu( submenu, psz_var, p_object, true ) == 0 ) if( CreateChoicesMenu( submenu, psz_var, p_object, true ) == 0 )
...@@ -936,7 +938,7 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var, ...@@ -936,7 +938,7 @@ int QVLCMenu::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
{ {
vlc_value_t another_val; vlc_value_t another_val;
QString menutext; QString menutext;
QMenu *subsubmenu = new QMenu(); QMenu *subsubmenu = new QMenu( submenu );
switch( i_type & VLC_VAR_TYPE ) switch( i_type & VLC_VAR_TYPE )
{ {
......
...@@ -79,12 +79,12 @@ public: ...@@ -79,12 +79,12 @@ public:
static QMenu *FileMenu(); static QMenu *FileMenu();
static QMenu *SDMenu( intf_thread_t * ); static QMenu *SDMenu( intf_thread_t * );
static QMenu *PlaylistMenu( intf_thread_t *, MainInterface * ); static QMenu *PlaylistMenu( intf_thread_t *, MainInterface * );
static QMenu *ToolsMenu( intf_thread_t *, MainInterface *, bool, bool with = true ); static QMenu *ToolsMenu( intf_thread_t *, QMenu *, MainInterface *, bool, bool with = true );
static QMenu *NavigMenu( intf_thread_t * , QMenu * ); static QMenu *NavigMenu( intf_thread_t *, QMenu * );
static QMenu *VideoMenu( intf_thread_t * , QMenu * ); static QMenu *VideoMenu( intf_thread_t *, QMenu * );
static QMenu *AudioMenu( intf_thread_t * , QMenu * ); static QMenu *AudioMenu( intf_thread_t *, QMenu * );
static QMenu *InterfacesMenu( intf_thread_t *p_intf, QMenu * ); static QMenu *InterfacesMenu( intf_thread_t *p_intf, QMenu * );
static QMenu *HelpMenu(); static QMenu *HelpMenu( QMenu * );
/* Popups Menus */ /* Popups Menus */
static void AudioPopupMenu( intf_thread_t * ); static void AudioPopupMenu( intf_thread_t * );
......
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