From 9356c326e0edd5765710ae5408dad2474159f83d Mon Sep 17 00:00:00 2001 From: Mikael Brunnhede Date: Mon, 9 Oct 2017 09:46:42 +0200 Subject: [PATCH] Implemented setting for showing/hiding the "Add to Favorites" option in the Quick Menu. --- config.def.h | 5 +++-- configuration.c | 1 + configuration.h | 1 + intl/msg_hash_chs.h | 4 ++++ intl/msg_hash_cht.h | 4 ++++ intl/msg_hash_de.h | 4 ++++ intl/msg_hash_eo.h | 4 ++++ intl/msg_hash_fr.h | 4 ++++ intl/msg_hash_it.h | 4 ++++ intl/msg_hash_ja.h | 4 ++++ intl/msg_hash_ko.h | 4 ++++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 4 ++++ intl/msg_hash_pt_br.h | 6 ++++++ intl/msg_hash_pt_pt.h | 4 ++++ intl/msg_hash_ru.h | 4 ++++ intl/msg_hash_us.h | 4 ++++ intl/msg_hash_vn.h | 4 ++++ menu/cbs/menu_cbs_sublabel.c | 4 ++++ menu/menu_displaylist.c | 15 +++++++++++---- menu/menu_setting.c | 15 +++++++++++++++ msg_hash.h | 1 + 22 files changed, 96 insertions(+), 6 deletions(-) diff --git a/config.def.h b/config.def.h index 474cdf0033..b6f31dcd64 100644 --- a/config.def.h +++ b/config.def.h @@ -236,9 +236,10 @@ static const bool display_keyboard_overlay = false; static bool default_block_config_read = true; -static bool quick_menu_show_take_screenshot = true; -static bool quick_menu_show_save_load_state = true; +static bool quick_menu_show_take_screenshot = true; +static bool quick_menu_show_save_load_state = true; static bool quick_menu_show_undo_save_load_state = true; +static bool quick_menu_show_add_to_favorites = true; static bool menu_show_online_updater = true; diff --git a/configuration.c b/configuration.c index 5ab9dbce73..652e995857 100644 --- a/configuration.c +++ b/configuration.c @@ -1194,6 +1194,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("quick_menu_show_take_screenshot", &settings->bools.quick_menu_show_take_screenshot, true, quick_menu_show_take_screenshot, false); SETTING_BOOL("quick_menu_show_save_load_state", &settings->bools.quick_menu_show_save_load_state, true, quick_menu_show_save_load_state, false); SETTING_BOOL("quick_menu_show_undo_save_load_state", &settings->bools.quick_menu_show_undo_save_load_state, true, quick_menu_show_undo_save_load_state, false); + SETTING_BOOL("quick_menu_show_add_to_favorites", &settings->bools.quick_menu_show_add_to_favorites, true, quick_menu_show_add_to_favorites, false); #ifdef HAVE_MATERIALUI SETTING_BOOL("materialui_icons_enable", &settings->bools.menu_materialui_icons_enable, true, materialui_icons_enable, false); #endif diff --git a/configuration.h b/configuration.h index edd6e4af42..a996a044bb 100644 --- a/configuration.h +++ b/configuration.h @@ -141,6 +141,7 @@ typedef struct settings bool quick_menu_show_take_screenshot; bool quick_menu_show_save_load_state; bool quick_menu_show_undo_save_load_state; + bool quick_menu_show_add_to_favorites; /* Netplay */ bool netplay_public_announce; diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index 298ad0ed34..78899f7aae 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -3079,3 +3079,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index bcc865e981..5c22c75bf8 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3079,3 +3079,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index 2ac0f4d318..2cb79aaceb 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3073,3 +3073,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index afc65f2c66..417981a366 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -2942,3 +2942,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 7f8208a3a2..5fe8a0e158 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3111,3 +3111,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 6e18bdd6d1..b6aef110cd 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3165,3 +3165,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index f03656bd1c..a12816d092 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -3081,3 +3081,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index a0b5466df1..d681766d99 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3074,3 +3074,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 1484c2d0cf..070da7fb14 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1313,3 +1313,5 @@ MSG_HASH(MENU_ENUM_LABEL_QUICK_MENU_SHOW_SAVE_LOAD_STATE, "quick_menu_show_save_load_state") MSG_HASH(MENU_ENUM_LABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "quick_menu_show_undo_save_load_state") +MSG_HASH(MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "quick_menu_show_add_to_favorites") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 5d7160b7fe..209983c573 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -2942,3 +2942,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index d9efcce271..64982eaf55 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -4012,3 +4012,9 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state." ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites" + ) +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option." + ) diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 0a0858b5ad..4e4a2a52f4 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3049,3 +3049,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 121d08c951..534e1f6056 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3132,3 +3132,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 7532d96554..ecfac9ff66 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3167,3 +3167,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 384fb84b0c..b89f864a96 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3103,3 +3103,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show Undo Save/Load State") MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, "Show/hide the options for undoing save/load state.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show Add to Favorites") +MSG_HASH(MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + "Show/hide the 'Add to Favorites' option.") diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index d6cbe79f5d..e15a2b9b9e 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -293,6 +293,7 @@ default_sublabel_macro(action_bind_sublabel_menu_font, default_sublabel_macro(action_bind_sublabel_quick_menu_show_take_screenshot, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_TAKE_SCREENSHOT) default_sublabel_macro(action_bind_sublabel_quick_menu_show_save_load_state, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_SAVE_LOAD_STATE) default_sublabel_macro(action_bind_sublabel_quick_menu_show_undo_save_load_state, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE) +default_sublabel_macro(action_bind_sublabel_quick_menu_show_add_to_favorites, MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES) default_sublabel_macro(action_bind_sublabel_menu_favorites_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_FAVORITES) default_sublabel_macro(action_bind_sublabel_menu_images_tab, MENU_ENUM_SUBLABEL_XMB_SHOW_IMAGES) default_sublabel_macro(action_bind_sublabel_menu_show_online_updater, MENU_ENUM_SUBLABEL_MENU_SHOW_ONLINE_UPDATER) @@ -604,6 +605,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_quick_menu_show_undo_save_load_state); break; + case MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_quick_menu_show_add_to_favorites); + break; case MENU_ENUM_LABEL_XMB_SHOW_FAVORITES: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_favorites_tab); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index ef1f9f9c9e..4bca531532 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -2881,10 +2881,13 @@ static int menu_displaylist_parse_load_content_settings( MENU_SETTING_ACTION_LOADSTATE, 0, 0); } - menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ADD_TO_FAVORITES), - msg_hash_to_str(MENU_ENUM_LABEL_ADD_TO_FAVORITES), - MENU_ENUM_LABEL_ADD_TO_FAVORITES, FILE_TYPE_PLAYLIST_ENTRY, 0, 0); + if (settings->bools.quick_menu_show_add_to_favorites) + { + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ADD_TO_FAVORITES), + msg_hash_to_str(MENU_ENUM_LABEL_ADD_TO_FAVORITES), + MENU_ENUM_LABEL_ADD_TO_FAVORITES, FILE_TYPE_PLAYLIST_ENTRY, 0, 0); + } menu_entries_append_enum(info->list, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_OPTIONS), @@ -5369,6 +5372,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE, PARSE_ONLY_BOOL, false); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + PARSE_ONLY_BOOL, false); + info->need_refresh = true; info->need_push = true; break; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index ac5adabcfc..eb9e0ded92 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5881,6 +5881,21 @@ static bool setting_append_list( general_read_handler, SD_FLAG_LAKKA_ADVANCED); + CONFIG_BOOL( + list, list_info, + &settings->bools.quick_menu_show_add_to_favorites, + MENU_ENUM_LABEL_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + MENU_ENUM_LABEL_VALUE_QUICK_MENU_SHOW_ADD_TO_FAVORITES, + quick_menu_show_add_to_favorites, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); + if (string_is_not_equal_fast(ui_companion_driver_get_ident(), "null", 4)) { CONFIG_BOOL( diff --git a/msg_hash.h b/msg_hash.h index fbdb3db098..50e5680f5b 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -712,6 +712,7 @@ enum msg_hash_enums MENU_LABEL(QUICK_MENU_SHOW_TAKE_SCREENSHOT), MENU_LABEL(QUICK_MENU_SHOW_SAVE_LOAD_STATE), MENU_LABEL(QUICK_MENU_SHOW_UNDO_SAVE_LOAD_STATE), + MENU_LABEL(QUICK_MENU_SHOW_ADD_TO_FAVORITES), /* UI settings */ MENU_LABEL(VIDEO_DISABLE_COMPOSITION),