From a863dcdeae53ba1444d4bde519e2912aa4e86311 Mon Sep 17 00:00:00 2001 From: AndresSM Date: Mon, 3 Mar 2014 18:23:56 -0500 Subject: [PATCH] changed the layout of the list and add optional flag for BIOS --- frontend/info/core_info.c | 8 +++++++- frontend/info/core_info.h | 1 + frontend/menu/menu_common.c | 16 ++++++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/frontend/info/core_info.c b/frontend/info/core_info.c index 1d2e263747..ecf15b4a84 100644 --- a/frontend/info/core_info.c +++ b/frontend/info/core_info.c @@ -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); + + } } } diff --git a/frontend/info/core_info.h b/frontend/info/core_info.h index 886493e914..1852bfb35b 100644 --- a/frontend/info/core_info.h +++ b/frontend/info/core_info.h @@ -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 diff --git a/frontend/menu/menu_common.c b/frontend/menu/menu_common.c index 5b29fc0239..e5c307dc3b 100644 --- a/frontend/menu/menu_common.c +++ b/frontend/menu/menu_common.c @@ -1926,6 +1926,7 @@ void menu_populate_entries(void *data, unsigned menu_type) file_list_push(rgui->selection_buf, "No options available.", RGUI_SETTINGS_CORE_OPTION_NONE, 0); break; case RGUI_SETTINGS_CORE_INFO: +<<<<<<< HEAD file_list_clear(rgui->selection_buf); if (rgui->core_info_current.data) { @@ -1950,15 +1951,18 @@ 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); } } }