From 7a3c4a14b0e15e5383327a6a62d03165ab26c1d4 Mon Sep 17 00:00:00 2001 From: zoltanvb <101990835+zoltanvb@users.noreply.github.com> Date: Mon, 22 Jan 2024 03:12:47 +0100 Subject: [PATCH] Menu label finetunes (#16144) Change quit sublabel depending on config save on exit status. Update restart and menu driver sublabels. Restore quit help text display. --- intl/msg_hash_us.c | 3 +++ intl/msg_hash_us.h | 22 +++++++++++++--------- menu/cbs/menu_cbs_sublabel.c | 15 ++++++++++++++- msg_hash.h | 1 + 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/intl/msg_hash_us.c b/intl/msg_hash_us.c index a748f5f57e..7fe57037b7 100644 --- a/intl/msg_hash_us.c +++ b/intl/msg_hash_us.c @@ -298,6 +298,9 @@ int msg_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) case MENU_ENUM_LABEL_CONFIG_SAVE_ON_EXIT: strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_HELP_CONFIG_SAVE_ON_EXIT), len); break; + case MENU_ENUM_LABEL_QUIT_RETROARCH: + strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_HELP_QUIT_RETROARCH), len); + break; case MENU_ENUM_LABEL_VIDEO_SHADER_FILTER_PASS: strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_HELP_VIDEO_SHADER_FILTER_PASS), len); break; diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index d70107cde9..f94edffd33 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -195,23 +195,27 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_LABEL_VALUE_RESTART_RETROARCH, - "Restart RetroArch" + "Restart" ) MSG_HASH( MENU_ENUM_SUBLABEL_RESTART_RETROARCH, - "Restart the program." + "Restart RetroArch application." ) MSG_HASH( MENU_ENUM_LABEL_VALUE_QUIT_RETROARCH, - "Quit RetroArch" + "Quit" ) MSG_HASH( MENU_ENUM_SUBLABEL_QUIT_RETROARCH, - "Quit the program." + "Quit RetroArch application. Configuration save on exit is enabled." + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_QUIT_RETROARCH_NOSAVE, + "Quit RetroArch application. Configuration save on exit is disabled." ) MSG_HASH( MENU_ENUM_LABEL_HELP_QUIT_RETROARCH, - "Quit RetroArch. Killing the program in any hard way (SIGKILL, etc.) will terminate RetroArch without saving the configuration, etc. On Unix-likes, SIGINT/SIGTERM allows a clean deinitialization." + "Quit RetroArch. Killing the program in any hard way (SIGKILL, etc.) will terminate RetroArch without saving the configuration in any case. On Unix-likes, SIGINT/SIGTERM allows a clean deinitialization which includes configuration save if enabled." ) /* Main Menu > Load Core */ @@ -1797,7 +1801,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_SUBLABEL_MENU_DRIVER, - "Menu driver to use." + "Menu driver to use. Requires restart." ) MSG_HASH( MENU_ENUM_LABEL_HELP_MENU_DRIVER_XMB, @@ -7822,15 +7826,15 @@ MSG_HASH( /* FIXME Not RGUI specific */ ) MSG_HASH( /* FIXME Not RGUI specific */ MENU_ENUM_SUBLABEL_RGUI_BROWSER_DIRECTORY, - "Set start directory for the file browser." + "Set Start Directory for File Browser." ) MSG_HASH( /* FIXME Not RGUI specific */ MENU_ENUM_LABEL_VALUE_RGUI_CONFIG_DIRECTORY, - "Configs" + "Configuration files" ) MSG_HASH( /* FIXME Not RGUI specific */ MENU_ENUM_SUBLABEL_RGUI_CONFIG_DIRECTORY, - "Set start directory for menu configuration browser." + "Default configuration file is stored in this directory." ) MSG_HASH( MENU_ENUM_LABEL_VALUE_LIBRETRO_DIR_PATH, diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 7d7b2222a1..3a74adfe92 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -627,7 +627,20 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_system_information, MENU_ #ifdef HAVE_LAKKA DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quit_retroarch, MENU_ENUM_SUBLABEL_RESTART_RETROARCH) #else -DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quit_retroarch, MENU_ENUM_SUBLABEL_QUIT_RETROARCH) + +/*DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_quit_retroarch, MENU_ENUM_SUBLABEL_QUIT_RETROARCH)*/ +static int action_bind_sublabel_quit_retroarch(file_list_t* list, + unsigned type, unsigned i, const char* label, const char* path, char* s, size_t len) +{ + settings_t *settings = config_get_ptr(); + bool save_on_exit = settings->bools.config_save_on_exit; + if (save_on_exit) + strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_QUIT_RETROARCH), len); + else + strlcpy(s, msg_hash_to_str(MENU_ENUM_SUBLABEL_QUIT_RETROARCH_NOSAVE), len); + return 1; +} + #endif DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_restart_retroarch, MENU_ENUM_SUBLABEL_RESTART_RETROARCH) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_widgets, MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE) diff --git a/msg_hash.h b/msg_hash.h index 531690432f..d87b113ed4 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1469,6 +1469,7 @@ enum msg_hash_enums MENU_LABEL(MENU_SHOW_CONFIGURATIONS), MENU_LABEL(MENU_SHOW_HELP), MENU_LABEL(MENU_SHOW_QUIT_RETROARCH), + MENU_ENUM_SUBLABEL_QUIT_RETROARCH_NOSAVE, MENU_LABEL(MENU_SHOW_RESTART_RETROARCH), MENU_LABEL(MENU_SHOW_REBOOT), MENU_LABEL(MENU_SHOW_SHUTDOWN),