diff --git a/config.def.h b/config.def.h index f6c9948a10..0b39c4270d 100644 --- a/config.def.h +++ b/config.def.h @@ -1090,6 +1090,10 @@ #define DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG true #endif +/* Display a notification when controller + * autoconfiguration fails. */ +#define DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG_FAILS true + /* Display a notification when cheats are being * applied */ #define DEFAULT_NOTIFICATION_SHOW_CHEATS_APPLIED true diff --git a/configuration.c b/configuration.c index ffca74e8e3..c9563cf380 100644 --- a/configuration.c +++ b/configuration.c @@ -1910,6 +1910,7 @@ static struct config_bool_setting *populate_settings_bool( SETTING_BOOL("menu_widget_scale_auto", &settings->bools.menu_widget_scale_auto, true, DEFAULT_MENU_WIDGET_SCALE_AUTO, false); SETTING_BOOL("menu_show_load_content_animation", &settings->bools.menu_show_load_content_animation, true, DEFAULT_MENU_SHOW_LOAD_CONTENT_ANIMATION, false); SETTING_BOOL("notification_show_autoconfig", &settings->bools.notification_show_autoconfig, true, DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG, false); + SETTING_BOOL("notification_show_autoconfig_fails", &settings->bools.notification_show_autoconfig_fails, true, DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG_FAILS, false); SETTING_BOOL("notification_show_cheats_applied", &settings->bools.notification_show_cheats_applied, true, DEFAULT_NOTIFICATION_SHOW_CHEATS_APPLIED, false); SETTING_BOOL("notification_show_patch_applied", &settings->bools.notification_show_patch_applied, true, DEFAULT_NOTIFICATION_SHOW_PATCH_APPLIED, false); SETTING_BOOL("notification_show_remap_load", &settings->bools.notification_show_remap_load, true, DEFAULT_NOTIFICATION_SHOW_REMAP_LOAD, false); diff --git a/configuration.h b/configuration.h index c286af6230..6577cfa794 100644 --- a/configuration.h +++ b/configuration.h @@ -733,6 +733,7 @@ typedef struct settings bool menu_enable_widgets; bool menu_show_load_content_animation; bool notification_show_autoconfig; + bool notification_show_autoconfig_fails; bool notification_show_cheats_applied; bool notification_show_patch_applied; bool notification_show_remap_load; diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 0455c16797..37fbac540d 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -6224,6 +6224,10 @@ MSG_HASH( MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG, "notification_show_autoconfig" ) +MSG_HASH( + MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG_FAILS, + "notification_show_autoconfig_fails" + ) MSG_HASH( MENU_ENUM_LABEL_NOTIFICATION_SHOW_CHEATS_APPLIED, "notification_show_cheats_applied" @@ -6661,4 +6665,4 @@ MSG_HASH( MENU_ENUM_LABEL_GAME_AI_SHOW_DEBUG, "game_ai_show_debug" ) -#endif \ No newline at end of file +#endif diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index b96279341c..c6c0fafbb2 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -5913,6 +5913,10 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_AUTOCONFIG, "Input (Autoconfig) Connection Notifications" ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_AUTOCONFIG_FAILS, + "Input (Autoconfig) Failure Notifications" + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_CHEATS_APPLIED, "Cheat Code Notifications" @@ -5933,6 +5937,10 @@ MSG_HASH( MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_AUTOCONFIG, "Display an on-screen message when connecting/disconnecting input devices." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_AUTOCONFIG_FAILS, + "Display an on-screen message when input devices could not be configured." + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_REMAP_LOAD, "Input Remap Loaded Notifications" @@ -16712,4 +16720,4 @@ MSG_HASH( MENU_ENUM_SUBLABEL_QUICK_MENU_SHOW_GAME_AI, "Show the 'Game AI' option." ) -#endif \ No newline at end of file +#endif diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index b3302f626a..bfe9eacc56 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -664,6 +664,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_restart_retroarch, MENU_ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_widgets, MENU_ENUM_SUBLABEL_MENU_WIDGETS_ENABLE) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_show_load_content_animation, MENU_ENUM_SUBLABEL_MENU_SHOW_LOAD_CONTENT_ANIMATION) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_autoconfig, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_AUTOCONFIG) +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_autoconfig_fails, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_AUTOCONFIG_FAILS) #ifdef HAVE_CHEATS DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_notification_show_cheats_applied, MENU_ENUM_SUBLABEL_NOTIFICATION_SHOW_CHEATS_APPLIED) #endif @@ -4377,6 +4378,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_autoconfig); break; + case MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG_FAILS: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_autoconfig_fails); + break; case MENU_ENUM_LABEL_NOTIFICATION_SHOW_CHEATS_APPLIED: #ifdef HAVE_CHEATS BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_notification_show_cheats_applied); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 216f2a64a2..cc7aa7b4c7 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -10497,6 +10497,7 @@ unsigned menu_displaylist_build_list( {MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT_ANIMATION, PARSE_ONLY_BOOL, false }, {MENU_ENUM_LABEL_NOTIFICATION_SHOW_WHEN_MENU_IS_ALIVE, PARSE_ONLY_BOOL, false }, {MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG, PARSE_ONLY_BOOL, false }, + {MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG_FAILS, PARSE_ONLY_BOOL, false }, #ifdef HAVE_CHEATS {MENU_ENUM_LABEL_NOTIFICATION_SHOW_CHEATS_APPLIED, PARSE_ONLY_BOOL, false }, #endif diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 9b7dc5ed81..31fda32c5f 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -16692,6 +16692,20 @@ static bool setting_append_list( general_write_handler, general_read_handler, SD_FLAG_NONE); + CONFIG_BOOL( + list, list_info, + &settings->bools.notification_show_autoconfig_fails, + MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG_FAILS, + MENU_ENUM_LABEL_VALUE_NOTIFICATION_SHOW_AUTOCONFIG_FAILS, + DEFAULT_NOTIFICATION_SHOW_AUTOCONFIG_FAILS, + 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); #ifdef HAVE_CHEATS CONFIG_BOOL( diff --git a/msg_hash.h b/msg_hash.h index 77aef00777..b070f6abd9 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -3806,6 +3806,7 @@ enum msg_hash_enums MENU_LABEL(MENU_SHOW_LOAD_CONTENT_ANIMATION), MENU_LABEL(NOTIFICATION_SHOW_AUTOCONFIG), + MENU_LABEL(NOTIFICATION_SHOW_AUTOCONFIG_FAILS), MENU_LABEL(NOTIFICATION_SHOW_CHEATS_APPLIED), MENU_LABEL(NOTIFICATION_SHOW_PATCH_APPLIED), MENU_LABEL(NOTIFICATION_SHOW_REMAP_LOAD), diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 01fb36fdf0..2893a18904 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -46,7 +46,8 @@ enum autoconfig_handle_flags { AUTOCONF_FLAG_AUTOCONFIG_ENABLED = (1 << 0), - AUTOCONF_FLAG_SUPPRESS_NOTIFICATIONS = (1 << 1) + AUTOCONF_FLAG_SUPPRESS_NOTIFICATIONS = (1 << 1), + AUTOCONF_FLAG_SUPPRESS_FAILURE_NOTIF = (1 << 2) }; typedef struct @@ -758,7 +759,7 @@ static void input_autoconfigure_connect_handler(retro_task_t *task) } /* Device is autoconfigured, but a (most likely * incorrect) fallback definition was used... */ - else + else if (!(autoconfig_handle->flags & AUTOCONF_FLAG_SUPPRESS_FAILURE_NOTIF)) snprintf(task_title, sizeof(task_title), msg_hash_to_str(MSG_DEVICE_NOT_CONFIGURED_FALLBACK_NR), device_display_name, @@ -766,7 +767,7 @@ static void input_autoconfigure_connect_handler(retro_task_t *task) autoconfig_handle->device_info.pid); } /* Autoconfig failed */ - else + else if (!(autoconfig_handle->flags & AUTOCONF_FLAG_SUPPRESS_FAILURE_NOTIF)) snprintf(task_title, sizeof(task_title), msg_hash_to_str(MSG_DEVICE_NOT_CONFIGURED_NR), device_display_name, @@ -824,6 +825,8 @@ bool input_autoconfigure_connect( settings->paths.directory_autoconfig : NULL; bool notification_show_autoconfig = settings ? settings->bools.notification_show_autoconfig : true; + bool notification_show_autoconfig_fails = settings ? + settings->bools.notification_show_autoconfig_fails : true; task_finder_data_t find_data; if (port >= MAX_INPUT_DEVICES) @@ -855,6 +858,8 @@ bool input_autoconfigure_connect( autoconfig_handle->flags |= AUTOCONF_FLAG_AUTOCONFIG_ENABLED; if (!notification_show_autoconfig) autoconfig_handle->flags |= AUTOCONF_FLAG_SUPPRESS_NOTIFICATIONS; + if (!notification_show_autoconfig_fails) + autoconfig_handle->flags |= AUTOCONF_FLAG_SUPPRESS_FAILURE_NOTIF; autoconfig_handle->dir_autoconfig = NULL; autoconfig_handle->dir_driver_autoconfig = NULL; autoconfig_handle->autoconfig_file = NULL; diff --git a/ui/drivers/qt/qt_options.cpp b/ui/drivers/qt/qt_options.cpp index 5caf1e49d9..50f0754577 100644 --- a/ui/drivers/qt/qt_options.cpp +++ b/ui/drivers/qt/qt_options.cpp @@ -645,6 +645,7 @@ QWidget *NotificationsPage::widget() #endif notificationsGroup->add(MENU_ENUM_LABEL_MENU_SHOW_LOAD_CONTENT_ANIMATION); notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG); + notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_AUTOCONFIG_FAILS); notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_REMAP_LOAD); notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_CONFIG_OVERRIDE_LOAD); notificationsGroup->add(MENU_ENUM_LABEL_NOTIFICATION_SHOW_SET_INITIAL_DISK);