[vlc-commits] [Git][videolan/vlc][master] prefs: use common defines for all simple pref tab titles & tooltips

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Tue Feb 1 13:41:28 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
a7963fdf by Lyndon Brown at 2022-02-01T13:20:23+00:00
prefs: use common defines for all simple pref tab titles & tooltips

Only two such defines were already in use, the rest were pointlessly
duplicating the text, which should be identical in both interfaces and so
it makes sense to have shared defines.

This happens to fix a few unwanted inconsistencies:
 - MacOS was using lowercase "settings" in two places.
 - Qt was using completely different language for the hotkey and ML tag
   tooltips to everything else.
 - A trivial difference between input tab tooltips.

- - - - -


3 changed files:

- include/vlc_config_cat.h
- modules/gui/macosx/preferences/VLCSimplePrefsController.m
- modules/gui/qt/dialogs/preferences/simple_preferences.cpp


Changes:

=====================================
include/vlc_config_cat.h
=====================================
@@ -41,6 +41,20 @@
 #define PLAYLIST_TITLE  N_( "Playlist" )
 #define AADVANCED_TITLE N_( "Advanced" )
 #define SUBPIC_TITLE    N_( "Subtitles / OSD" )
+#define HOTKEYS_TITLE   N_( "Hotkeys" )
+#define ML_TITLE        N_( "Media Library" )
+
+/*  - Tooltip text -
+ * These are used for simple prefs view tabs.
+ */
+
+#define INTF_TOOLTIP    N_( "Interface Settings" )
+#define AUDIO_TOOLTIP   N_( "Audio Settings" )
+#define VIDEO_TOOLTIP   N_( "Video Settings" )
+#define SUBPIC_TOOLTIP  N_( "Subtitle & On Screen Display Settings" )
+#define INPUT_TOOLTIP   N_( "Input & Codec Settings" )
+#define HOTKEYS_TOOLTIP N_( "Hotkeys Settings" )
+#define ML_TOOLTIP      N_( "Media Library Settings" )
 
 /*  - Help text -
  * These are shown on advanced view panels.


=====================================
modules/gui/macosx/preferences/VLCSimplePrefsController.m
=====================================
@@ -280,19 +280,19 @@ create_toolbar_item(NSString *itemIdent, NSString *name, NSString *desc, NSStrin
     NSToolbarItem *toolbarItem = nil;
 
     if ([itemIdent isEqual: VLCIntfSettingToolbarIdentifier]) {
-        CreateToolbarItem(_NS("Interface"), _NS("Interface Settings"), @"VLCInterfaceCone", showInterfaceSettings);
+        CreateToolbarItem(NSTR(INTF_TITLE), NSTR(INTF_TOOLTIP), @"VLCInterfaceCone", showInterfaceSettings);
     } else if ([itemIdent isEqual: VLCAudioSettingToolbarIdentifier]) {
-        CreateToolbarItem(_NS("Audio"), _NS("Audio Settings"), @"VLCAudioCone", showAudioSettings);
+        CreateToolbarItem(NSTR(AUDIO_TITLE), NSTR(AUDIO_TOOLTIP), @"VLCAudioCone", showAudioSettings);
     } else if ([itemIdent isEqual: VLCVideoSettingToolbarIdentifier]) {
-        CreateToolbarItem(_NS("Video"), _NS("Video Settings"), @"VLCVideoCone", showVideoSettings);
+        CreateToolbarItem(NSTR(VIDEO_TITLE), NSTR(VIDEO_TOOLTIP), @"VLCVideoCone", showVideoSettings);
     } else if ([itemIdent isEqual: VLCOSDSettingToolbarIdentifier]) {
-        CreateToolbarItem(NSTR(SUBPIC_TITLE), _NS("Subtitle & On Screen Display Settings"), @"VLCSubtitleCone", showOSDSettings);
+        CreateToolbarItem(NSTR(SUBPIC_TITLE), NSTR(SUBPIC_TOOLTIP), @"VLCSubtitleCone", showOSDSettings);
     } else if ([itemIdent isEqual: VLCInputSettingToolbarIdentifier]) {
-        CreateToolbarItem(NSTR(INPUT_TITLE), _NS("Input & Codec Settings"), @"VLCInputCone", showInputSettings);
+        CreateToolbarItem(NSTR(INPUT_TITLE), NSTR(INPUT_TOOLTIP), @"VLCInputCone", showInputSettings);
     } else if ([itemIdent isEqual: VLCMediaLibrarySettingToolbarIdentifier]) {
-        CreateToolbarItem(_NS("Media Library"), _NS("Media Library settings"), @"NXHelpBacktrack", showMediaLibrarySettings);
+        CreateToolbarItem(NSTR(ML_TITLE), NSTR(ML_TOOLTIP), @"NXHelpBacktrack", showMediaLibrarySettings);
     } else if ([itemIdent isEqual: VLCHotkeysSettingToolbarIdentifier]) {
-        CreateToolbarItem(_NS("Hotkeys"), _NS("Hotkeys settings"), @"VLCHotkeysCone", showHotkeySettings);
+        CreateToolbarItem(NSTR(HOTKEYS_TITLE), NSTR(HOTKEYS_TOOLTIP), @"VLCHotkeysCone", showHotkeySettings);
     }
 
     return toolbarItem;


=====================================
modules/gui/qt/dialogs/preferences/simple_preferences.cpp
=====================================
@@ -277,20 +277,13 @@ SPrefsCatList::SPrefsCatList( qt_intf_t *_p_intf, QWidget *_parent ) :
     mapper->setMapping( button, numb );                                     \
     layout->addWidget( button );
 
-    ADD_CATEGORY( SPrefsInterface, qtr("Interface"), qtr("Interface Settings"),
-                  cone_interface_64, 0 );
-    ADD_CATEGORY( SPrefsAudio, qtr("Audio"), qtr("Audio Settings"),
-                  cone_audio_64, 1 );
-    ADD_CATEGORY( SPrefsVideo, qtr("Video"), qtr("Video Settings"),
-                  cone_video_64, 2 );
-    ADD_CATEGORY( SPrefsSubtitles, qfut(SUBPIC_TITLE), qtr("Subtitle & On Screen Display Settings"),
-                  cone_subtitles_64, 3 );
-    ADD_CATEGORY( SPrefsInputAndCodecs, qfut(INPUT_TITLE), qtr("Input & Codecs Settings"),
-                  cone_input_64, 4 );
-    ADD_CATEGORY( SPrefsHotkeys, qtr("Hotkeys"), qtr("Configure Hotkeys"),
-                  cone_hotkeys_64, 5 );
-    ADD_CATEGORY( SPrefsMediaLibrary, qtr("Media Library"), qtr("Configure Media Library"),
-                  cone_medialibrary_64, 6 );
+    ADD_CATEGORY( SPrefsInterface, qfut(INTF_TITLE), qfut(INTF_TOOLTIP), cone_interface_64, 0 );
+    ADD_CATEGORY( SPrefsAudio, qfut(AUDIO_TITLE), qfut(AUDIO_TOOLTIP), cone_audio_64, 1 );
+    ADD_CATEGORY( SPrefsVideo, qfut(VIDEO_TITLE), qfut(VIDEO_TOOLTIP), cone_video_64, 2 );
+    ADD_CATEGORY( SPrefsSubtitles, qfut(SUBPIC_TITLE), qfut(SUBPIC_TOOLTIP), cone_subtitles_64, 3 );
+    ADD_CATEGORY( SPrefsInputAndCodecs, qfut(INPUT_TITLE), qfut(INPUT_TOOLTIP), cone_input_64, 4 );
+    ADD_CATEGORY( SPrefsHotkeys, qfut(HOTKEYS_TITLE), qfut(HOTKEYS_TOOLTIP), cone_hotkeys_64, 5 );
+    ADD_CATEGORY( SPrefsMediaLibrary, qfut(ML_TITLE), qfut(ML_TOOLTIP), cone_medialibrary_64, 6 );
 
 #undef ADD_CATEGORY
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a7963fdf2152aacad4491ab99bd6bd36f210c6fd

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a7963fdf2152aacad4491ab99bd6bd36f210c6fd
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list