aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/shell.c
diff options
context:
space:
mode:
author05356787 <05356787@localhost.localdomain>2008-10-31 13:10:02 -0200
committer05356787 <05356787@localhost.localdomain>2008-10-31 13:10:02 -0200
commit7608bb025507f0beb235abb5e1ef7ad84148892c (patch)
treefe39c998415fe91f5d3cb1437fc781ed9cae1658 /hardinfo2/shell.c
parent1d2c77e7e1b4c3fcbc6a36dd89fe3287c324e032 (diff)
Add filesystem usage bars
Diffstat (limited to 'hardinfo2/shell.c')
-rw-r--r--hardinfo2/shell.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/hardinfo2/shell.c b/hardinfo2/shell.c
index 23ba2ad7..3c5a5198 100644
--- a/hardinfo2/shell.c
+++ b/hardinfo2/shell.c
@@ -742,6 +742,7 @@ static void set_view_type(ShellViewType viewtype)
if (viewtype < SHELL_VIEW_NORMAL || viewtype >= SHELL_VIEW_N_VIEWS)
viewtype = SHELL_VIEW_NORMAL;
+ shell->normalize_percentage = TRUE;
shell->view_type = viewtype;
switch (viewtype) {
@@ -762,11 +763,17 @@ static void set_view_type(ShellViewType viewtype)
shell->hpaned->allocation.height -
shell->loadgraph->height - 16);
break;
+ case SHELL_VIEW_PROGRESS_DUAL:
+ gtk_notebook_set_page(GTK_NOTEBOOK(shell->notebook), 0);
+ gtk_widget_show(shell->notebook);
+ /* fallthrough */
case SHELL_VIEW_PROGRESS:
shell_action_set_enabled("SaveGraphAction", TRUE);
gtk_tree_view_column_set_visible(shell->info->col_progress, TRUE);
gtk_tree_view_column_set_visible(shell->info->col_value, FALSE);
- gtk_widget_hide(shell->notebook);
+
+ if (viewtype == SHELL_VIEW_PROGRESS)
+ gtk_widget_hide(shell->notebook);
break;
}
}
@@ -797,6 +804,8 @@ group_handle_special(GKeyFile * key_file, ShellModuleEntry * entry,
sfutbl->sfu = fu;
update_sfusrc = g_slist_prepend(update_sfusrc, sfutbl);
+ } else if (g_str_equal(key, "NormalizePercentage")) {
+ shell->normalize_percentage = g_key_file_get_boolean(key_file, group, key, NULL);
} else if (g_str_equal(key, "LoadGraphSuffix")) {
gchar *suffix =
g_key_file_get_value(key_file, group, key, NULL);
@@ -992,15 +1001,19 @@ static void update_progress()
gtk_tree_model_get_iter_first(model, &fiter);
/* finds the maximum value */
- iter = fiter;
- do {
- gtk_tree_model_get(model, &iter, INFO_TREE_COL_VALUE, &tmp, -1);
-
- cur = atof(tmp);
- maxv = MAX(maxv, cur);
-
- g_free(tmp);
- } while (gtk_tree_model_iter_next(model, &iter));
+ if (shell->normalize_percentage) {
+ iter = fiter;
+ do {
+ gtk_tree_model_get(model, &iter, INFO_TREE_COL_VALUE, &tmp, -1);
+
+ cur = atof(tmp);
+ maxv = MAX(maxv, cur);
+
+ g_free(tmp);
+ } while (gtk_tree_model_iter_next(model, &iter));
+ } else {
+ maxv = 100.0f;
+ }
/* calculates the relative percentage and finds the maximum percentage */
if (shell->_order_type == SHELL_ORDER_ASCENDING) {
@@ -1147,7 +1160,7 @@ module_selected_show_info(ShellModuleEntry * entry, gboolean reload)
gdk_window_thaw_updates(shell->info->view->window);
shell_set_note_from_entry(entry);
- if (shell->view_type == SHELL_VIEW_PROGRESS) {
+ if (shell->view_type == SHELL_VIEW_PROGRESS || shell->view_type == SHELL_VIEW_PROGRESS_DUAL) {
update_progress();
}