Commit bc612f60 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: menus, simplification

Ref #3406
parent ceb9edfa
...@@ -415,15 +415,15 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QWidget* parent ) ...@@ -415,15 +415,15 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QWidget* parent )
* View Menu * View Menu
* Interface modification, load other interfaces, activate Extensions * Interface modification, load other interfaces, activate Extensions
**/ **/
QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QMenu *current )
QMenu *current,
bool with_intf )
{ {
QAction *action; QAction *action;
QMenu *menu; QMenu *menu;
if( !with_intf )
menu = new QMenu( qtr( "&View" ), current ); if( !current )
{
menu = new QMenu( qtr( "&View" ) );
}
else else
{ {
menu = current; menu = current;
...@@ -439,18 +439,14 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, ...@@ -439,18 +439,14 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
menu->addSeparator(); menu->addSeparator();
if( with_intf ) QMenu *intfmenu = InterfacesMenu( p_intf, menu );
{ menu->addSeparator();
QMenu *intfmenu = InterfacesMenu( p_intf, menu );
menu->addSeparator();
}
/* Minimal View */ /* Minimal View */
action = menu->addAction( qtr( "Mi&nimal View" ) ); action = menu->addAction( qtr( "Mi&nimal View" ) );
action->setShortcut( qtr( "Ctrl+H" ) ); action->setShortcut( qtr( "Ctrl+H" ) );
action->setCheckable( true ); action->setCheckable( true );
action->setChecked( !with_intf && action->setChecked( (mi->getControlsVisibilityStatus() & CONTROLS_HIDDEN ) );
(mi->getControlsVisibilityStatus() & CONTROLS_HIDDEN ) );
CONNECT( action, triggered( bool ), mi, toggleMinimalView( bool ) ); CONNECT( action, triggered( bool ), mi, toggleMinimalView( bool ) );
CONNECT( mi, minimalViewToggled( bool ), action, setChecked( bool ) ); CONNECT( mi, minimalViewToggled( bool ), action, setChecked( bool ) );
...@@ -476,7 +472,7 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, ...@@ -476,7 +472,7 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf,
action->setChecked( mi->isPlDocked() ); action->setChecked( mi->isPlDocked() );
CONNECT( action, triggered( bool ), mi, dockPlaylist( bool ) ); 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 // I don't want to manage consistency between menus, so no popup-menu
{ {
action = menu->addAction( qtr( "Quit after Playback" ) ); action = menu->addAction( qtr( "Quit after Playback" ) );
...@@ -1037,7 +1033,7 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show ) ...@@ -1037,7 +1033,7 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
msg_Warn( p_intf, "could not find parent interface" ); msg_Warn( p_intf, "could not find parent interface" );
} }
else else
menu->addMenu( ViewMenu( p_intf, menu, false )); menu->addMenu( ViewMenu( p_intf, (QMenu *)NULL ) );
menu->addMenu( submenu ); menu->addMenu( submenu );
} }
......
...@@ -99,8 +99,8 @@ private: ...@@ -99,8 +99,8 @@ private:
static QMenu *ToolsMenu( QMenu * ); static QMenu *ToolsMenu( QMenu * );
static QMenu *ToolsMenu( QWidget * ); static QMenu *ToolsMenu( QWidget * );
static QMenu *ViewMenu( intf_thread_t *, QWidget *parent ); static QMenu *ViewMenu( intf_thread_t *, QWidget * );
static QMenu *ViewMenu( intf_thread_t *, QMenu *, bool with_intf ); static QMenu *ViewMenu( intf_thread_t *, QMenu * );
static QMenu *InterfacesMenu( intf_thread_t *p_intf, QMenu * ); static QMenu *InterfacesMenu( intf_thread_t *p_intf, QMenu * );
static void ExtensionsMenu( intf_thread_t *p_intf, QMenu * ); static void ExtensionsMenu( intf_thread_t *p_intf, QMenu * );
...@@ -157,7 +157,7 @@ public: ...@@ -157,7 +157,7 @@ public:
case 1: QVLCMenu::AudioMenu( p_intf, menu ); break; case 1: QVLCMenu::AudioMenu( p_intf, menu ); break;
case 2: QVLCMenu::VideoMenu( p_intf, menu ); break; case 2: QVLCMenu::VideoMenu( p_intf, menu ); break;
case 3: QVLCMenu::RebuildNavigMenu( 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: private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment