Skip to content

Commit 0a29db8

Browse files
committed
menu: add "Show Confirmation Boxes" toggle to gate confirm dialogs
1 parent 5bedbf8 commit 0a29db8

12 files changed

Lines changed: 43 additions & 3 deletions

config.def.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@
813813
#define DEFAULT_MENU_SHOW_CORE_MANAGER_STEAM true
814814
#endif
815815
#define DEFAULT_MENU_SHOW_SUBLABELS true
816+
#define DEFAULT_MENU_SHOW_CONFIRM true
816817
#define DEFAULT_MENU_DYNAMIC_WALLPAPER_ENABLE true
817818
#define DEFAULT_MENU_SCROLL_FAST false
818819
#define DEFAULT_MENU_SCROLL_DELAY 256

configuration.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,6 +2032,7 @@ static struct config_bool_setting *populate_settings_bool(
20322032
SETTING_BOOL("menu_battery_level_enable", &settings->bools.menu_battery_level_enable, true, true, false);
20332033
SETTING_BOOL("menu_core_enable", &settings->bools.menu_core_enable, true, true, false);
20342034
SETTING_BOOL("menu_show_sublabels", &settings->bools.menu_show_sublabels, true, DEFAULT_MENU_SHOW_SUBLABELS, false);
2035+
SETTING_BOOL("menu_show_confirm", &settings->bools.menu_show_confirm, true, DEFAULT_MENU_SHOW_CONFIRM, false);
20352036
SETTING_BOOL("menu_dynamic_wallpaper_enable", &settings->bools.menu_dynamic_wallpaper_enable, true, DEFAULT_MENU_DYNAMIC_WALLPAPER_ENABLE, false);
20362037
SETTING_BOOL("menu_ticker_smooth", &settings->bools.menu_ticker_smooth, true, DEFAULT_MENU_TICKER_SMOOTH, false);
20372038
SETTING_BOOL("menu_scroll_fast", &settings->bools.menu_scroll_fast, true, DEFAULT_MENU_SCROLL_FAST, false);

configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,7 @@ typedef struct settings
827827
bool menu_battery_level_enable;
828828
bool menu_core_enable;
829829
bool menu_show_sublabels;
830+
bool menu_show_confirm;
830831
bool menu_dynamic_wallpaper_enable;
831832
bool menu_mouse_enable;
832833
bool menu_pointer_enable;

intl/msg_hash_lbl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4875,6 +4875,10 @@ MSG_HASH(
48754875
MENU_ENUM_LABEL_MENU_SHOW_SUBLABELS,
48764876
MENU_ENUM_LABEL_MENU_SHOW_SUBLABELS_STR
48774877
)
4878+
MSG_HASH(
4879+
MENU_ENUM_LABEL_MENU_SHOW_CONFIRM,
4880+
MENU_ENUM_LABEL_MENU_SHOW_CONFIRM_STR
4881+
)
48784882
MSG_HASH(
48794883
MENU_ENUM_LABEL_BROWSE_URL,
48804884
MENU_ENUM_LABEL_BROWSE_URL_STR

intl/msg_hash_us.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6640,6 +6640,14 @@ MSG_HASH(
66406640
MENU_ENUM_SUBLABEL_MENU_SHOW_SUBLABELS,
66416641
"Show additional information for menu items."
66426642
)
6643+
MSG_HASH(
6644+
MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIRM,
6645+
"Show Confirmation Boxes"
6646+
)
6647+
MSG_HASH(
6648+
MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIRM,
6649+
"Ask for confirmation before quitting, resetting or closing content. When disabled these actions happen immediately."
6650+
)
66436651
MSG_HASH( /* FIXME Not RGUI specific */
66446652
MENU_ENUM_LABEL_VALUE_RGUI_SHOW_START_SCREEN,
66456653
"Display Start Screen"

menu/cbs/menu_cbs_ok.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5870,7 +5870,7 @@ int action_ok_quit(const char *path, const char *label, unsigned type, size_t id
58705870
{
58715871
settings_t *settings = config_get_ptr();
58725872

5873-
if (settings->bools.confirm_quit)
5873+
if (settings->bools.menu_show_confirm && settings->bools.confirm_quit)
58745874
{
58755875
struct menu_state *menu_st = menu_state_get_ptr();
58765876
menu_dialog_confirm_set(menu_st, MSG_PRESS_AGAIN_TO_QUIT, CMD_EVENT_QUIT);
@@ -5883,7 +5883,7 @@ int action_ok_restart_content(const char *path, const char *label, unsigned type
58835883
{
58845884
settings_t *settings = config_get_ptr();
58855885

5886-
if (settings->bools.confirm_reset)
5886+
if (settings->bools.menu_show_confirm && settings->bools.confirm_reset)
58875887
{
58885888
struct menu_state *menu_st = menu_state_get_ptr();
58895889
menu_dialog_confirm_set(menu_st, MSG_PRESS_AGAIN_TO_RESET, CMD_EVENT_RESET);
@@ -5896,7 +5896,7 @@ int action_ok_close_content(const char *path, const char *label, unsigned type,
58965896
{
58975897
settings_t *settings = config_get_ptr();
58985898

5899-
if (settings->bools.confirm_close)
5899+
if (settings->bools.menu_show_confirm && settings->bools.confirm_close)
59005900
{
59015901
struct menu_state *menu_st = menu_state_get_ptr();
59025902
menu_dialog_confirm_set(menu_st, MSG_PRESS_AGAIN_TO_CLOSE_CONTENT, CMD_EVENT_CLOSE_CONTENT);

menu/cbs/menu_cbs_sublabel.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_timedate_style,
996996
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_timedate_date_separator, MENU_ENUM_SUBLABEL_TIMEDATE_DATE_SEPARATOR)
997997
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_battery_level_enable, MENU_ENUM_SUBLABEL_BATTERY_LEVEL_ENABLE)
998998
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_show_sublabels, MENU_ENUM_SUBLABEL_MENU_SHOW_SUBLABELS)
999+
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_show_confirm, MENU_ENUM_SUBLABEL_MENU_SHOW_CONFIRM)
9991000
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_navigation_wraparound, MENU_ENUM_SUBLABEL_NAVIGATION_WRAPAROUND)
10001001
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_audio_resampler_quality, MENU_ENUM_SUBLABEL_AUDIO_RESAMPLER_QUALITY)
10011002
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_netplay_enable_host, MENU_ENUM_SUBLABEL_NETPLAY_ENABLE_HOST)
@@ -3713,6 +3714,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
37133714
case MENU_ENUM_LABEL_MENU_SHOW_SUBLABELS:
37143715
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_sublabels);
37153716
break;
3717+
case MENU_ENUM_LABEL_MENU_SHOW_CONFIRM:
3718+
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_show_confirm);
3719+
break;
37163720
case MENU_ENUM_LABEL_TIMEDATE_ENABLE:
37173721
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_timedate_enable);
37183722
break;

menu/menu_displaylist.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10543,6 +10543,7 @@ unsigned menu_displaylist_build_list(
1054310543
{MENU_ENUM_LABEL_BATTERY_LEVEL_ENABLE, PARSE_ONLY_BOOL, true },
1054410544
{MENU_ENUM_LABEL_CORE_ENABLE, PARSE_ONLY_BOOL, true },
1054510545
{MENU_ENUM_LABEL_MENU_SHOW_SUBLABELS, PARSE_ONLY_BOOL, true },
10546+
{MENU_ENUM_LABEL_MENU_SHOW_CONFIRM, PARSE_ONLY_BOOL, true },
1054610547
{MENU_ENUM_LABEL_RGUI_SHOW_START_SCREEN, PARSE_ONLY_BOOL, true },
1054710548
};
1054810549

menu/menu_setting.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21214,6 +21214,21 @@ static bool setting_append_list(
2121421214
(*list)[list_info->index - 1].action_left = &setting_bool_action_left_with_refresh;
2121521215
(*list)[list_info->index - 1].action_right = &setting_bool_action_right_with_refresh;
2121621216

21217+
CONFIG_BOOL(
21218+
list, list_info,
21219+
&settings->bools.menu_show_confirm,
21220+
MENU_ENUM_LABEL_MENU_SHOW_CONFIRM,
21221+
MENU_ENUM_LABEL_VALUE_MENU_SHOW_CONFIRM,
21222+
DEFAULT_MENU_SHOW_CONFIRM,
21223+
MENU_ENUM_LABEL_VALUE_OFF,
21224+
MENU_ENUM_LABEL_VALUE_ON,
21225+
&group_info,
21226+
&subgroup_info,
21227+
parent_group,
21228+
general_write_handler,
21229+
general_read_handler,
21230+
SD_FLAG_NONE);
21231+
2121721232

2121821233
END_SUB_GROUP(list, list_info, parent_group);
2121921234
END_GROUP(list, list_info, parent_group);

msg_hash.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,7 @@ enum msg_hash_enums
16711671
MENU_LABEL(TIMEDATE_DATE_SEPARATOR),
16721672
MENU_LABEL(BATTERY_LEVEL_ENABLE),
16731673
MENU_LABEL(MENU_SHOW_SUBLABELS),
1674+
MENU_LABEL(MENU_SHOW_CONFIRM),
16741675
MENU_LABEL(RGUI_MENU_COLOR_THEME),
16751676
MENU_LABEL(RGUI_MENU_THEME_PRESET),
16761677
MENU_LABEL(XMB_MENU_COLOR_THEME),

0 commit comments

Comments
 (0)