Show 'No settings found.' if screen has no settings

This commit is contained in:
twinaphex 2015-06-21 22:35:19 +02:00
parent e370f3cc97
commit 7a715b322b
3 changed files with 15 additions and 2 deletions

View File

@ -1258,6 +1258,7 @@ static void menu_displaylist_realloc_settings(menu_entries_t *entries, unsigned
static int menu_displaylist_parse_settings(menu_handle_t *menu,
menu_displaylist_info_t *info, unsigned setting_flags)
{
size_t count = 0;
rarch_setting_t *setting = NULL;
settings_t *settings = config_get_ptr();
@ -1287,8 +1288,15 @@ static int menu_displaylist_parse_settings(menu_handle_t *menu,
menu_list_push(info->list, setting->short_description,
setting->name, menu_setting_set_flags(setting), 0, 0);
count++;
}
if (count == 0)
menu_list_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_NO_SETTINGS_FOUND),
menu_hash_to_str(MENU_LABEL_NO_SETTINGS_FOUND),
0, 0, 0);
return 0;
}
@ -1327,8 +1335,6 @@ static int menu_displaylist_parse_settings_in_subgroup(menu_displaylist_info_t *
while (1)
{
if (!info->setting)
return -1;
if (info->setting->type == ST_SUB_GROUP)
{
if ((strlen(info->setting->name) != 0) && !strcmp(info->setting->name, elem1))
@ -1337,6 +1343,7 @@ static int menu_displaylist_parse_settings_in_subgroup(menu_displaylist_info_t *
info->setting++;
}
info->setting++;
for (; info->setting->type != ST_END_SUB_GROUP; info->setting++)

View File

@ -1330,6 +1330,10 @@ static const char *menu_hash_to_str_english(uint32_t hash)
{
switch (hash)
{
case MENU_LABEL_NO_SETTINGS_FOUND:
return "menu_label_no_settings_found";
case MENU_LABEL_VALUE_NO_SETTINGS_FOUND:
return "No settings found.";
case MENU_LABEL_VALUE_NO_PERFORMANCE_COUNTERS:
return "No performance counters.";
case MENU_LABEL_VALUE_DRIVER_SETTINGS:

View File

@ -29,6 +29,8 @@ extern "C" {
#define MENU_VALUE_DIRECTORY_DEFAULT 0xdcc3a2e4U
#define MENU_VALUE_NOT_AVAILABLE 0x0b880503U
#define MENU_LABEL_NO_SETTINGS_FOUND 0xabf77040U
#define MENU_LABEL_VALUE_NO_SETTINGS_FOUND 0xffcc5b5dU
#define MENU_LABEL_VALUE_NO_PERFORMANCE_COUNTERS 0xb4b52b95U
#define MENU_LABEL_VIDEO_FONT_ENABLE 0x697d9b58U