From b7e7f6a651dcb184f34a2163a288b11403ca91d9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 3 May 2019 13:58:33 +0200 Subject: [PATCH] (Menu widgets) Add menu widgets setting --- config.def.h | 12 +++++++++--- configuration.c | 1 + configuration.h | 4 ++-- intl/msg_hash_ar.h | 2 ++ intl/msg_hash_chs.h | 2 ++ intl/msg_hash_cht.h | 2 ++ intl/msg_hash_de.h | 2 ++ intl/msg_hash_el.h | 2 ++ intl/msg_hash_eo.h | 2 ++ intl/msg_hash_es.h | 2 ++ intl/msg_hash_fr.h | 2 ++ intl/msg_hash_it.h | 2 ++ intl/msg_hash_ja.h | 2 ++ intl/msg_hash_ko.h | 2 ++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 2 ++ intl/msg_hash_pl.h | 2 ++ intl/msg_hash_pt_br.h | 2 ++ intl/msg_hash_pt_pt.h | 2 ++ intl/msg_hash_ru.h | 2 ++ intl/msg_hash_tr.h | 2 ++ intl/msg_hash_us.h | 2 ++ intl/msg_hash_vn.h | 2 ++ menu/menu_displaylist.c | 1 + menu/menu_setting.c | 17 +++++++++++++++++ msg_hash.h | 1 + 26 files changed, 71 insertions(+), 5 deletions(-) diff --git a/config.def.h b/config.def.h index 291920f073..41d9fe220d 100644 --- a/config.def.h +++ b/config.def.h @@ -537,11 +537,17 @@ static const unsigned video_3ds_display_mode = CTR_VIDEO_MODE_3D; static const bool audio_enable = true; /* Enable menu audio sounds. */ -static const bool audio_enable_menu = false; -static const bool audio_enable_menu_ok = false; +static const bool audio_enable_menu = false; +static const bool audio_enable_menu_ok = false; static const bool audio_enable_menu_cancel = false; static const bool audio_enable_menu_notice = false; -static const bool audio_enable_menu_bgm = false; +static const bool audio_enable_menu_bgm = false; + +#ifdef HAVE_MENU_WIDGETS +static const bool menu_enable_widgets = true; +#else +static const bool menu_enable_widgets = false; +#endif /* Output samplerate. */ #ifdef GEKKO diff --git a/configuration.c b/configuration.c index 36eb58cf4a..de37b3a173 100644 --- a/configuration.c +++ b/configuration.c @@ -1416,6 +1416,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("keyboard_gamepad_enable", &settings->bools.input_keyboard_gamepad_enable, true, true, false); SETTING_BOOL("core_set_supports_no_game_enable", &settings->bools.set_supports_no_game_enable, true, true, false); SETTING_BOOL("audio_enable", &settings->bools.audio_enable, true, audio_enable, false); + SETTING_BOOL("menu_enable_widgets", &settings->bools.menu_enable_widgets, true, menu_enable_widgets, false); SETTING_BOOL("audio_enable_menu", &settings->bools.audio_enable_menu, true, audio_enable_menu, false); SETTING_BOOL("audio_enable_menu_ok", &settings->bools.audio_enable_menu_ok, true, audio_enable_menu_ok, false); SETTING_BOOL("audio_enable_menu_cancel", &settings->bools.audio_enable_menu_cancel, true, audio_enable_menu_cancel, false); diff --git a/configuration.h b/configuration.h index 3ffe8c2787..af009d3ee4 100644 --- a/configuration.h +++ b/configuration.h @@ -137,6 +137,7 @@ typedef struct settings /* Menu */ bool filter_by_current_core; + bool menu_enable_widgets; bool menu_show_start_screen; bool menu_pause_libretro; bool menu_timedate_enable; @@ -322,9 +323,8 @@ typedef struct settings bool quit_press_twice; bool vibrate_on_keypress; bool enable_device_vibration; -#ifdef HAVE_OZONE bool ozone_collapse_sidebar; -#endif + bool log_to_file; bool log_to_file_timestamp; diff --git a/intl/msg_hash_ar.h b/intl/msg_hash_ar.h index eed9a5adfb..aac7d3fc67 100644 --- a/intl/msg_hash_ar.h +++ b/intl/msg_hash_ar.h @@ -3748,3 +3748,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index cbfbb3dcad..add745bacb 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -4762,3 +4762,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_cht.h b/intl/msg_hash_cht.h index 51fcd9bec1..3808dd47a2 100644 --- a/intl/msg_hash_cht.h +++ b/intl/msg_hash_cht.h @@ -3520,3 +3520,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index aa8d12dc5c..1bb07d9be5 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -3649,3 +3649,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_el.h b/intl/msg_hash_el.h index 277010eeb8..a46aecf8a8 100644 --- a/intl/msg_hash_el.h +++ b/intl/msg_hash_el.h @@ -7726,3 +7726,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 8bd0a1bf94..305a4a0c19 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -3408,3 +3408,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_es.h b/intl/msg_hash_es.h index d28468f27a..f57227a9cf 100644 --- a/intl/msg_hash_es.h +++ b/intl/msg_hash_es.h @@ -7878,3 +7878,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index f19fba3360..f90dc48baf 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -3564,3 +3564,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index 52d2daead1..694b40bafe 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -3633,3 +3633,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "Supporto per il CoreAudio V3" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 4e1d965c27..a551e91599 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -4202,3 +4202,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_RUNTIME_LOG_DIRECTORY, "実行時ログ" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_ko.h b/intl/msg_hash_ko.h index 9925ca5c83..f9234ae799 100644 --- a/intl/msg_hash_ko.h +++ b/intl/msg_hash_ko.h @@ -3501,3 +3501,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index ea269418aa..fac46e6bdf 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1837,3 +1837,5 @@ MSG_HASH(MENU_ENUM_LABEL_ENABLE_DEVICE_VIBRATION, "enable_device_vibration") MSG_HASH(MENU_ENUM_LABEL_LOG_DIR, "log_dir") +MSG_HASH(MENU_ENUM_LABEL_MENU_WIDGETS_ENABLE, + "menu_widgets_enable") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 2cea609bb3..8a8898434b 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -3402,3 +3402,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_MENU_SOUNDS, "Menu Geluiden" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_pl.h b/intl/msg_hash_pl.h index 3b1f838276..bf32f203f2 100644 --- a/intl/msg_hash_pl.h +++ b/intl/msg_hash_pl.h @@ -3798,3 +3798,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "Obsługa CoreAudio V3" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_pt_br.h b/intl/msg_hash_pt_br.h index fd005cd987..e6f439dbbc 100644 --- a/intl/msg_hash_pt_br.h +++ b/intl/msg_hash_pt_br.h @@ -8030,3 +8030,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_pt_pt.h b/intl/msg_hash_pt_pt.h index 86a2be8e07..d087dd7ada 100644 --- a/intl/msg_hash_pt_pt.h +++ b/intl/msg_hash_pt_pt.h @@ -3474,3 +3474,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 7924355c65..73680adde6 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -3677,3 +3677,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_tr.h b/intl/msg_hash_tr.h index bf81a2b61d..6526dc1028 100644 --- a/intl/msg_hash_tr.h +++ b/intl/msg_hash_tr.h @@ -8546,3 +8546,5 @@ MSG_HASH( MENU_ENUM_SUBLABEL_LOG_DIR, "Sistem olay günlüğü dosyalarını bu dizine kaydedin." ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 01f4d3b889..6cbe0440d5 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -8652,3 +8652,5 @@ MSG_HASH( MENU_ENUM_SUBLABEL_LOG_DIR, "Save system event log files to this directory." ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/intl/msg_hash_vn.h b/intl/msg_hash_vn.h index 99dc15aa15..820aa185fe 100644 --- a/intl/msg_hash_vn.h +++ b/intl/msg_hash_vn.h @@ -3564,3 +3564,5 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COREAUDIO3_SUPPORT, "CoreAudio V3 support" ) +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + "Menu Widgets") diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 8ab4957d41..c2d88ab26e 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3616,6 +3616,7 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct {MENU_ENUM_LABEL_MENU_VIEWS_SETTINGS, PARSE_ACTION }, {MENU_ENUM_LABEL_MENU_SETTINGS, PARSE_ACTION }, {MENU_ENUM_LABEL_SHOW_ADVANCED_SETTINGS, PARSE_ONLY_BOOL }, + {MENU_ENUM_LABEL_MENU_WIDGETS_ENABLE, PARSE_ONLY_BOOL }, {MENU_ENUM_LABEL_MENU_ENABLE_KIOSK_MODE, PARSE_ONLY_BOOL }, {MENU_ENUM_LABEL_MENU_KIOSK_MODE_PASSWORD, PARSE_ONLY_STRING}, {MENU_ENUM_LABEL_NAVIGATION_WRAPAROUND, PARSE_ONLY_BOOL }, diff --git a/menu/menu_setting.c b/menu/menu_setting.c index e747f9e56c..8158516fdf 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -11038,6 +11038,23 @@ static bool setting_append_list( general_read_handler, SD_FLAG_NONE); +#ifdef HAVE_MENU_WIDGETS + CONFIG_BOOL( + list, list_info, + &settings->bools.menu_enable_widgets, + MENU_ENUM_LABEL_MENU_WIDGETS_ENABLE, + MENU_ENUM_LABEL_VALUE_MENU_WIDGETS_ENABLE, + menu_enable_widgets, + 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); +#endif + if (string_is_equal(settings->arrays.menu_driver, "xmb") || string_is_equal(settings->arrays.menu_driver, "ozone")) { CONFIG_BOOL( diff --git a/msg_hash.h b/msg_hash.h index aa6c67a4a1..500a1736f6 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -2060,6 +2060,7 @@ enum msg_hash_enums MENU_ENUM_SUBLABEL_INFORMATION_LIST_LIST, MENU_ENUM_SUBLABEL_SERVICES_SETTINGS, + MENU_LABEL(MENU_WIDGETS_ENABLE), MENU_LABEL(SELECT_FILE), MENU_LABEL(SELECT_FROM_PLAYLIST),