diff options
author | Leandro Pereira <leandro@hardinfo.org> | 2012-01-07 17:31:46 -0200 |
---|---|---|
committer | Leandro Pereira <leandro@hardinfo.org> | 2012-01-07 17:33:12 -0200 |
commit | 75848a2ccdcb1985180bf026da3f39405851a6d9 (patch) | |
tree | f9b900ccf034c1b6733b8d5c3aa5f0a07d156ff6 /modules/devices.c | |
parent | b58f976580d40ef6dfa33cc111253e3c549ca049 (diff) |
Show moterboard information in the new summary screen
Diffstat (limited to 'modules/devices.c')
-rw-r--r-- | modules/devices.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/devices.c b/modules/devices.c index 0fd797c0..b7286f8a 100644 --- a/modules/devices.c +++ b/modules/devices.c @@ -180,6 +180,25 @@ gchar *get_memory_total(void) return hi_more_info("Total Memory"); } +gchar *get_motherboard(void) +{ + char *board_name, *board_vendor; + + scan_dmi(FALSE); + + board_name = (gchar *)g_hash_table_lookup(moreinfo, "DMI:Board:Name"); + board_vendor = (gchar *)g_hash_table_lookup(moreinfo, "DMI:Board:Vendor"); + + if (board_name && board_vendor && *board_name && *board_vendor) + return g_strconcat(board_vendor, " ", board_name, NULL); + else if (board_name && *board_name) + return g_strconcat(board_name, " (vendor unknown)", NULL); + else if (board_vendor && *board_vendor) + return g_strconcat(board_vendor, " (model unknown)", NULL); + + return g_strdup("Unknown"); +} + ShellModuleMethod *hi_exported_methods(void) { static ShellModuleMethod m[] = { @@ -191,6 +210,7 @@ ShellModuleMethod *hi_exported_methods(void) {"getPrinters", get_printers}, {"getInputDevices", get_input_devices}, {"getPCIDeviceDescription", get_pci_device_description}, + {"getMotherboard", get_motherboard}, {NULL} }; |