Create menu_displaylist_setting

This commit is contained in:
twinaphex 2018-10-17 05:33:22 +02:00
parent 927c65a1ba
commit 131d77875e
4 changed files with 49 additions and 51 deletions

View File

@ -2074,7 +2074,7 @@ static int materialui_list_push(void *data, void *userdata,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
{
entry.enum_idx = MENU_ENUM_LABEL_CONTENT_SETTINGS;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
#ifndef HAVE_DYNAMIC
@ -2084,39 +2084,39 @@ static int materialui_list_push(void *data, void *userdata,
if (settings->bools.menu_show_load_core)
{
entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
}
if (system->load_no_content)
{
entry.enum_idx = MENU_ENUM_LABEL_START_CORE;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
if (settings->bools.menu_show_load_content)
{
entry.enum_idx = MENU_ENUM_LABEL_LOAD_CONTENT_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
if (settings->bools.menu_content_show_history)
{
entry.enum_idx = MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
#if defined(HAVE_NETWORKING)
#ifdef HAVE_LAKKA
entry.enum_idx = MENU_ENUM_LABEL_UPDATE_LAKKA;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
#else
{
settings_t *settings = config_get_ptr();
if (settings->bools.menu_show_online_updater)
{
entry.enum_idx = MENU_ENUM_LABEL_ONLINE_UPDATER;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
}
#endif
@ -2124,44 +2124,44 @@ static int materialui_list_push(void *data, void *userdata,
if (settings->bools.menu_content_show_netplay)
{
entry.enum_idx = MENU_ENUM_LABEL_NETPLAY;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
#endif
if (settings->bools.menu_show_information)
{
entry.enum_idx = MENU_ENUM_LABEL_INFORMATION_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
#ifndef HAVE_DYNAMIC
entry.enum_idx = MENU_ENUM_LABEL_RESTART_RETROARCH;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
#endif
if (settings->bools.menu_show_configurations)
{
entry.enum_idx = MENU_ENUM_LABEL_CONFIGURATIONS_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
if (settings->bools.menu_show_help)
{
entry.enum_idx = MENU_ENUM_LABEL_HELP_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
#if !defined(IOS)
entry.enum_idx = MENU_ENUM_LABEL_QUIT_RETROARCH;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
#endif
#if defined(HAVE_LAKKA)
if (settings->bools.menu_show_reboot)
{
entry.enum_idx = MENU_ENUM_LABEL_REBOOT;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
if (settings->bools.menu_show_shutdown)
{
entry.enum_idx = MENU_ENUM_LABEL_SHUTDOWN;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
#endif
info->need_push = true;

View File

@ -5309,13 +5309,13 @@ static int xmb_list_push(void *data, void *userdata,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
{
entry.enum_idx = MENU_ENUM_LABEL_CONTENT_SETTINGS;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
if (system->load_no_content)
{
entry.enum_idx = MENU_ENUM_LABEL_START_CORE;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
#ifndef HAVE_DYNAMIC
@ -5325,7 +5325,7 @@ static int xmb_list_push(void *data, void *userdata,
if (settings->bools.menu_show_load_core)
{
entry.enum_idx = MENU_ENUM_LABEL_CORE_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
}
@ -5334,7 +5334,7 @@ static int xmb_list_push(void *data, void *userdata,
const struct retro_subsystem_info* subsystem = NULL;
entry.enum_idx = MENU_ENUM_LABEL_LOAD_CONTENT_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
subsystem = system->subsystem.data;
@ -5390,85 +5390,85 @@ static int xmb_list_push(void *data, void *userdata,
}
entry.enum_idx = MENU_ENUM_LABEL_ADD_CONTENT_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
#ifdef HAVE_QT
if (settings->bools.desktop_menu_enable)
{
entry.enum_idx = MENU_ENUM_LABEL_SHOW_WIMP;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
#endif
#if defined(HAVE_NETWORKING)
if (settings->bools.menu_show_online_updater && !settings->bools.kiosk_mode_enable)
{
entry.enum_idx = MENU_ENUM_LABEL_ONLINE_UPDATER;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
#endif
if (!settings->bools.menu_content_show_settings && !string_is_empty(settings->paths.menu_content_show_settings_password))
{
entry.enum_idx = MENU_ENUM_LABEL_XMB_MAIN_MENU_ENABLE_SETTINGS;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
if (settings->bools.kiosk_mode_enable && !string_is_empty(settings->paths.kiosk_mode_password))
{
entry.enum_idx = MENU_ENUM_LABEL_MENU_DISABLE_KIOSK_MODE;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
if (settings->bools.menu_show_information)
{
entry.enum_idx = MENU_ENUM_LABEL_INFORMATION_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
#ifdef HAVE_LAKKA_SWITCH
entry.enum_idx = MENU_ENUM_LABEL_SWITCH_CPU_PROFILE;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
entry.enum_idx = MENU_ENUM_LABEL_SWITCH_GPU_PROFILE;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
entry.enum_idx = MENU_ENUM_LABEL_SWITCH_BACKLIGHT_CONTROL;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
#endif
#ifndef HAVE_DYNAMIC
entry.enum_idx = MENU_ENUM_LABEL_RESTART_RETROARCH;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
#endif
if (settings->bools.menu_show_configurations && !settings->bools.kiosk_mode_enable)
{
entry.enum_idx = MENU_ENUM_LABEL_CONFIGURATIONS_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
if (settings->bools.menu_show_help)
{
entry.enum_idx = MENU_ENUM_LABEL_HELP_LIST;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
#if !defined(IOS)
if (settings->bools.menu_show_quit_retroarch)
{
entry.enum_idx = MENU_ENUM_LABEL_QUIT_RETROARCH;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
#endif
if (settings->bools.menu_show_reboot)
{
entry.enum_idx = MENU_ENUM_LABEL_REBOOT;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
if (settings->bools.menu_show_shutdown)
{
entry.enum_idx = MENU_ENUM_LABEL_SHUTDOWN;
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
menu_displaylist_setting(&entry);
}
info->need_push = true;

View File

@ -4254,7 +4254,18 @@ void menu_displaylist_info_init(menu_displaylist_info_t *info)
info->setting = NULL;
}
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
bool menu_displaylist_setting(menu_displaylist_ctx_parse_entry_t *entry)
{
if (menu_displaylist_parse_settings_enum(entry->data,
entry->info,
entry->enum_idx,
entry->parse_type,
entry->add_empty_entry) == -1)
return false;
return true;
}
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist_info_t *info)
{
size_t i;
menu_ctx_displaylist_t disp_list;
@ -4263,7 +4274,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
bool use_filebrowser = false;
unsigned count = 0;
int ret = 0;
menu_displaylist_info_t *info = (menu_displaylist_info_t*)data;
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return false;
@ -7391,19 +7401,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
info->need_push = true;
}
break;
case DISPLAYLIST_SETTING_ENUM:
{
menu_displaylist_ctx_parse_entry_t *entry =
(menu_displaylist_ctx_parse_entry_t*)data;
if (menu_displaylist_parse_settings_enum(entry->data,
entry->info,
entry->enum_idx,
entry->parse_type,
entry->add_empty_entry) == -1)
return false;
}
break;
case DISPLAYLIST_HELP:
menu_entries_append_enum(info->list, info->path,
info->label, MSG_UNKNOWN, info->type, info->directory_ptr, 0);

View File

@ -60,7 +60,6 @@ enum menu_displaylist_ctl_state
DISPLAYLIST_HELP_SCREEN_LIST,
DISPLAYLIST_MAIN_MENU,
DISPLAYLIST_GENERIC,
DISPLAYLIST_SETTING_ENUM,
DISPLAYLIST_SETTINGS_ALL,
DISPLAYLIST_HORIZONTAL,
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS,
@ -245,7 +244,9 @@ void menu_displaylist_info_free(menu_displaylist_info_t *info);
void menu_displaylist_info_init(menu_displaylist_info_t *info);
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data);
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist_info_t *info);
bool menu_displaylist_setting(menu_displaylist_ctx_parse_entry_t *entry);
#ifdef HAVE_NETWORKING
void netplay_refresh_rooms_menu(file_list_t *list);