From 5d28029be893db3edd43c13b87e48d83148a9a36 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Sun, 30 Oct 2016 23:29:03 -0400 Subject: [PATCH] remove confirm_on_exit menu option --- command.c | 18 ------------------ command.h | 1 - config.def.h | 2 -- configuration.c | 1 - configuration.h | 1 - intl/msg_hash_us.c | 2 -- menu/drivers/menu_generic.c | 15 --------------- menu/menu_displaylist.c | 3 --- menu/menu_event.c | 25 +------------------------ menu/menu_setting.c | 6 ------ retroarch.cfg | 3 --- runloop.c | 32 -------------------------------- runloop.h | 3 --- 13 files changed, 1 insertion(+), 111 deletions(-) diff --git a/command.c b/command.c index c43e5af118..d837abbaa6 100644 --- a/command.c +++ b/command.c @@ -1714,13 +1714,6 @@ static void command_event_main_state(unsigned cmd) void handle_quit_event(void) { -#ifdef HAVE_MENU - settings_t *settings = config_get_ptr(); - if (settings && settings->confirm_on_exit && - menu_dialog_is_active()) - return; -#endif - command_event(CMD_EVENT_AUTOSAVE_STATE, NULL); command_event(CMD_EVENT_DISABLE_OVERRIDES, NULL); command_event(CMD_EVENT_RESTORE_DEFAULT_SHADER_PRESET, NULL); @@ -1931,18 +1924,7 @@ bool command_event(enum event_command cmd, void *data) core_unload(); #endif break; - case CMD_EVENT_QUIT_CONFIRM: - handle_quit_event(); - break; case CMD_EVENT_QUIT: -#ifdef HAVE_MENU - if (settings && settings->confirm_on_exit && - !menu_dialog_is_active() && !runloop_is_quit_confirm()) - { - menu_dialog_show_message(MENU_DIALOG_QUIT_CONFIRM, MENU_ENUM_LABEL_CONFIRM_ON_EXIT); - break; - } -#endif handle_quit_event(); break; case CMD_EVENT_CHEEVOS_HARDCORE_MODE_TOGGLE: diff --git a/command.h b/command.h index 475a02cb7d..74bf5ad822 100644 --- a/command.h +++ b/command.h @@ -60,7 +60,6 @@ enum event_command CMD_EVENT_TAKE_SCREENSHOT, /* Quits RetroArch. */ CMD_EVENT_QUIT, - CMD_EVENT_QUIT_CONFIRM, /* Reinitialize all drivers. */ CMD_EVENT_REINIT, /* Toggles cheevos hardcore mode. */ diff --git a/config.def.h b/config.def.h index 040ea09e32..751de14812 100644 --- a/config.def.h +++ b/config.def.h @@ -533,8 +533,6 @@ static unsigned aspect_ratio_idx = ASPECT_RATIO_CORE; /* Save configuration file on exit. */ static bool config_save_on_exit = true; -static bool confirm_on_exit = false; - static bool show_hidden_files = true; static const bool overlay_hide_in_menu = true; diff --git a/configuration.c b/configuration.c index 796d8e0469..a425900668 100644 --- a/configuration.c +++ b/configuration.c @@ -830,7 +830,6 @@ static int populate_settings_bool(settings_t *settings, struct config_bool_setti SETTING_BOOL("sort_savefiles_enable", &settings->sort_savefiles_enable, true, default_sort_savefiles_enable, false); SETTING_BOOL("sort_savestates_enable", &settings->sort_savestates_enable, true, default_sort_savestates_enable, false); SETTING_BOOL("config_save_on_exit", &settings->config_save_on_exit, true, config_save_on_exit, false); - SETTING_BOOL("confirm_on_exit", &settings->confirm_on_exit, true, confirm_on_exit, false); SETTING_BOOL("show_hidden_files", &settings->show_hidden_files, true, show_hidden_files, false); SETTING_BOOL("input_autodetect_enable", &settings->input.autodetect_enable, true, input_autodetect_enable, false); SETTING_BOOL("audio_rate_control", &settings->audio.rate_control, true, rate_control, false); diff --git a/configuration.h b/configuration.h index 9cf3d78e8f..d58cb0547f 100644 --- a/configuration.h +++ b/configuration.h @@ -468,7 +468,6 @@ typedef struct settings #endif bool config_save_on_exit; - bool confirm_on_exit; bool show_hidden_files; #ifdef HAVE_LAKKA diff --git a/intl/msg_hash_us.c b/intl/msg_hash_us.c index 951d6e09a3..d523e95a86 100644 --- a/intl/msg_hash_us.c +++ b/intl/msg_hash_us.c @@ -2606,8 +2606,6 @@ static const char *menu_hash_to_str_us_label_enum(enum msg_hash_enums msg) return "auto_overrides_enable"; case MENU_ENUM_LABEL_CONFIG_SAVE_ON_EXIT: return "config_save_on_exit"; - case MENU_ENUM_LABEL_CONFIRM_ON_EXIT: - return "confirm_on_exit"; case MENU_ENUM_LABEL_SHOW_HIDDEN_FILES: return "show_hidden_files"; case MENU_ENUM_LABEL_VIDEO_SMOOTH: diff --git a/menu/drivers/menu_generic.c b/menu/drivers/menu_generic.c index 2a046731e0..304298d3a6 100644 --- a/menu/drivers/menu_generic.c +++ b/menu/drivers/menu_generic.c @@ -110,27 +110,12 @@ int generic_menu_iterate(void *data, void *userdata, enum menu_action action) { BIT64_SET(menu->state, MENU_STATE_POP_STACK); menu_dialog_set_active(false); - - if (menu_dialog_get_current_type() == MENU_DIALOG_QUIT_CONFIRM) - { - runloop_set_quit_confirm(true); - command_event(CMD_EVENT_QUIT_CONFIRM, NULL); - } } if (action == MENU_ACTION_CANCEL) { BIT64_SET(menu->state, MENU_STATE_POP_STACK); menu_dialog_set_active(false); - - if (menu_dialog_get_current_type() == MENU_DIALOG_QUIT_CONFIRM) - { - runloop_set_quit_confirm(false); - - if (content_is_inited() && - menu_display_toggle_get_reason() != MENU_TOGGLE_REASON_USER) - rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL); - } } break; case ITERATE_TYPE_BIND: diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 6593b843f9..a0f0dc99c2 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -4525,9 +4525,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_CONFIG_SAVE_ON_EXIT, PARSE_ONLY_BOOL, false); - menu_displaylist_parse_settings_enum(menu, info, - MENU_ENUM_LABEL_CONFIRM_ON_EXIT, - PARSE_ONLY_BOOL, false); menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_CORE_SPECIFIC_CONFIG, PARSE_ONLY_BOOL, false); diff --git a/menu/menu_event.c b/menu/menu_event.c index aad659c08f..0191906f50 100644 --- a/menu/menu_event.c +++ b/menu/menu_event.c @@ -369,30 +369,7 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input) } if (runloop_cmd_press(trigger_input, RARCH_QUIT_KEY)) - { - int should_we_quit = true; - - if (!runloop_is_quit_confirm()) - { - if (settings && settings->confirm_on_exit) - { - if (!menu_dialog_is_active() && content_is_inited()) - { - if(menu_display_toggle_get_reason() != MENU_TOGGLE_REASON_USER) - menu_display_toggle_set_reason(MENU_TOGGLE_REASON_MESSAGE); - rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL); - } - - menu_dialog_show_message(MENU_DIALOG_QUIT_CONFIRM, MENU_ENUM_LABEL_CONFIRM_ON_EXIT); - - should_we_quit = false; - } - - if ((settings && !settings->confirm_on_exit) || - should_we_quit) - return MENU_ACTION_QUIT; - } - } + return MENU_ACTION_QUIT; mouse_enabled = settings->menu.mouse.enable; #ifdef HAVE_OVERLAY diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 92a84c8875..9447175451 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -2719,12 +2719,6 @@ static bool setting_append_list( bool_entries[0].default_value = config_save_on_exit; bool_entries[0].flags = SD_FLAG_NONE; - bool_entries[1].target = &settings->confirm_on_exit; - bool_entries[1].name_enum_idx = MENU_ENUM_LABEL_CONFIRM_ON_EXIT; - bool_entries[1].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_CONFIRM_ON_EXIT; - bool_entries[1].default_value = confirm_on_exit; - bool_entries[1].flags = SD_FLAG_NONE; - bool_entries[2].target = &settings->show_hidden_files; bool_entries[2].name_enum_idx = MENU_ENUM_LABEL_SHOW_HIDDEN_FILES; bool_entries[2].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_SHOW_HIDDEN_FILES; diff --git a/retroarch.cfg b/retroarch.cfg index 3124140fe0..bf1212275d 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -119,9 +119,6 @@ # Overwrites the config. #include's and comments are not preserved. # config_save_on_exit = true -# Ask for confirmation on exit. -# confirm_on_exit = false - # Load up a specific config file based on the core being used. # core_specific_config = false diff --git a/runloop.c b/runloop.c index aaa76a9f21..a456ea7104 100644 --- a/runloop.c +++ b/runloop.c @@ -121,7 +121,6 @@ static bool runloop_set_frame_limit = false; static bool runloop_paused = false; static bool runloop_idle = false; static bool runloop_exec = false; -static bool runloop_quit_confirm = false; static bool runloop_slowmotion = false; static bool runloop_shutdown_initiated = false; static bool runloop_core_shutdown_initiated = false; @@ -715,16 +714,6 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data) return true; } -bool runloop_is_quit_confirm(void) -{ - return runloop_quit_confirm; -} - -void runloop_set_quit_confirm(bool on) -{ - runloop_quit_confirm = on; -} - /* Time to exit out of the main loop? * Reasons for exiting: * a) Shutdown environment callback was invoked. @@ -748,27 +737,6 @@ static INLINE int runloop_iterate_time_to_exit(bool quit_key_pressed) if (!time_to_exit) return 1; -#ifdef HAVE_MENU - if (!runloop_is_quit_confirm()) - { - if (settings && settings->confirm_on_exit) - { - if (menu_dialog_is_active()) - return 1; - - if (content_is_inited()) - { - if(menu_display_toggle_get_reason() != MENU_TOGGLE_REASON_USER) - menu_display_toggle_set_reason(MENU_TOGGLE_REASON_MESSAGE); - rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL); - } - - menu_dialog_show_message(MENU_DIALOG_QUIT_CONFIRM, MENU_ENUM_LABEL_CONFIRM_ON_EXIT); - return 1; - } - } -#endif - if (runloop_exec) runloop_exec = false; diff --git a/runloop.h b/runloop.h index 335567a8fa..6caf1bc868 100644 --- a/runloop.h +++ b/runloop.h @@ -219,9 +219,6 @@ void runloop_msg_queue_push(const char *msg, unsigned prio, char* runloop_msg_queue_pull(void); -bool runloop_is_quit_confirm(void); -void runloop_set_quit_confirm(bool on); - bool runloop_ctl(enum runloop_ctl_state state, void *data); RETRO_END_DECLS