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

Qt: fix subtitle popup menu

parent 586296da
...@@ -626,13 +626,13 @@ QMenu *VLCMenuBar::AudioMenu( intf_thread_t *p_intf, QMenu * current ) ...@@ -626,13 +626,13 @@ QMenu *VLCMenuBar::AudioMenu( intf_thread_t *p_intf, QMenu * current )
} }
/* Subtitles */ /* Subtitles */
QMenu *VLCMenuBar::SubtitleMenu( intf_thread_t *p_intf, QMenu *current ) QMenu *VLCMenuBar::SubtitleMenu( intf_thread_t *p_intf, QMenu *current, bool b_popup )
{ {
input_thread_t *p_input; input_thread_t *p_input;
QVector<vlc_object_t *> objects; QVector<vlc_object_t *> objects;
QVector<const char *> varnames; QVector<const char *> varnames;
if( current->isEmpty() ) if( current->isEmpty() || b_popup )
{ {
addDPStaticEntry( current, qtr( "Add &Subtitle File..." ), "", addDPStaticEntry( current, qtr( "Add &Subtitle File..." ), "",
SLOT( loadSubtitlesFile() ) ); SLOT( loadSubtitlesFile() ) );
...@@ -1046,9 +1046,11 @@ void VLCMenuBar::PopupMenu( intf_thread_t *p_intf, bool show ) ...@@ -1046,9 +1046,11 @@ void VLCMenuBar::PopupMenu( intf_thread_t *p_intf, bool show )
if( action->menu()->isEmpty() ) if( action->menu()->isEmpty() )
action->setEnabled( false ); action->setEnabled( false );
submenu = SubtitleMenu( p_intf, menu ); /* Subtitles menu */
submenu->setTitle( qtr( "Subti&tle") ); submenu = new QMenu( menu );
UpdateItem( p_intf, menu, "spu-es", VLC_OBJECT(p_input), true ); action = menu->addMenu( SubtitleMenu( p_intf, submenu, true ) );
action->setText( qtr( "Subti&tle") );
UpdateItem( p_intf, submenu, "spu-es", VLC_OBJECT(p_input), true );
/* Playback menu for chapters */ /* Playback menu for chapters */
submenu = new QMenu( menu ); submenu = new QMenu( menu );
......
...@@ -122,7 +122,7 @@ private: ...@@ -122,7 +122,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 QMenu *SubtitleMenu( intf_thread_t *, QMenu *current); static QMenu *SubtitleMenu( intf_thread_t *, QMenu *current, bool b_popup = false );
static QMenu *SubtitleMenu( intf_thread_t *p_intf, QWidget *parent) { static QMenu *SubtitleMenu( intf_thread_t *p_intf, QWidget *parent) {
return SubtitleMenu( p_intf, new QMenu( parent ) ); return SubtitleMenu( p_intf, new QMenu( 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