[vlc-commits] Qt: fix subtitle popup menu

Jean-Baptiste Kempf git at videolan.org
Sat Sep 28 22:44:57 CEST 2013


vlc/vlc-2.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Sep 28 22:43:25 2013 +0200| [ee0352d1f32e0a5878e944ee0ba8f6c9604ed2ad] | committer: Jean-Baptiste Kempf

Qt: fix subtitle popup menu

(cherry picked from commit d56da1224dd818b76aacaa08c7a35977cb4c9106)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt4/menus.cpp |   12 +++++++-----
 modules/gui/qt4/menus.hpp |    2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 2cb7617..d956ee2 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -626,13 +626,13 @@ QMenu *VLCMenuBar::AudioMenu( intf_thread_t *p_intf, QMenu * current )
 }
 
 /* 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;
     QVector<vlc_object_t *> objects;
     QVector<const char *> varnames;
 
-    if( current->isEmpty() )
+    if( current->isEmpty() || b_popup )
     {
         addDPStaticEntry( current, qtr( "Add &Subtitle File..." ), "",
                 SLOT( loadSubtitlesFile() ) );
@@ -1046,9 +1046,11 @@ void VLCMenuBar::PopupMenu( intf_thread_t *p_intf, bool show )
         if( action->menu()->isEmpty() )
             action->setEnabled( false );
 
-        submenu = SubtitleMenu( p_intf, menu );
-        submenu->setTitle( qtr( "Subti&tle") );
-        UpdateItem( p_intf, menu, "spu-es", VLC_OBJECT(p_input), true );
+        /* Subtitles menu */
+        submenu = new QMenu( menu );
+        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 */
         submenu = new QMenu( menu );
diff --git a/modules/gui/qt4/menus.hpp b/modules/gui/qt4/menus.hpp
index 6d5e006..3b39c7b 100644
--- a/modules/gui/qt4/menus.hpp
+++ b/modules/gui/qt4/menus.hpp
@@ -122,7 +122,7 @@ private:
     static QMenu *VideoMenu( intf_thread_t *p_intf, QWidget *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) {
         return SubtitleMenu( p_intf, new QMenu( parent ) );
     }



More information about the vlc-commits mailing list