aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2008-10-30 19:46:50 -0300
committerLeandro A. F. Pereira <leandro@hardinfo.org>2008-10-30 19:46:50 -0300
commit69268767f3055cb6e1548459185c2617ef7977f6 (patch)
tree347ec46bbd08c804c84d0fd7523916134cf2af00 /hardinfo2
parent8914b84d5db87443b311a9646c9c93ea2b4f2c27 (diff)
parent1d2c77e7e1b4c3fcbc6a36dd89fe3287c324e032 (diff)
Merge branch 'master' of git@github.com:lpereira/hardinfo
Diffstat (limited to 'hardinfo2')
-rw-r--r--hardinfo2/arch/common/cryptohash.h (renamed from hardinfo2/arch/common/md5.h)65
-rw-r--r--hardinfo2/arch/common/sha1.h62
-rw-r--r--hardinfo2/arch/linux/alpha/processor.h3
-rw-r--r--hardinfo2/arch/linux/armv4l/processor.h4
-rw-r--r--hardinfo2/arch/linux/common/filesystem.h4
-rw-r--r--hardinfo2/arch/linux/common/net.h13
-rw-r--r--hardinfo2/arch/linux/ia64/processor.h4
-rw-r--r--hardinfo2/arch/linux/s390/processor.h4
-rw-r--r--hardinfo2/arch/linux/sparc/processor.h3
-rw-r--r--hardinfo2/benchmark.c74
-rw-r--r--hardinfo2/computer.c8
-rw-r--r--hardinfo2/devices.c16
-rw-r--r--hardinfo2/shell.c58
13 files changed, 153 insertions, 165 deletions
diff --git a/hardinfo2/arch/common/md5.h b/hardinfo2/arch/common/cryptohash.h
index d839778a..9897bb6b 100644
--- a/hardinfo2/arch/common/md5.h
+++ b/hardinfo2/arch/common/cryptohash.h
@@ -17,21 +17,48 @@
*/
#include <md5.h>
+#include <sha1.h>
-static void
-benchmark_md5(void)
+static void inline md5_step(char *data, glong srclen)
{
struct MD5Context ctx;
guchar checksum[16];
- int i;
- GTimer *timer = g_timer_new();
- gdouble elapsed = 0;
- gchar src[65536], *tmpsrc;
- glong srclen = 65536;
+
+ MD5Init(&ctx);
+ MD5Update(&ctx, (guchar *)data, srclen);
+ MD5Final(checksum, &ctx);
+}
- tmpsrc = src;
+static void inline sha1_step(char *data, glong srclen)
+{
+ SHA1_CTX ctx;
+ guchar checksum[20];
+
+ SHA1Init(&ctx);
+ SHA1Update(&ctx, (guchar*)data, srclen);
+ SHA1Final(checksum, &ctx);
+}
- gchar *bdata_path;
+static gpointer cryptohash_for(unsigned int start, unsigned int end, void *data, GTimer *timer)
+{
+ unsigned int i;
+
+ for (i = start; i <= end; i++) {
+ if (i % 2 == 0) {
+ md5_step(data, 65536);
+ } else {
+ sha1_step(data, 65536);
+ }
+ }
+
+ return NULL;
+}
+
+static void
+benchmark_cryptohash(void)
+{
+ gdouble elapsed = 0;
+ gchar *tmpsrc, *bdata_path;
bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL);
if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) {
@@ -40,24 +67,12 @@ benchmark_md5(void)
}
shell_view_set_enabled(FALSE);
- shell_status_update("Generating MD5 sum for 312MiB of data...");
-
- for (i = 0; i <= 5000; i++) {
- g_timer_start(timer);
-
- MD5Init(&ctx);
- MD5Update(&ctx, (guchar*)tmpsrc, srclen);
- MD5Final(checksum, &ctx);
-
- g_timer_stop(timer);
- elapsed += g_timer_elapsed(timer, NULL);
+ shell_status_update("Running CryptoHash benchmark...");
- shell_status_set_percentage(i/50);
- }
+ elapsed = benchmark_parallel_for(0, 5000, cryptohash_for, tmpsrc);
- g_timer_destroy(timer);
g_free(bdata_path);
+ g_free(tmpsrc);
- bench_results[BENCHMARK_MD5] = 312.0 / elapsed;
+ bench_results[BENCHMARK_CRYPTOHASH] = 312.0 / elapsed;
}
-
diff --git a/hardinfo2/arch/common/sha1.h b/hardinfo2/arch/common/sha1.h
deleted file mode 100644
index c506375b..00000000
--- a/hardinfo2/arch/common/sha1.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * HardInfo - Displays System Information
- * Copyright (C) 2003-2007 Leandro A. F. Pereira <leandro@hardinfo.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 2.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#include <sha1.h>
-
-static void
-benchmark_sha1(void)
-{
- SHA1_CTX ctx;
- guchar checksum[20];
- int i;
- GTimer *timer = g_timer_new();
- gdouble elapsed = 0;
- gchar src[65536], *tmpsrc;
- glong srclen = 65536;
-
- tmpsrc = src;
-
- gchar *bdata_path;
-
- bdata_path = g_build_filename(params.path_data, "benchmark.data", NULL);
- if (!g_file_get_contents(bdata_path, &tmpsrc, NULL, NULL)) {
- g_free(bdata_path);
- return;
- }
-
- shell_view_set_enabled(FALSE);
- shell_status_update("Generating SHA1 sum for 312MiB of data...");
-
- for (i = 0; i <= 5000; i++) {
- g_timer_start(timer);
-
- SHA1Init(&ctx);
- SHA1Update(&ctx, (guchar*)tmpsrc, srclen);
- SHA1Final(checksum, &ctx);
-
- g_timer_stop(timer);
- elapsed += g_timer_elapsed(timer, NULL);
-
- shell_status_set_percentage(i/50);
- }
-
- g_timer_destroy(timer);
- g_free(bdata_path);
-
- bench_results[BENCHMARK_SHA1] = 312.0 / elapsed;
-}
-
diff --git a/hardinfo2/arch/linux/alpha/processor.h b/hardinfo2/arch/linux/alpha/processor.h
index e6013103..1e5b014c 100644
--- a/hardinfo2/arch/linux/alpha/processor.h
+++ b/hardinfo2/arch/linux/alpha/processor.h
@@ -18,7 +18,7 @@
struct _Processor {
gchar *model_name;
- gfloat bogomips;
+ gfloat bogomips, cpu_mhz;
gchar *strmodel;
};
@@ -52,6 +52,7 @@ __scan_processors(void)
gchar *tmp = g_strconcat("Alpha ", processor->model_name, NULL);
g_free(processor->model_name);
processor->model_name = tmp;
+ processor->cpu_mhz = 0.0f;
fclose(cpuinfo);
diff --git a/hardinfo2/arch/linux/armv4l/processor.h b/hardinfo2/arch/linux/armv4l/processor.h
index b64fd5eb..82b6be04 100644
--- a/hardinfo2/arch/linux/armv4l/processor.h
+++ b/hardinfo2/arch/linux/armv4l/processor.h
@@ -19,7 +19,7 @@
struct _Processor {
gchar *model_name;
gchar *flags;
- gfloat bogomips;
+ gfloat bogomips, cpu_mhz;
gchar *has_fpu;
};
@@ -53,6 +53,8 @@ __scan_processors(void)
g_strfreev(tmp);
}
+ processor->cpu_mhz = 0.0f;
+
fclose(cpuinfo);
return g_slist_append(NULL, processor);
diff --git a/hardinfo2/arch/linux/common/filesystem.h b/hardinfo2/arch/linux/common/filesystem.h
index 3581ccbb..b3008387 100644
--- a/hardinfo2/arch/linux/common/filesystem.h
+++ b/hardinfo2/arch/linux/common/filesystem.h
@@ -81,9 +81,9 @@ scan_filesystems(void)
stravail);
g_hash_table_insert(moreinfo, g_strdup_printf("FS%d", ++count), strhash);
- fs_list = h_strdup_cprintf("$FS%d$%s=%s total, %s free\n",
+ fs_list = h_strdup_cprintf("$FS%d$%s=%s|%s\n",
fs_list,
- count, tmp[0], strsize, stravail);
+ count, tmp[0], stravail, strsize);
g_free(strsize);
g_free(stravail);
diff --git a/hardinfo2/arch/linux/common/net.h b/hardinfo2/arch/linux/common/net.h
index de978ee1..8c083a9e 100644
--- a/hardinfo2/arch/linux/common/net.h
+++ b/hardinfo2/arch/linux/common/net.h
@@ -314,7 +314,7 @@ static void scan_net_interfaces_24(void)
gint trash;
gchar ifacename[16];
gchar *buf = buffer;
- gchar *iface_type, *iface_icon, *ip;
+ gchar *iface_type, *iface_icon;
gint i;
buf = g_strstrip(buf);
@@ -340,16 +340,13 @@ static void scan_net_interfaces_24(void)
devid = g_strdup_printf("NET%s", ifacename);
- ip = g_strdup_printf(" (%s)", ni.ip);
network_interfaces =
h_strdup_cprintf
- ("$%s$%s=Sent %.2lfMiB, received %.2lfMiB%s\n",
- network_interfaces, devid, ifacename, trans_mb, recv_mb,
- ni.ip[0] ? ip : "");
- g_free(ip);
-
+ ("$%s$%s=%s|Sent %.2lfMiB, received %.2lfMiB\n",
+ network_interfaces, devid, ifacename, ni.ip[0] ? ni.ip : "",
+ trans_mb, recv_mb);
net_get_iface_type(ifacename, &iface_type, &iface_icon, &ni);
-
+
network_icons = h_strdup_cprintf("Icon$%s$%s=%s.png\n",
network_icons, devid,
ifacename, iface_icon);
diff --git a/hardinfo2/arch/linux/ia64/processor.h b/hardinfo2/arch/linux/ia64/processor.h
index d5e01776..d3d41519 100644
--- a/hardinfo2/arch/linux/ia64/processor.h
+++ b/hardinfo2/arch/linux/ia64/processor.h
@@ -19,7 +19,7 @@
struct _Processor {
gchar *model_name;
gchar *vendor_id;
- gfloat bogomips;
+ gfloat bogomips, cpu_mhz;
gchar *strmodel;
};
@@ -50,6 +50,8 @@ __scan_processors(void)
}
g_strfreev(tmp);
}
+
+ processor->cpu_mhz = 0.0f;
fclose(cpuinfo);
diff --git a/hardinfo2/arch/linux/s390/processor.h b/hardinfo2/arch/linux/s390/processor.h
index 1550d239..25dab8ca 100644
--- a/hardinfo2/arch/linux/s390/processor.h
+++ b/hardinfo2/arch/linux/s390/processor.h
@@ -19,7 +19,7 @@
struct _Processor {
gchar *vendor_id, *model_name;
gint cache_size;
- gfloat bogomips;
+ gfloat bogomips, cpu_mhz;
};
static GSList *
@@ -48,6 +48,8 @@ __scan_processors(void)
}
g_strfreev(tmp);
}
+
+ processor->cpu_mhz = 0.0f;
processor->model_name = g_strconcat("S390 ", processor->vendor_id, NULL);
g_free(processor->vendor_id);
diff --git a/hardinfo2/arch/linux/sparc/processor.h b/hardinfo2/arch/linux/sparc/processor.h
index 3bbea922..0272c963 100644
--- a/hardinfo2/arch/linux/sparc/processor.h
+++ b/hardinfo2/arch/linux/sparc/processor.h
@@ -19,6 +19,7 @@
struct _Processor {
gchar *model_name;
gchar *has_fpu;
+ gfloat cpu_mhz;
};
static GSList *
@@ -48,6 +49,8 @@ __scan_processors(void)
fclose(cpuinfo);
+ processor->cpu_mhz = 0.0f;
+
return g_slist_append(NULL, processor);
}
diff --git a/hardinfo2/benchmark.c b/hardinfo2/benchmark.c
index 1c756202..746ec12d 100644
--- a/hardinfo2/benchmark.c
+++ b/hardinfo2/benchmark.c
@@ -28,8 +28,7 @@
enum {
BENCHMARK_ZLIB,
BENCHMARK_FIB,
- BENCHMARK_MD5,
- BENCHMARK_SHA1,
+ BENCHMARK_CRYPTOHASH,
BENCHMARK_BLOWFISH,
BENCHMARK_RAYTRACE,
BENCHMARK_N_ENTRIES
@@ -38,22 +37,19 @@ enum {
void scan_zlib(gboolean reload);
void scan_raytr(gboolean reload);
void scan_bfsh(gboolean reload);
-void scan_md5(gboolean reload);
+void scan_cryptohash(gboolean reload);
void scan_fib(gboolean reload);
-void scan_sha1(gboolean reload);
gchar *callback_zlib();
gchar *callback_raytr();
gchar *callback_bfsh();
-gchar *callback_md5();
gchar *callback_fib();
-gchar *callback_sha1();
+gchar *callback_cryptohash();
static ModuleEntry entries[] = {
{"CPU ZLib", "compress.png", callback_zlib, scan_zlib},
{"CPU Fibonacci", "module.png", callback_fib, scan_fib},
- {"CPU MD5", "module.png", callback_md5, scan_md5},
- {"CPU SHA1", "module.png", callback_sha1, scan_sha1},
+ {"CPU CryptoHash", "module.png", callback_cryptohash, scan_cryptohash},
{"CPU Blowfish", "blowfish.png", callback_bfsh, scan_bfsh},
{"FPU Raytracing", "raytrace.png", callback_raytr, scan_raytr},
{NULL}
@@ -150,7 +146,7 @@ static gchar *__benchmark_include_results(gdouble result,
{
GKeyFile *conf;
gchar **machines;
- gchar *path, *results = g_strdup("");
+ gchar *path, *results = g_strdup(""), *return_value, *processor_frequency;
int i;
conf = g_key_file_new();
@@ -178,22 +174,25 @@ static gchar *__benchmark_include_results(gdouble result,
g_free(path);
g_key_file_free(conf);
- DEBUG("results = %s", results);
-
- return g_strdup_printf("[$ShellParam$]\n"
- "Zebra=1\n"
- "OrderType=%d\n"
- "ViewType=3\n"
- "ColumnTitle$Extra1=CPU Clock\n"
- "ColumnTitle$Extra2=Memory\n"
- "ColumnTitle$Progress=Results\n"
- "ColumnTitle$TextValue=CPU\n"
- "ShowColumnHeaders=true\n"
- "[%s]\n"
- "<big><b>This Machine</b></big>=%.3f\n"
- "%s", order_type, benchmark, result, results);
+ processor_frequency = module_call_method("devices::getProcessorFrequency");
+ return_value = g_strdup_printf("[$ShellParam$]\n"
+ "Zebra=1\n"
+ "OrderType=%d\n"
+ "ViewType=3\n"
+ "ColumnTitle$Extra1=CPU Clock\n"
+ "ColumnTitle$Extra2=Memory\n"
+ "ColumnTitle$Progress=Results\n"
+ "ColumnTitle$TextValue=CPU\n"
+ "ShowColumnHeaders=true\n"
+ "[%s]\n"
+ "<big><b>This Machine</b></big>=%.3f|%s MHz|extra2\n"
+ "%s", order_type, benchmark, result, processor_frequency, results);
+ g_free(processor_frequency);
+ return return_value;
}
+
+
static gchar *benchmark_include_results_reverse(gdouble result,
const gchar * benchmark)
{
@@ -212,8 +211,7 @@ static gdouble bench_results[BENCHMARK_N_ENTRIES];
#include <arch/common/fib.h>
#include <arch/common/zlib.h>
-#include <arch/common/md5.h>
-#include <arch/common/sha1.h>
+#include <arch/common/cryptohash.h>
#include <arch/common/blowfish.h>
#include <arch/common/raytrace.h>
@@ -235,10 +233,10 @@ gchar *callback_bfsh()
"CPU Blowfish");
}
-gchar *callback_md5()
+gchar *callback_cryptohash()
{
- return benchmark_include_results_reverse(bench_results[BENCHMARK_MD5],
- "CPU MD5");
+ return benchmark_include_results_reverse(bench_results[BENCHMARK_CRYPTOHASH],
+ "CPU Cryptohash");
}
gchar *callback_fib()
@@ -247,12 +245,6 @@ gchar *callback_fib()
"CPU Fibonacci");
}
-gchar *callback_sha1()
-{
- return benchmark_include_results_reverse(bench_results[BENCHMARK_SHA1],
- "CPU SHA1");
-}
-
#define RUN_WITH_HIGH_PRIORITY(fn) \
do { \
int old_priority = getpriority(PRIO_PROCESS, 0); \
@@ -282,10 +274,10 @@ void scan_bfsh(gboolean reload)
SCAN_END();
}
-void scan_md5(gboolean reload)
+void scan_cryptohash(gboolean reload)
{
SCAN_START();
- RUN_WITH_HIGH_PRIORITY(benchmark_md5);
+ RUN_WITH_HIGH_PRIORITY(benchmark_cryptohash);
SCAN_END();
}
@@ -296,21 +288,13 @@ void scan_fib(gboolean reload)
SCAN_END();
}
-void scan_sha1(gboolean reload)
-{
- SCAN_START();
- RUN_WITH_HIGH_PRIORITY(benchmark_sha1);
- SCAN_END();
-}
-
const gchar *hi_note_func(gint entry)
{
switch (entry) {
case BENCHMARK_ZLIB:
return "Results in KiB/second. Higher is better.";
- case BENCHMARK_MD5:
- case BENCHMARK_SHA1:
+ case BENCHMARK_CRYPTOHASH:
return "Results in MiB/second. Higher is better.";
case BENCHMARK_RAYTRACE:
diff --git a/hardinfo2/computer.c b/hardinfo2/computer.c
index 84e87610..f51fdb36 100644
--- a/hardinfo2/computer.c
+++ b/hardinfo2/computer.c
@@ -315,8 +315,9 @@ gchar *callback_fs()
return g_strdup_printf("[$ShellParam$]\n"
"ViewType=1\n"
"ReloadInterval=5000\n"
- "ColumnTitle$TextValue=Mount Point\n"
- "ColumnTitle$Value=Total / Free Space\n"
+ "ColumnTitle$TextValue=Device\n"
+ "ColumnTitle$Value=Free\n"
+ "ColumnTitle$Extra1=Total\n"
"ShowColumnHeaders=true\n"
"[Mounted File Systems]\n%s\n", fs_list);
}
@@ -363,7 +364,8 @@ gchar *callback_network()
"ReloadInterval=3000\n"
"ViewType=1\n"
"ColumnTitle$TextValue=Device\n"
- "ColumnTitle$Value=Statistics\n"
+ "ColumnTitle$Value=IP Address\n"
+ "ColumnTitle$Extra1=Statistics\n"
"ShowColumnHeaders=true\n"
"%s", network_interfaces, network_icons);
}
diff --git a/hardinfo2/devices.c b/hardinfo2/devices.c
index e4a2fa7b..0e76a50a 100644
--- a/hardinfo2/devices.c
+++ b/hardinfo2/devices.c
@@ -168,9 +168,24 @@ gchar *get_input_devices(void)
gchar *get_processor_count(void)
{
scan_processors(FALSE);
+
return g_strdup_printf("%d", g_slist_length(processors));
}
+gchar *get_processor_frequency(void)
+{
+ Processor *p;
+
+ scan_processors(FALSE);
+
+ p = (Processor *)processors->data;
+ if (p->cpu_mhz == 0.0f) {
+ return g_strdup("Unknown");
+ } else {
+ return g_strdup_printf("%.0f", p->cpu_mhz);
+ }
+}
+
gchar *get_pci_device_description(gchar *pci_id)
{
gchar *description;
@@ -191,6 +206,7 @@ ShellModuleMethod *hi_exported_methods(void)
static ShellModuleMethod m[] = {
{"getProcessorCount", get_processor_count},
{"getProcessorName", get_processor_name},
+ {"getProcessorFrequency", get_processor_frequency},
{"getStorageDevices", get_storage_devices},
{"getPrinters", get_printers},
{"getInputDevices", get_input_devices},
diff --git a/hardinfo2/shell.c b/hardinfo2/shell.c
index 7487bf13..23ba2ad7 100644
--- a/hardinfo2/shell.c
+++ b/hardinfo2/shell.c
@@ -724,9 +724,6 @@ static void set_view_type(ShellViewType viewtype)
gtk_tree_view_set_model(GTK_TREE_VIEW(shell->info->view),
shell->info->model);
- /* reset to the default header values */
- gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(shell->info->view), FALSE);
-
/* reset to the default view columns */
gtk_tree_view_column_set_visible(shell->info->col_extra1, FALSE);
gtk_tree_view_column_set_visible(shell->info->col_extra2, FALSE);
@@ -779,6 +776,7 @@ group_handle_special(GKeyFile * key_file, ShellModuleEntry * entry,
gchar * group, gchar ** keys)
{
if (g_str_equal(group, "$ShellParam$")) {
+ gboolean headers_visible = FALSE;
gint i;
for (i = 0; keys[i]; i++) {
@@ -817,11 +815,7 @@ group_handle_special(GKeyFile * key_file, ShellModuleEntry * entry,
g_timeout_add(ms, rescan_section, entry);
} else if (g_str_equal(key, "ShowColumnHeaders")) {
- gboolean show;
-
- show = g_key_file_get_boolean(key_file, group, key, NULL);
-
- gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(shell->info->view), show);
+ headers_visible = g_key_file_get_boolean(key_file, group, key, NULL);
} else if (g_str_has_prefix(key, "ColumnTitle")) {
GtkTreeViewColumn *column;
gchar *value, *title = strchr(key, '$') + 1;
@@ -874,6 +868,8 @@ group_handle_special(GKeyFile * key_file, ShellModuleEntry * entry,
(key_file, group, key, NULL));
}
}
+
+ gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(shell->info->view), headers_visible);
} else {
g_warning("Unknown parameter group: ``%s''", group);
}
@@ -907,16 +903,28 @@ group_handle_normal(GKeyFile * key_file, ShellModuleEntry * entry,
value = entry->fieldfunc(key);
}
- if ((key && value) &&
- g_utf8_validate(key, -1, NULL)
- && g_utf8_validate(value, -1, NULL)) {
+ if ((key && value) && g_utf8_validate(key, -1, NULL) && g_utf8_validate(value, -1, NULL)) {
if (ngroups == 1) {
gtk_tree_store_append(store, &child, NULL);
} else {
gtk_tree_store_append(store, &child, &parent);
}
- gtk_tree_store_set(store, &child, INFO_TREE_COL_VALUE, value,
- -1);
+
+ if (strchr(value, '|')) {
+ gchar **columns = g_strsplit(value, "|", 0);
+
+ gtk_tree_store_set(store, &child, INFO_TREE_COL_VALUE, columns[0], -1);
+ if (columns[1]) {
+ gtk_tree_store_set(store, &child, INFO_TREE_COL_EXTRA1, columns[1], -1);
+ if (columns[2]) {
+ gtk_tree_store_set(store, &child, INFO_TREE_COL_EXTRA2, columns[2], -1);
+ }
+ }
+
+ g_strfreev(columns);
+ } else {
+ gtk_tree_store_set(store, &child, INFO_TREE_COL_VALUE, value, -1);
+ }
strend(key, '#');
@@ -1062,12 +1070,19 @@ module_selected_show_info(ShellModuleEntry * entry, gboolean reload)
GKeyFile *key_file = g_key_file_new();
GtkTreeStore *store;
gchar *key_data, **groups;
+ gboolean has_shell_param = FALSE;
gint i;
gsize ngroups;
module_entry_scan(entry);
key_data = module_entry_function(entry);
+ /* */
+ gdk_window_freeze_updates(shell->info->view->window);
+
+ g_object_ref(shell->info->model);
+ gtk_tree_view_set_model(GTK_TREE_VIEW(shell->info->view), NULL);
+
/* reset the view type to normal */
set_view_type(SHELL_VIEW_NORMAL);
@@ -1094,6 +1109,7 @@ module_selected_show_info(ShellModuleEntry * entry, gboolean reload)
}
store = GTK_TREE_STORE(shell->info->model);
+
gtk_tree_store_clear(store);
g_key_file_load_from_data(key_file, key_data, strlen(key_data), 0,
@@ -1110,21 +1126,31 @@ module_selected_show_info(ShellModuleEntry * entry, gboolean reload)
if (*group == '$') {
group_handle_special(key_file, entry, group, keys);
+ has_shell_param = TRUE;
} else {
group_handle_normal(key_file, entry, group, keys, ngroups);
}
g_strfreev(keys);
}
-
+
+ /* */
+ if (!has_shell_param) {
+ gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(shell->info->view), FALSE);
+ }
+
+ /* */
+ g_object_unref(shell->info->model);
+ gtk_tree_view_set_model(GTK_TREE_VIEW(shell->info->view), shell->info->model);
gtk_tree_view_expand_all(GTK_TREE_VIEW(shell->info->view));
+ gdk_window_thaw_updates(shell->info->view->window);
+ shell_set_note_from_entry(entry);
+
if (shell->view_type == SHELL_VIEW_PROGRESS) {
update_progress();
}
- shell_set_note_from_entry(entry);
-
g_strfreev(groups);
g_key_file_free(key_file);
g_free(key_data);