[vlc-devel] menu work - shortcut issues

Lyndon Brown jnqnfe at gmail.com
Wed Sep 23 21:41:07 CEST 2020


Just one further thing I thought I'd mention here on the topic of
menus, (which I should perhaps file a bug report for) - I noticed the
other day that there seemed to be some issues with menu shortcuts
currently.

 - CTRL+O in v3.0 is supposed to open the basic open file dialog. In
v4.0 this seems to have been changed (which I found odd) to the open
multiple files action, but yet in fact the shortcut does nothing.

 - CTRL+F is indicated in the (v4.0) menu as opening the single file
open dialog, but yet it opens the open directory dialog.

 - The menu indicates that CTRL+I should open the open directory
dialog, but in fact it opens the media information dialog.

 - A few others I tried worked fine, but that's about as far as I went
with testing.

I had a little look to see if I could find the cause, but failed. I did
notice in doing so some oddities in the shortcut properties being
specified for entries though and made a patch to see if it solved the
problem, which it did not, and so I shelved it to come back to later.
I've attached it and placed a copy of the diff below so you can take a
look at what I noticed and felt needed changing.

 - A couple of interface string defines seemed to be missing '&'s.
 - A few additional strings in the Qt code seem to be missing relevant
'&'s.
 - The menu entry for 'open file' has an '&' on the letter 'f', yet has
"CTRL+O" as the last param to the addDPStaticEntry() call, and while
'open multiple files' has the '&' on the later 'o'.
 - The 'open directory' entry is specifying "CTRL+F" in the last param,
which surely should be dynamically specified as either "CTRL+F" or
"CTRL+I" depending upon platform, to match the "folder" vs "directory"
label text and the use of '&' in that text).

patch attached. preview:


diff --git a/include/vlc_intf_strings.h b/include/vlc_intf_strings.h
index babbe5aafc..05499b6c9f 100644
--- a/include/vlc_intf_strings.h
+++ b/include/vlc_intf_strings.h
@@ -52,13 +52,13 @@
 /******************* Menus *****************/
 
 #define I_MENU_INFO  N_("Media &Information")
-#define I_MENU_CODECINFO  N_("&Codec Information")
+#define I_MENU_CODECINFO  N_("Codec Information")
 #define I_MENU_MSG   N_("&Messages")
 #define I_MENU_GOTOTIME N_("Jump to Specific &Time")
 #define I_MENU_BOOKMARK N_("Custom &Bookmarks")
 #define I_MENU_VLM N_("&VLM Configuration")
 
-#define I_MENU_ABOUT N_("&About")
+#define I_MENU_ABOUT N_("About")
 
 /*************** Playlist *************/
 
diff --git a/modules/gui/qt/menus/menus.cpp b/modules/gui/qt/menus/menus.cpp
index 670159cc30..addbdc57b4 100644
--- a/modules/gui/qt/menus/menus.cpp
+++ b/modules/gui/qt/menus/menus.cpp
@@ -199,12 +199,12 @@ QMenu *VLCMenuBar::FileMenu( intf_thread_t *p_intf, QWidget *parent, MainInterfa
     QMenu *menu = new QMenu( parent );
     QAction *action;
 
-    addDPStaticEntry( menu, qtr( "Open &File..." ),
+    addDPStaticEntry( menu, qtr( "&Open File..." ),
         ":/type/file-asym.svg", SLOT( simpleOpenDialog() ), "Ctrl+O" );
-    addDPStaticEntry( menu, qtr( "&Open Multiple Files..." ),
+    addDPStaticEntry( menu, qtr( "Open Multiple Files..." ),
         ":/type/file-asym.svg", SLOT( openFileDialog() ), "Ctrl+Shift+O" );
     addDPStaticEntry( menu, qtr( I_OP_OPDIR ),
-        ":/type/folder-grey.svg", SLOT( PLOpenDir() ), "Ctrl+F" );
+        ":/type/folder-grey.svg", SLOT( PLOpenDir() ), I_DIR_OR_FOLDER( "Ctrl+I", "Ctrl+F" ) );
     addDPStaticEntry( menu, qtr( "Open &Disc..." ),
         ":/type/disc.svg", SLOT( openDiscDialog() ), "Ctrl+D" );
     addDPStaticEntry( menu, qtr( "Open &Network Stream..." ),
@@ -212,7 +212,7 @@ QMenu *VLCMenuBar::FileMenu( intf_thread_t *p_intf, QWidget *parent, MainInterfa
     addDPStaticEntry( menu, qtr( "Open &Capture Device..." ),
         ":/type/capture-card.svg", SLOT( openCaptureDialog() ), "Ctrl+C" );
 
-    addDPStaticEntry( menu, qtr( "Open &Location from clipboard" ),
+    addDPStaticEntry( menu, qtr( "Open Location from clipboard" ),
                       NULL, SLOT( openUrlDialog() ), "Ctrl+V" );
 
     if( !recentsMenu && var_InheritBool( p_intf, "qt-recentplay" ) )
@@ -890,10 +890,10 @@ QMenu* VLCMenuBar::PopupMenu( intf_thread_t *p_intf, bool show )
         menu->addSeparator();
 
         QMenu *helpmenu = HelpMenu( menu );
-        helpmenu->setTitle( qtr( "Help" ) );
+        helpmenu->setTitle( qtr( "&Help" ) );
         menu->addMenu( helpmenu );
 
-        addDPStaticEntry( menu, qtr( "Quit" ), ":/menu/exit.svg",
+        addDPStaticEntry( menu, qtr( "&Quit" ), ":/menu/exit.svg",
                           SLOT( quit() ), "Ctrl+Q", QAction::QuitRole );
     }
     else
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qt_shortcuts.patch
Type: text/x-patch
Size: 3045 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20200923/cf5a1e46/attachment.bin>


More information about the vlc-devel mailing list