[vlc-commits] Qt, menu: split the subtitle menu from video menu
Jean-Baptiste Kempf
git at videolan.org
Mon Mar 21 00:07:44 CET 2011
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Mar 21 00:06:51 2011 +0100| [a9d32139325cf55d784c0804a4be96c1db687d73] | committer: Jean-Baptiste Kempf
Qt, menu: split the subtitle menu from video menu
This is one of the most used function, and thus makes it faster to
activate
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a9d32139325cf55d784c0804a4be96c1db687d73
---
modules/gui/qt4/menus.cpp | 7 +++++--
modules/gui/qt4/menus.hpp | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 67b8448..bed9552 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -581,7 +581,7 @@ QMenu *QVLCMenu::AudioMenu( intf_thread_t *p_intf, QMenu * current )
}
/* Subtitles */
-void QVLCMenu::SubMenu( intf_thread_t *p_intf, QMenu *current )
+QMenu *QVLCMenu::SubMenu( intf_thread_t *p_intf, QMenu *current )
{
QAction *action;
QMenu *submenu = new QMenu( qtr( "&Subtitles Track" ), current );
@@ -590,6 +590,7 @@ void QVLCMenu::SubMenu( intf_thread_t *p_intf, QMenu *current )
addDPStaticEntry( submenu, qtr( "Open File..." ), "",
SLOT( loadSubtitlesFile() ) );
submenu->addSeparator();
+ return submenu;
}
/**
@@ -965,11 +966,13 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
/* Video menu */
submenu = new QMenu( menu );
- action = menu->addMenu( VideoMenu( p_intf, submenu ) );
+ action = menu->addMenu( VideoMenu( p_intf, submenu, false ) );
action->setText( qtr( "&Video" ) );
if( action->menu()->isEmpty() )
action->setEnabled( false );
+ SubMenu( p_intf, menu )->setTitle( qtr( "Subti&tle") );
+
/* Playback menu for chapters */
submenu = new QMenu( menu );
action = menu->addMenu( NavigMenu( p_intf, submenu ) );
diff --git a/modules/gui/qt4/menus.hpp b/modules/gui/qt4/menus.hpp
index f0fd337..21ea0d9 100644
--- a/modules/gui/qt4/menus.hpp
+++ b/modules/gui/qt4/menus.hpp
@@ -113,7 +113,7 @@ private:
static QMenu *VideoMenu( intf_thread_t *p_intf, QWidget *parent ) {
return VideoMenu( p_intf, new QMenu( parent ) );
}
- static void SubMenu(intf_thread_t *p_intf, QMenu *current);
+ static QMenu *SubMenu(intf_thread_t *p_intf, QMenu *current);
static QMenu *AudioMenu( intf_thread_t *, QMenu * );
static QMenu *AudioMenu( intf_thread_t *p_intf, QWidget *parent ) {
More information about the vlc-commits
mailing list