Create DISPLAYLIST_CORE_OPTIONS

This commit is contained in:
twinaphex 2015-05-12 16:24:10 +02:00
parent fb6c7d24fa
commit 5364ff24a9
3 changed files with 36 additions and 25 deletions

View File

@ -585,6 +585,27 @@ int menu_displaylist_parse_horizontal_content_actions(menu_displaylist_info_t *i
return 0;
}
static int menu_displaylist_parse_core_options(menu_displaylist_info_t *info)
{
unsigned i;
global_t *global = global_get_ptr();
if (global->system.core_options)
{
size_t opts = core_option_size(global->system.core_options);
for (i = 0; i < opts; i++)
menu_list_push(info->list,
core_option_get_desc(global->system.core_options, i), "",
MENU_SETTINGS_CORE_OPTION_START + i, 0);
}
else
menu_list_push(info->list, "No options available.", "",
MENU_SETTINGS_CORE_OPTION_NONE, 0);
return 0;
}
int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
{
int ret = 0;
@ -639,6 +660,13 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
if (ret == 0)
need_push = true;
break;
case DISPLAYLIST_CORE_OPTIONS:
menu_list_clear(info->list);
ret = menu_displaylist_parse_core_options(info);
need_push = true;
break;
case DISPLAYLIST_CORES_ALL:
menu_list_clear(info->list);

View File

@ -39,6 +39,7 @@ enum
DISPLAYLIST_CORES_ALL,
DISPLAYLIST_CORES_UPDATER,
DISPLAYLIST_CORES_DETECTED,
DISPLAYLIST_CORE_OPTIONS,
DISPLAYLIST_PERFCOUNTER_SELECTION,
DISPLAYLIST_PERFCOUNTERS_CORE,
DISPLAYLIST_PERFCOUNTERS_FRONTEND,

View File

@ -1658,33 +1658,15 @@ static int deferred_push_core_input_remapping_options(void *data, void *userdata
static int deferred_push_core_options(void *data, void *userdata,
const char *path, const char *label, unsigned type)
{
unsigned i;
file_list_t *list = (file_list_t*)data;
global_t *global = global_get_ptr();
menu_displaylist_info_t info = {0};
(void)userdata;
info.list = (file_list_t*)data;
info.menu_list = (file_list_t*)userdata;
info.type = type;
strlcpy(info.path, path, sizeof(info.path));
strlcpy(info.label, label, sizeof(info.label));
if (!list)
return -1;
menu_list_clear(list);
if (global->system.core_options)
{
size_t opts = core_option_size(global->system.core_options);
for (i = 0; i < opts; i++)
menu_list_push(list,
core_option_get_desc(global->system.core_options, i), "",
MENU_SETTINGS_CORE_OPTION_START + i, 0);
}
else
menu_list_push(list, "No options available.", "",
MENU_SETTINGS_CORE_OPTION_NONE, 0);
menu_driver_populate_entries(path, label, type);
return 0;
return menu_displaylist_push_list(&info, DISPLAYLIST_CORE_OPTIONS);
}
static int deferred_push_disk_options(void *data, void *userdata,