[vlc-devel] commit: Qt/Skins: give complete access to the Tools menu to the skins. Close #2275 (Jean-Baptiste Kempf )
git version control
git at videolan.org
Sat Feb 7 21:52:56 CET 2009
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Feb 7 21:51:26 2009 +0100| [3487d61ef0a3d29cd285cdd1ceccfd1310883725] | committer: Jean-Baptiste Kempf
Qt/Skins: give complete access to the Tools menu to the skins. Close #2275
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3487d61ef0a3d29cd285cdd1ceccfd1310883725
---
modules/gui/qt4/menus.cpp | 29 +++++++++--------------------
modules/gui/qt4/menus.hpp | 2 +-
2 files changed, 10 insertions(+), 21 deletions(-)
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index f60b8d4..df85a7b 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -293,7 +293,7 @@ void QVLCMenu::createMenuBar( MainInterface *mi,
BAR_DADD( VideoMenu( p_intf, NULL ), qtr( "&Video" ), 2 );
BAR_DADD( NavigMenu( p_intf, NULL ), qtr( "P&layback" ), 3 );
- BAR_ADD( ToolsMenu( p_intf ), qtr( "&Tools" ) );
+ BAR_ADD( ToolsMenu( NULL ), qtr( "&Tools" ) );
BAR_ADD( ViewMenu( p_intf, NULL, mi, visual_selector_enabled, true ),
qtr( "V&iew" ) );
@@ -353,11 +353,13 @@ QMenu *QVLCMenu::FileMenu( intf_thread_t *p_intf )
}
/* Playlist/MediaLibrary Control */
-QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf )
+QMenu *QVLCMenu::ToolsMenu( QMenu *parent )
{
- VLC_UNUSED( p_intf ); //TODO remove
- QMenu *menu = new QMenu();
-
+ QMenu *menu;
+ if( parent == NULL )
+ menu = new QMenu();
+ else
+ menu = parent;
addDPStaticEntry( menu, qtr( I_MENU_EXT ), ":/settings",
SLOT( extendedDialog() ), "Ctrl+E" );
@@ -715,12 +717,6 @@ void QVLCMenu::PopupMenuControlEntries( QMenu *menu,
void QVLCMenu::PopupMenuStaticEntries( QMenu *menu )
{
-#if 0
- QMenu *toolsmenu = ToolsMenu( p_intf, menu, false, true );
- toolsmenu->setTitle( qtr( "Tools" ) );
- menu->addMenu( toolsmenu );
-#endif
-
QMenu *openmenu = new QMenu( qtr( "Open Media" ), menu );
addDPStaticEntry( openmenu, qtr( "&Open File..." ),
":/file-asym", SLOT( openFileDialog() ) );
@@ -881,13 +877,6 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
{
submenu->addAction( QIcon( ":/playlist" ),
qtr( "Show Playlist" ), mi, SLOT( togglePlaylist() ) );
- }
- addDPStaticEntry( submenu, qtr( I_MENU_EXT ),
- ":/settings", SLOT( extendedDialog() ) );
- addDPStaticEntry( submenu, qtr( I_MENU_INFO ) , ":/info",
- SLOT( mediaInfoDialog() ), "Ctrl+I" );
- if( mi )
- {
action = submenu->addAction( QIcon( "" ),
qtr( "Minimal View" ), mi, SLOT( toggleMinimalView() ) );
action->setCheckable( true );
@@ -902,8 +891,8 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
else /* We are using the skins interface.
If not, this entry will not show. */
{
- addDPStaticEntry( submenu, qtr( "&Preferences..." ),
- ":/preferences", SLOT( prefsDialog() ), "Ctrl+P" );
+
+ QMenu *tools = ToolsMenu( submenu );
submenu->addSeparator();
objects.clear();
varnames.clear();
diff --git a/modules/gui/qt4/menus.hpp b/modules/gui/qt4/menus.hpp
index e9d02b1..52ede2d 100644
--- a/modules/gui/qt4/menus.hpp
+++ b/modules/gui/qt4/menus.hpp
@@ -101,7 +101,7 @@ private:
/* All main Menus */
static QMenu *FileMenu( intf_thread_t * );
static QMenu *SDMenu( intf_thread_t * );
- static QMenu *ToolsMenu( intf_thread_t * );
+ static QMenu *ToolsMenu( QMenu * );
static QMenu *ViewMenu( intf_thread_t *, QMenu *, MainInterface *,
bool, bool with = true );
static QMenu *NavigMenu( intf_thread_t *, QMenu * );
More information about the vlc-devel
mailing list