Commit 9ea4f58e authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: Subtitles menu

parent 9cbd95e7
......@@ -321,6 +321,7 @@ void VLCMenuBar::createMenuBar( MainInterface *mi,
BAR_DADD( NavigMenu( p_intf, bar ), qtr( "P&layback" ), 3 );
BAR_DADD( AudioMenu( p_intf, bar ), qtr( "&Audio" ), 1 );
BAR_DADD( VideoMenu( p_intf, bar ), qtr( "&Video" ), 2 );
BAR_DADD( SubtitleMenu( p_intf, bar ), qtr( "Subti&tle" ), 5 );
addMenuToMainbar( ToolsMenu( bar ), qtr( "&Tools" ), bar );
......@@ -619,8 +620,10 @@ QMenu *VLCMenuBar::AudioMenu( intf_thread_t *p_intf, QMenu * current )
}
/* Subtitles */
QMenu *VLCMenuBar::SubtitleMenu( QMenu *current )
QMenu *VLCMenuBar::SubtitleMenu( intf_thread_t *, QMenu *current )
{
if( current->isEmpty() )
{
QAction *action;
QMenu *submenu = new QMenu( qtr( "&Subtitle Track" ), current );
action = current->addMenu( submenu );
......@@ -628,7 +631,8 @@ QMenu *VLCMenuBar::SubtitleMenu( QMenu *current )
addDPStaticEntry( submenu, qtr( "Open File..." ), "",
SLOT( loadSubtitlesFile() ) );
submenu->addSeparator();
return submenu;
}
return current;
}
/**
......@@ -646,7 +650,7 @@ QMenu *VLCMenuBar::VideoMenu( intf_thread_t *p_intf, QMenu *current, bool b_subt
{
addActionWithSubmenu( current, "video-es", qtr( "Video &Track" ) );
if( b_subtitle)
SubtitleMenu( current );
SubtitleMenu( p_intf, current );
current->addSeparator();
/* Surface modifiers */
......@@ -1036,7 +1040,7 @@ void VLCMenuBar::PopupMenu( intf_thread_t *p_intf, bool show )
if( action->menu()->isEmpty() )
action->setEnabled( false );
submenu = SubtitleMenu( menu );
submenu = SubtitleMenu( p_intf, menu );
submenu->setTitle( qtr( "Subti&tle") );
UpdateItem( p_intf, menu, "spu-es", VLC_OBJECT(p_input), true );
......
......@@ -117,11 +117,14 @@ private:
}
static QMenu *RebuildNavigMenu( intf_thread_t *, QMenu *, bool b_keep = false );
static QMenu *VideoMenu( intf_thread_t *, QMenu *, bool b_subtitle = true );
static QMenu *VideoMenu( intf_thread_t *, QMenu *, bool b_subtitle = false );
static QMenu *VideoMenu( intf_thread_t *p_intf, QWidget *parent ) {
return VideoMenu( p_intf, new QMenu( parent ) );
}
static QMenu *SubtitleMenu( QMenu *current);
static QMenu *SubtitleMenu( intf_thread_t *, QMenu *current);
static QMenu *SubtitleMenu( intf_thread_t *p_intf, QWidget *parent) {
return SubtitleMenu( p_intf, new QMenu( parent ) );
}
static QMenu *AudioMenu( intf_thread_t *, QMenu * );
static QMenu *AudioMenu( intf_thread_t *p_intf, QWidget *parent ) {
......@@ -173,6 +176,7 @@ public:
case 2: VLCMenuBar::VideoMenu( p_intf, menu ); break;
case 3: VLCMenuBar::RebuildNavigMenu( p_intf, menu ); break;
case 4: VLCMenuBar::ViewMenu( p_intf, menu ); break;
case 5: VLCMenuBar::SubtitleMenu( p_intf, menu ); break;
}
}
private:
......
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