Commit 13e72f28 authored by Erwan Tulou's avatar Erwan Tulou

Qt(dialog provider): rework the part of popupmenu specific to skins2

  - make it a bit simpler to read
  - add a shortcut to "Open skin.."
    (Ctrl-Shift-S chosen instead of Ctrl-S, since the latter
    is already used elsewhere)
  - Reuse the full version of "Open Media" with all accelerators
    being displayed instead of the light version
  - add the Help menu

With this new enriched popupmenu, skins2 should now offer all major
vlc hotkeys, which users have been asking for repeatedly.
parent 2b427108
No related merge requests found
...@@ -1066,38 +1066,36 @@ QMenu* VLCMenuBar::PopupMenu( intf_thread_t *p_intf, bool show ) ...@@ -1066,38 +1066,36 @@ QMenu* VLCMenuBar::PopupMenu( intf_thread_t *p_intf, bool show )
/*QMenu *tools =*/ ToolsMenu( p_intf, submenu ); /*QMenu *tools =*/ ToolsMenu( p_intf, submenu );
submenu->addSeparator(); submenu->addSeparator();
if( mi )
{
QMenu *bar = menu; // Needed for next macro
BAR_DADD( ViewMenu( p_intf, NULL, mi ), qtr( "V&iew" ), 4 );
}
/* In skins interface, append some items */ /* In skins interface, append some items */
if( !mi ) if( p_intf->p_sys->b_isDialogProvider )
{ {
vlc_object_t* p_object = p_intf->p_parent;
submenu->setTitle( qtr( "Interface" ) ); submenu->setTitle( qtr( "Interface" ) );
if( p_intf->p_sys->b_isDialogProvider )
{
/* list of skins available */
vlc_object_t* p_object = p_intf->p_parent;
objects.clear(); varnames.clear(); /* Open skin dialog box */
objects.append( p_object ); objects.clear(); varnames.clear();
varnames.append( "intf-skins" ); objects.append( p_object );
Populate( p_intf, submenu, varnames, objects ); varnames.append( "intf-skins-interactive" );
Populate( p_intf, submenu, varnames, objects );
QAction* action = submenu->actions().back();
action->setShortcut( QKeySequence( "Ctrl+Shift+S" ));
objects.clear(); varnames.clear(); /* list of skins available */
objects.append( p_object ); objects.clear(); varnames.clear();
varnames.append( "intf-skins-interactive" ); objects.append( p_object );
Populate( p_intf, submenu, varnames, objects ); varnames.append( "intf-skins" );
Populate( p_intf, submenu, varnames, objects );
submenu->addSeparator(); submenu->addSeparator();
/* Extensions */ /* list of extensions */
ExtensionsMenu( p_intf, submenu ); ExtensionsMenu( p_intf, submenu );
}
else
msg_Warn( p_intf, "could not find parent interface" );
}
else
{
QMenu *bar = menu; // Needed for next macro
BAR_DADD( ViewMenu( p_intf, NULL, mi ), qtr( "V&iew" ), 4 );
} }
menu->addMenu( submenu ); menu->addMenu( submenu );
...@@ -1113,7 +1111,23 @@ QMenu* VLCMenuBar::PopupMenu( intf_thread_t *p_intf, bool show ) ...@@ -1113,7 +1111,23 @@ QMenu* VLCMenuBar::PopupMenu( intf_thread_t *p_intf, bool show )
menu->addMenu( plMenu ); menu->addMenu( plMenu );
/* Static entries for ending, like open */ /* Static entries for ending, like open */
PopupMenuStaticEntries( menu ); if( p_intf->p_sys->b_isDialogProvider )
{
QMenu *openmenu = FileMenu( p_intf, menu );
openmenu->setTitle( qtr( "Open Media" ) );
menu->addMenu( openmenu );
menu->addSeparator();
QMenu *helpmenu = HelpMenu( menu );
helpmenu->setTitle( qtr( "Help" ) );
menu->addMenu( helpmenu );
addDPStaticEntry( menu, qtr( "Quit" ), ":/menu/exit",
SLOT( quit() ), "Ctrl+Q", QAction::QuitRole );
}
else
PopupMenuStaticEntries( menu );
if( show ) if( show )
menu->popup( QCursor::pos() ); menu->popup( QCursor::pos() );
......
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