[vlc-commits] Qt: fix subtitles track update

Jean-Baptiste Kempf git at videolan.org
Tue Apr 23 17:45:42 CEST 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Apr 23 17:19:24 2013 +0200| [b97b7eef648bc76c14a8a4c6c36bbf9c45088e8a] | committer: Jean-Baptiste Kempf

Qt: fix subtitles track update

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b97b7eef648bc76c14a8a4c6c36bbf9c45088e8a
---

 modules/gui/qt4/menus.cpp |   35 ++++++++++++++++++++++++-----------
 1 file changed, 24 insertions(+), 11 deletions(-)

diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 90b5f48..5b365e4 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -233,7 +233,6 @@ static int VideoAutoMenuBuilder( vout_thread_t *p_object,
         QVector<const char *> &varnames )
 {
     PUSH_INPUTVAR( "video-es" );
-    PUSH_INPUTVAR( "spu-es" );
     PUSH_VAR( "fullscreen" );
     PUSH_VAR( "video-on-top" );
     PUSH_VAR( "video-wallpaper" );
@@ -249,6 +248,17 @@ static int VideoAutoMenuBuilder( vout_thread_t *p_object,
     return VLC_SUCCESS;
 }
 
+static int SubsAutoMenuBuilder( input_thread_t *p_object,
+        QVector<vlc_object_t *> &objects,
+        QVector<const char *> &varnames )
+{
+    PUSH_VAR( "spu-es" );
+
+    return VLC_SUCCESS;
+}
+
+
+
 static int AudioAutoMenuBuilder( audio_output_t *p_object,
         input_thread_t *p_input,
         QVector<vlc_object_t *> &objects,
@@ -615,19 +625,24 @@ QMenu *VLCMenuBar::AudioMenu( intf_thread_t *p_intf, QMenu * current )
 }
 
 /* Subtitles */
-QMenu *VLCMenuBar::SubtitleMenu( intf_thread_t *, QMenu *current )
+QMenu *VLCMenuBar::SubtitleMenu( intf_thread_t *p_intf, QMenu *current )
 {
+    input_thread_t *p_input;
+    QVector<vlc_object_t *> objects;
+    QVector<const char *> varnames;
+
     if( current->isEmpty() )
     {
-        QAction *action;
-        QMenu *submenu = new QMenu( qtr( "&Subtitle Track" ), current );
-        action = current->addMenu( submenu );
-        action->setData( "spu-es" );
-        addDPStaticEntry( submenu, qtr( "Open File..." ), "",
+        addDPStaticEntry( current, qtr( "Add &Subtitle File..." ), "",
                 SLOT( loadSubtitlesFile() ) );
-        submenu->addSeparator();
+        addActionWithSubmenu( current, "spu-es", qtr( "Sub &Track" ) );
+        current->addSeparator();
     }
-    return current;
+
+    p_input = THEMIM->getInput();
+    SubsAutoMenuBuilder( p_input, objects, varnames );
+
+    return Populate( p_intf, current, varnames, objects );
 }
 
 /**
@@ -644,8 +659,6 @@ QMenu *VLCMenuBar::VideoMenu( intf_thread_t *p_intf, QMenu *current, bool b_subt
     if( current->isEmpty() )
     {
         addActionWithSubmenu( current, "video-es", qtr( "Video &Track" ) );
-        if( b_subtitle)
-            SubtitleMenu( p_intf, current );
 
         current->addSeparator();
         /* Surface modifiers */



More information about the vlc-commits mailing list