[vlc-commits] Qt: improve ToolsBar if run as a dialogProvider
Erwan Tulou
git at videolan.org
Sat May 18 16:13:00 CEST 2013
vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Sat May 18 15:17:05 2013 +0200| [e2153f51e6d719d733092273b717dadc05df3bb2] | committer: Erwan Tulou
Qt: improve ToolsBar if run as a dialogProvider
The "Customize Interface" menu entry is not relevant if qt4 is solely
run as a dialog provider.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e2153f51e6d719d733092273b717dadc05df3bb2
---
modules/gui/qt4/menus.cpp | 11 ++++++-----
modules/gui/qt4/menus.hpp | 5 +++--
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 5ea6d17..5a97519 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -332,7 +332,7 @@ void VLCMenuBar::createMenuBar( MainInterface *mi,
BAR_DADD( VideoMenu( p_intf, bar ), qtr( "&Video" ), 2 );
BAR_DADD( SubtitleMenu( p_intf, bar ), qtr( "Subti&tle" ), 5 );
- addMenuToMainbar( ToolsMenu( bar ), qtr( "T&ools" ), bar );
+ addMenuToMainbar( ToolsMenu( p_intf, bar ), qtr( "T&ools" ), bar );
/* View menu, a bit different */
BAR_DADD( ViewMenu( p_intf, NULL, mi ), qtr( "V&iew" ), 4 );
@@ -404,7 +404,7 @@ QMenu *VLCMenuBar::FileMenu( intf_thread_t *p_intf, QWidget *parent, MainInterfa
/**
* Tools, like Media Information, Preferences or Messages
**/
-QMenu *VLCMenuBar::ToolsMenu( QMenu *menu )
+QMenu *VLCMenuBar::ToolsMenu( intf_thread_t *p_intf, QMenu *menu )
{
addDPStaticEntry( menu, qtr( "&Effects and Filters"), ":/menu/settings",
SLOT( extendedDialog() ), "Ctrl+E" );
@@ -432,8 +432,9 @@ QMenu *VLCMenuBar::ToolsMenu( QMenu *menu )
"", SLOT( pluginDialog() ) );
menu->addSeparator();
- addDPStaticEntry( menu, qtr( "Customi&ze Interface..." ),
- ":/menu/preferences", SLOT( toolbarDialog() ) );
+ if( !p_intf->p_sys->b_isDialogProvider )
+ addDPStaticEntry( menu, qtr( "Customi&ze Interface..." ),
+ ":/menu/preferences", SLOT( toolbarDialog() ) );
addDPStaticEntry( menu, qtr( "&Preferences" ),
":/menu/preferences", SLOT( prefsDialog() ), "Ctrl+P", QAction::PreferencesRole );
@@ -1064,7 +1065,7 @@ void VLCMenuBar::PopupMenu( intf_thread_t *p_intf, bool show )
if( !b_isFullscreen )
{
QMenu *submenu = new QMenu( qtr( "T&ools" ), menu );
- /*QMenu *tools =*/ ToolsMenu( submenu );
+ /*QMenu *tools =*/ ToolsMenu( p_intf, submenu );
submenu->addSeparator();
/* In skins interface, append some items */
diff --git a/modules/gui/qt4/menus.hpp b/modules/gui/qt4/menus.hpp
index 883a46d..1766d5a 100644
--- a/modules/gui/qt4/menus.hpp
+++ b/modules/gui/qt4/menus.hpp
@@ -103,8 +103,9 @@ private:
/* All main Menus */
static QMenu *FileMenu( intf_thread_t *, QWidget *, MainInterface * mi = NULL );
- static QMenu *ToolsMenu( QMenu * );
- static QMenu *ToolsMenu( QWidget *parent ) { return ToolsMenu( new QMenu( parent ) ); }
+ static QMenu *ToolsMenu( intf_thread_t *, QMenu * );
+ static QMenu *ToolsMenu( intf_thread_t * p_intf, QWidget *parent )
+ { return ToolsMenu( p_intf, new QMenu( parent ) ); }
static QMenu *ViewMenu( intf_thread_t *, QMenu *, MainInterface * mi = NULL );
More information about the vlc-commits
mailing list