aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/computer.c
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2006-01-26 19:39:15 +0000
committerLeandro A. F. Pereira <leandro@hardinfo.org>2006-01-26 19:39:15 +0000
commite9906f6d9335ae96cd6afac714646b97edc469a5 (patch)
tree956f3266766454f931e7d18e2fe78a6256d11039 /hardinfo2/computer.c
parent53f455be1d85829551761dbcfcf6e5706606186b (diff)
Sync with internal svn
Diffstat (limited to 'hardinfo2/computer.c')
-rw-r--r--hardinfo2/computer.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/hardinfo2/computer.c b/hardinfo2/computer.c
index 9a721133..36bba973 100644
--- a/hardinfo2/computer.c
+++ b/hardinfo2/computer.c
@@ -40,6 +40,7 @@ enum {
COMPUTER_FILESYSTEMS,
COMPUTER_SHARES,
COMPUTER_DISPLAY,
+ COMPUTER_NETWORK,
/* COMPUTER_LOADGRAPH,*/
} Entries;
@@ -52,6 +53,7 @@ static ModuleEntry hi_entries[] = {
{"Filesystems", "dev_removable.png"},
{"Shared Directories", "shares.png"},
{"Display", "monitor.png"},
+ {"Network Interfaces", "network.png"},
/* {"<s>LoadGraph</s>", "summary.png"}*/
};
@@ -70,6 +72,7 @@ static GHashTable *moreinfo = NULL;
#include <arch/this/filesystem.h>
#include <arch/this/samba.h>
#include <arch/this/sensors.h>
+#include <arch/this/net.h>
static Computer *
computer_get_info(void)
@@ -112,6 +115,9 @@ computer_get_info(void)
shell_status_update("Reading sensors...");
read_sensors();
+ shell_status_update("Obtaining network information...");
+ scan_net_interfaces();
+
computer->date_time = "...";
return computer;
}
@@ -123,6 +129,9 @@ hi_reload(gint entry)
case COMPUTER_FILESYSTEMS:
scan_filesystems();
break;
+ case COMPUTER_NETWORK:
+ scan_net_interfaces();
+ break;
case COMPUTER_SENSORS:
read_sensors();
break;
@@ -183,16 +192,21 @@ hi_info(gint entry)
static Computer *computer = NULL;
static gchar *tmp = NULL;
- if (tmp != NULL) {
+ /*if (tmp != NULL) {
g_free(tmp);
tmp = NULL;
- }
+ } */
if (!computer) {
computer = computer_get_info();
}
switch (entry) {
+ case COMPUTER_NETWORK:
+ return g_strdup_printf("[$ShellParam$]\n"
+ "ReloadInterval=3000\n"
+ "ViewType=1\n"
+ "%s", network_interfaces);
case COMPUTER_SENSORS:
return g_strdup_printf("[$ShellParam$]\n"
"ReloadInterval=3000\n"