diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2008-11-01 11:40:22 -0300 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2008-11-01 11:40:22 -0300 |
commit | a55f29272d61b14872d788ee3de240c081305110 (patch) | |
tree | c941579dc6ce28f2137de09c24d3652f9fdd71ba /hardinfo2 | |
parent | d4c67aee7445dfd55a54b0a7170e2f6c34d04505 (diff) |
Show filesystem's mount point
Diffstat (limited to 'hardinfo2')
-rw-r--r-- | hardinfo2/arch/linux/common/filesystem.h | 4 | ||||
-rw-r--r-- | hardinfo2/computer.c | 5 | ||||
-rw-r--r-- | hardinfo2/shell.c | 28 |
3 files changed, 23 insertions, 14 deletions
diff --git a/hardinfo2/arch/linux/common/filesystem.h b/hardinfo2/arch/linux/common/filesystem.h index 0224e962..6fefd8aa 100644 --- a/hardinfo2/arch/linux/common/filesystem.h +++ b/hardinfo2/arch/linux/common/filesystem.h @@ -93,9 +93,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=%.2f|%s|%s\n", + fs_list = h_strdup_cprintf("$FS%d$%s=%.2f %% (%s of %s)|%s\n", fs_list, - count, tmp[0], use_ratio, strsize, stravail); + count, tmp[0], use_ratio, strsize, stravail, tmp[1]); g_free(strsize); g_free(stravail); diff --git a/hardinfo2/computer.c b/hardinfo2/computer.c index 5c1ae460..3279631b 100644 --- a/hardinfo2/computer.c +++ b/hardinfo2/computer.c @@ -320,9 +320,8 @@ gchar *callback_fs() "ReloadInterval=5000\n" "Zebra=1\n" "NormalizePercentage=false\n" - "ColumnTitle$Extra1=Total\n" - "ColumnTitle$Extra2=Available\n" - "ColumnTitle$Progress=Usage %%\n" + "ColumnTitle$Extra1=Mount Point\n" + "ColumnTitle$Progress=Usage\n" "ColumnTitle$TextValue=Device\n" "ShowColumnHeaders=true\n" "[Mounted File Systems]\n%s\n", fs_list); diff --git a/hardinfo2/shell.c b/hardinfo2/shell.c index 403bae8b..5853fc0a 100644 --- a/hardinfo2/shell.c +++ b/hardinfo2/shell.c @@ -720,6 +720,15 @@ info_tree_compare_val_func(GtkTreeModel * model, static void set_view_type(ShellViewType viewtype) { + if (viewtype == shell->view_type) + return; + + if (viewtype < SHELL_VIEW_NORMAL || viewtype >= SHELL_VIEW_N_VIEWS) + viewtype = SHELL_VIEW_NORMAL; + + shell->normalize_percentage = TRUE; + shell->view_type = viewtype; + /* reset to the default model */ gtk_tree_view_set_model(GTK_TREE_VIEW(shell->info->view), shell->info->model); @@ -736,14 +745,6 @@ static void set_view_type(ShellViewType viewtype) /* turn off the save graphic action */ shell_action_set_enabled("SaveGraphAction", FALSE); - if (viewtype == shell->view_type) - return; - - if (viewtype < SHELL_VIEW_NORMAL || viewtype >= SHELL_VIEW_N_VIEWS) - viewtype = SHELL_VIEW_NORMAL; - - shell->normalize_percentage = TRUE; - shell->view_type = viewtype; switch (viewtype) { default: @@ -1033,8 +1034,11 @@ static void update_progress() /* fix the maximum relative percentage */ iter = fiter; do { + char *strval; + gtk_tree_model_get(model, &iter, INFO_TREE_COL_VALUE, &tmp, -1); floatval = atof(tmp); + strval = g_strdup(tmp); g_free(tmp); cur = 100 * floatval / maxv; @@ -1042,11 +1046,17 @@ static void update_progress() if (shell->_order_type == SHELL_ORDER_ASCENDING) cur = 100 - cur + maxp; - tmp = g_strdup_printf("%.2f", floatval); + if (strchr(strval, ' ')) { + tmp = g_strdup_printf("%.2f%s", floatval, strchr(strval, ' ')); + } else { + tmp = g_strdup_printf("%.2f", floatval); + } + tmp = strreplace(tmp, ",", '.'); gtk_tree_store_set(store, &iter, INFO_TREE_COL_PROGRESS, cur, INFO_TREE_COL_VALUE, tmp, -1); g_free(tmp); + g_free(strval); } while (gtk_tree_model_iter_next(model, &iter)); /* now sort everything up. that wasn't as hard as i thought :) */ |