Make autoconfig failure notifications optional. (#17636)

Introduce a new setting that controls autoconfiguration messages
when the config fails, either with fallback or without.
This commit is contained in:
zoltanvb 2025-02-28 05:15:06 +01:00 committed by GitHub
parent fa6d622031
commit 9970d45367
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 49 additions and 5 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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
#endif

View File

@ -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
#endif

View File

@ -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);

View File

@ -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

View File

@ -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(

View File

@ -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),

View File

@ -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;

View File

@ -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);