Refactor 'Accounts' code - moved to menu_setting.c

This commit is contained in:
twinaphex 2015-10-20 01:47:32 +02:00
parent 8cc27e581b
commit 90fae3e2d0
4 changed files with 43 additions and 10 deletions

View File

@ -676,6 +676,8 @@ const char *menu_hash_to_str_us(uint32_t hash)
return "Retro Achievements";
case MENU_LABEL_VALUE_ACCOUNTS_LIST:
return "Accounts";
case MENU_LABEL_VALUE_ACCOUNTS_LIST_END:
return "Accounts List Endpoint";
case MENU_LABEL_VALUE_DEBUG_PANEL_ENABLE:
return "Debug Panel Enable";
case MENU_LABEL_VALUE_HELP_SCANNING_CONTENT:

View File

@ -2274,16 +2274,9 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
}
break;
case DISPLAYLIST_ACCOUNTS_LIST:
#ifdef HAVE_CHEEVOS
menu_entries_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_ACCOUNTS_RETRO_ACHIEVEMENTS),
menu_hash_to_str(MENU_LABEL_ACCOUNTS_RETRO_ACHIEVEMENTS),
MENU_SETTING_ACTION, 0, 0);
#else
menu_entries_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_NO_ITEMS),
"", 0, 0, 0);
#endif
ret = menu_displaylist_parse_settings(menu, info,
menu_hash_to_str(MENU_LABEL_VALUE_ACCOUNTS_LIST_END),
PARSE_NONE);
need_refresh = true;
need_push = true;
break;

View File

@ -40,6 +40,7 @@ extern "C" {
#define MENU_LABEL_DEFERRED_ACCOUNTS_LIST 0x3d2b8860U
#define MENU_LABEL_ACCOUNTS_LIST 0x774c15a0U
#define MENU_LABEL_VALUE_ACCOUNTS_LIST 0x86e551a1U
#define MENU_LABEL_VALUE_ACCOUNTS_LIST_END 0x3d559522U
#define MENU_LABEL_DEBUG_PANEL_ENABLE 0xbad176a1U
#define MENU_LABEL_VALUE_DEBUG_PANEL_ENABLE 0x15042803U

View File

@ -5905,6 +5905,40 @@ static bool setting_append_list_playlist_options(
return true;
}
static bool setting_append_list_accounts_options(
rarch_setting_t **list,
rarch_setting_info_t *list_info,
const char *parent_group)
{
rarch_setting_group_info_t group_info = {0};
rarch_setting_group_info_t subgroup_info = {0};
settings_t *settings = config_get_ptr();
START_GROUP(group_info,
menu_hash_to_str(MENU_LABEL_VALUE_ACCOUNTS_LIST_END),
parent_group);
parent_group = menu_hash_to_str(MENU_LABEL_VALUE_SETTINGS);
START_SUB_GROUP(list, list_info, "State", group_info.name, subgroup_info, parent_group);
(void)subgroup_info;
#ifdef HAVE_CHEEVOS
CONFIG_ACTION(
menu_hash_to_str(MENU_LABEL_ACCOUNTS_RETRO_ACHIEVEMENTS),
menu_hash_to_str(MENU_LABEL_VALUE_ACCOUNTS_RETRO_ACHIEVEMENTS),
group_info.name,
subgroup_info.name,
parent_group);
#endif
END_SUB_GROUP(list, list_info, parent_group);
END_GROUP(list, list_info, parent_group);
return true;
}
#ifdef HAVE_CHEEVOS
static bool setting_append_list_accounts_cheevos_options(
rarch_setting_t **list,
@ -6786,6 +6820,9 @@ rarch_setting_t *menu_setting_new(void)
if (!setting_append_list_user_options(&list, list_info, root))
goto error;
if (!setting_append_list_accounts_options(&list, list_info, root))
goto error;
#ifdef HAVE_CHEEVOS
if (!setting_append_list_accounts_cheevos_options(&list, list_info, root))
goto error;