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

Qt, menu: split the subtitle menu from video menu

This is one of the most used function, and thus makes it faster to
activate
parent f3d3e076
...@@ -581,7 +581,7 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current ) ...@@ -581,7 +581,7 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
} }
/* Subtitles */ /* Subtitles */
void QVLCMenu::SubMenu( intf_thread_t *p_intf, QMenu *current ) QMenu *QVLCMenu::SubMenu( intf_thread_t *p_intf, QMenu *current )
{ {
QAction *action; QAction *action;
QMenu *submenu = new QMenu( qtr( "&Subtitles Track" ), current ); QMenu *submenu = new QMenu( qtr( "&Subtitles Track" ), current );
...@@ -590,6 +590,7 @@ void QVLCMenu::SubMenu( intf_thread_t *p_intf, QMenu *current ) ...@@ -590,6 +590,7 @@ void QVLCMenu::SubMenu( intf_thread_t *p_intf, QMenu *current )
addDPStaticEntry( submenu, qtr( "Open File..." ), "", addDPStaticEntry( submenu, qtr( "Open File..." ), "",
SLOT( loadSubtitlesFile() ) ); SLOT( loadSubtitlesFile() ) );
submenu->addSeparator(); submenu->addSeparator();
return submenu;
} }
/** /**
...@@ -965,11 +966,13 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show ) ...@@ -965,11 +966,13 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
/* Video menu */ /* Video menu */
submenu = new QMenu( menu ); submenu = new QMenu( menu );
action = menu->addMenu( VideoMenu( p_intf, submenu ) ); action = menu->addMenu( VideoMenu( p_intf, submenu, false ) );
action->setText( qtr( "&Video" ) ); action->setText( qtr( "&Video" ) );
if( action->menu()->isEmpty() ) if( action->menu()->isEmpty() )
action->setEnabled( false ); action->setEnabled( false );
SubMenu( p_intf, menu )->setTitle( qtr( "Subti&tle") );
/* Playback menu for chapters */ /* Playback menu for chapters */
submenu = new QMenu( menu ); submenu = new QMenu( menu );
action = menu->addMenu( NavigMenu( p_intf, submenu ) ); action = menu->addMenu( NavigMenu( p_intf, submenu ) );
......
...@@ -113,7 +113,7 @@ private: ...@@ -113,7 +113,7 @@ private:
static QMenu *VideoMenu( intf_thread_t *p_intf, QWidget *parent ) { static QMenu *VideoMenu( intf_thread_t *p_intf, QWidget *parent ) {
return VideoMenu( p_intf, new QMenu( parent ) ); return VideoMenu( p_intf, new QMenu( parent ) );
} }
static void SubMenu(intf_thread_t *p_intf, QMenu *current); static QMenu *SubMenu(intf_thread_t *p_intf, QMenu *current);
static QMenu *AudioMenu( intf_thread_t *, QMenu * ); static QMenu *AudioMenu( intf_thread_t *, QMenu * );
static QMenu *AudioMenu( intf_thread_t *p_intf, QWidget *parent ) { static QMenu *AudioMenu( intf_thread_t *p_intf, QWidget *parent ) {
......
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