[vlc-commits] commit: Qt: menus, simplification (Jean-Baptiste Kempf )
git at videolan.org
git at videolan.org
Sat Mar 13 14:22:13 CET 2010
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Mar 13 13:05:50 2010 +0100| [bc612f60839b668f13902049adecf0a87e7dfcf3] | committer: Jean-Baptiste Kempf
Qt: menus, simplification
Ref #3406
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bc612f60839b668f13902049adecf0a87e7dfcf3
---
modules/gui/qt4/menus.cpp | 26 +++++++++++---------------
modules/gui/qt4/menus.hpp | 6 +++---
2 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 0adb14c..310dcc7 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -415,15 +415,15 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QWidget* parent )
* View Menu
* Interface modification, load other interfaces, activate Extensions
**/
-QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
- QMenu *current,
- bool with_intf )
+QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QMenu *current )
{
QAction *action;
-
QMenu *menu;
- if( !with_intf )
- menu = new QMenu( qtr( "&View" ), current );
+
+ if( !current )
+ {
+ menu = new QMenu( qtr( "&View" ) );
+ }
else
{
menu = current;
@@ -439,18 +439,14 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
menu->addSeparator();
- if( with_intf )
- {
- QMenu *intfmenu = InterfacesMenu( p_intf, menu );
- menu->addSeparator();
- }
+ QMenu *intfmenu = InterfacesMenu( p_intf, menu );
+ menu->addSeparator();
/* Minimal View */
action = menu->addAction( qtr( "Mi&nimal View" ) );
action->setShortcut( qtr( "Ctrl+H" ) );
action->setCheckable( true );
- action->setChecked( !with_intf &&
- (mi->getControlsVisibilityStatus() & CONTROLS_HIDDEN ) );
+ action->setChecked( (mi->getControlsVisibilityStatus() & CONTROLS_HIDDEN ) );
CONNECT( action, triggered( bool ), mi, toggleMinimalView( bool ) );
CONNECT( mi, minimalViewToggled( bool ), action, setChecked( bool ) );
@@ -476,7 +472,7 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
action->setChecked( mi->isPlDocked() );
CONNECT( action, triggered( bool ), mi, dockPlaylist( bool ) );
- if( with_intf )
+ if( !current )
// I don't want to manage consistency between menus, so no popup-menu
{
action = menu->addAction( qtr( "Quit after Playback" ) );
@@ -1037,7 +1033,7 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
msg_Warn( p_intf, "could not find parent interface" );
}
else
- menu->addMenu( ViewMenu( p_intf, menu, false ));
+ menu->addMenu( ViewMenu( p_intf, (QMenu *)NULL ) );
menu->addMenu( submenu );
}
diff --git a/modules/gui/qt4/menus.hpp b/modules/gui/qt4/menus.hpp
index 3d86a98..4ff29ac 100644
--- a/modules/gui/qt4/menus.hpp
+++ b/modules/gui/qt4/menus.hpp
@@ -99,8 +99,8 @@ private:
static QMenu *ToolsMenu( QMenu * );
static QMenu *ToolsMenu( QWidget * );
- static QMenu *ViewMenu( intf_thread_t *, QWidget *parent );
- static QMenu *ViewMenu( intf_thread_t *, QMenu *, bool with_intf );
+ static QMenu *ViewMenu( intf_thread_t *, QWidget * );
+ static QMenu *ViewMenu( intf_thread_t *, QMenu * );
static QMenu *InterfacesMenu( intf_thread_t *p_intf, QMenu * );
static void ExtensionsMenu( intf_thread_t *p_intf, QMenu * );
@@ -157,7 +157,7 @@ public:
case 1: QVLCMenu::AudioMenu( p_intf, menu ); break;
case 2: QVLCMenu::VideoMenu( p_intf, menu ); break;
case 3: QVLCMenu::RebuildNavigMenu( p_intf, menu ); break;
- case 4: QVLCMenu::ViewMenu( p_intf, menu, true ); break;
+ case 4: QVLCMenu::ViewMenu( p_intf, menu ); break;
}
}
private:
More information about the vlc-commits
mailing list