Merge pull request #592 from fr500/master

Added optional flag to firmware
This commit is contained in:
Twinaphex 2014-03-04 01:15:47 +01:00
commit e65261ce0a
3 changed files with 18 additions and 7 deletions

View File

@ -75,12 +75,18 @@ static void core_info_list_resolve_all_firmware(core_info_list_t *core_info_list
for (c = 0; c < count; c++)
{
char path_key[64], desc_key[64];
char path_key[64], desc_key[64], opt_key[64];
snprintf(path_key, sizeof(path_key), "firmware%u_path", c);
snprintf(desc_key, sizeof(desc_key), "firmware%u_desc", c);
snprintf(opt_key, sizeof(opt_key), "firmware%u_opt", c);
config_get_string(info->data, path_key, &info->firmware[c].path);
config_get_string(info->data, desc_key, &info->firmware[c].desc);
config_get_bool(info->data, opt_key , &info->firmware[c].optional);
}
}
}

View File

@ -29,6 +29,7 @@ typedef struct
char *path;
char *desc;
bool missing; // Set once to avoid opening the same file several times.
bool optional;
} core_info_firmware_t;
typedef struct

View File

@ -1950,15 +1950,19 @@ void menu_populate_entries(void *data, unsigned menu_type)
core_info_list_update_missing_firmware(rgui->core_info, rgui->core_info_current.path,
g_settings.system_directory);
file_list_push(rgui->selection_buf, "Required firmware:", RGUI_SETTINGS_CORE_INFO_NONE, 0);
file_list_push(rgui->selection_buf, "Firmware: ", RGUI_SETTINGS_CORE_INFO_NONE, 0);
for (i = 0; i < rgui->core_info_current.firmware_count; i++)
{
if (rgui->core_info_current.firmware[i].desc)
{
snprintf(tmp, sizeof(tmp), " Name: %s, %s",
rgui->core_info_current.firmware[i].desc ? rgui->core_info_current.firmware[i].desc : "",
rgui->core_info_current.firmware[i].missing ? "missing" : "present");
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
{
snprintf(tmp, sizeof(tmp), " name: %s",
rgui->core_info_current.firmware[i].desc ? rgui->core_info_current.firmware[i].desc : "");
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
snprintf(tmp, sizeof(tmp), " status: %s, %s",
rgui->core_info_current.firmware[i].missing ? "missing" : "present",
rgui->core_info_current.firmware[i].optional ? "optional" : "required");
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
}
}
}