[vlc-devel] commit: Qt menus: use addDPStaticEntry and add a static Subtitles Loader in popup ( Jean-Philippe Andre )

git version control git at videolan.org
Tue Jun 17 05:36:13 CEST 2008


vlc | branch: master | Jean-Philippe Andre <jpeg at via.ecp.fr> | Tue Jun 17 01:25:29 2008 +0200| [a28bdff5986161bc5e762c6d29540e6d384a825f]

Qt menus: use addDPStaticEntry and add a static Subtitles Loader in popup

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt4/menus.cpp |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 0a5dbd0..6e14039 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -479,9 +479,8 @@ QMenu *QVLCMenu::VideoMenu( intf_thread_t *p_intf, QMenu *current )
         QMenu *submenu = new QMenu( qtr( "&Subtitles Track" ), current );
         action = current->addMenu( submenu );
         action->setData( "spu-es" );
-        action =  submenu->addAction( qfu( "Load File..." ), THEDP,
-                                      SLOT( loadSubtitlesFile() ) );
-        action->setData( "_static_" );
+        addDPStaticEntry( submenu, qtr( "Load File..." ), "", "",
+                          SLOT( loadSubtitlesFile() ) );
 
         ACT_ADD( current, "fullscreen", qtr( "Toggle &Fullscreen" ) );
         ACT_ADD( current, "zoom", qtr( "&Zoom" ) );
@@ -608,8 +607,6 @@ QMenu *QVLCMenu::HelpMenu( QMenu *current )
     return menu;
 }
 
-#undef ACT_ADD
-
 /*****************************************************************************
  * Popup menus - Right Click menus                                           *
  *****************************************************************************/
@@ -805,10 +802,18 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
                 action->setEnabled( false );
 
             /* Video menu */
+            submenu = new QMenu();
+            ACT_ADD( submenu, "video-es", qtr( "Video Track" ) );
+            QMenu *subsubmenu = new QMenu( qtr( "&Subtitles Track" ), submenu );
+            addDPStaticEntry( subsubmenu, qtr( "Load File..." ), "", "",
+                              SLOT( loadSubtitlesFile() ) );
+            action = submenu->addMenu( subsubmenu );
+            action->setData( "spu-es" );
+
             VideoAutoMenuBuilder( p_vout, p_input, objects, varnames );
             if( p_vout )
                 vlc_object_release( p_vout );
-            submenu = Populate( p_intf, NULL, varnames, objects );
+            Populate( p_intf, submenu, varnames, objects );
             varnames.clear(); objects.clear();
             action = menu->addMenu( submenu );
             action->setText( qtr( "Video" ) );
@@ -854,6 +859,8 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
     }
 }
 
+#undef ACT_ADD
+
 /************************************************************************
  * Systray Menu                                                         *
  ************************************************************************/




More information about the vlc-devel mailing list