[gnome-system-monitor] GsmTreeView: automatically hide excluded columns
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor] GsmTreeView: automatically hide excluded columns
- Date: Tue, 13 Aug 2013 13:57:25 +0000 (UTC)
commit 88554cef9afcf6a4b46a1a40518378e05e829a16
Author: Stefano Facchini <stefano facchini gmail com>
Date: Tue Aug 13 15:45:55 2013 +0200
GsmTreeView: automatically hide excluded columns
src/proctable.cpp | 24 ++----------------------
src/treeview.c | 4 +++-
2 files changed, 5 insertions(+), 23 deletions(-)
---
diff --git a/src/proctable.cpp b/src/proctable.cpp
index 2decae3..14c908a 100644
--- a/src/proctable.cpp
+++ b/src/proctable.cpp
@@ -545,10 +545,9 @@ proctable_new (GsmApplication * const app)
gsm_tree_view_add_excluded_column (GSM_TREE_VIEW (proctree), COL_CGROUP);
#ifdef HAVE_SYSTEMD
- if (!LOGIND_RUNNING ()) {
-#else
- {
+ if (!LOGIND_RUNNING ())
#endif
+ {
gsm_tree_view_add_excluded_column (GSM_TREE_VIEW (proctree), COL_UNIT);
gsm_tree_view_add_excluded_column (GSM_TREE_VIEW (proctree), COL_SESSION);
gsm_tree_view_add_excluded_column (GSM_TREE_VIEW (proctree), COL_SEAT);
@@ -564,27 +563,8 @@ proctable_new (GsmApplication * const app)
gtk_tree_view_column_set_visible (column, FALSE);
}
- if (!cgroups_enabled()) {
- GtkTreeViewColumn *column;
-
- column = gsm_tree_view_get_column_from_id (GSM_TREE_VIEW(proctree), COL_CGROUP);
- gtk_tree_view_column_set_visible(column, FALSE);
- }
-
GtkIconTheme* theme = gtk_icon_theme_get_default();
g_signal_connect(G_OBJECT (theme), "changed", G_CALLBACK (cb_refresh_icons), app);
-
-#ifdef HAVE_SYSTEMD
- if (!LOGIND_RUNNING())
-#endif
- {
- GtkTreeViewColumn *column;
-
- for (i = COL_UNIT; i <= COL_OWNER; i++) {
- column = gsm_tree_view_get_column_from_id (GSM_TREE_VIEW(proctree), i);
- gtk_tree_view_column_set_visible(column, FALSE);
- }
- }
app->selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (proctree));
gtk_tree_selection_set_mode (app->selection, GTK_SELECTION_MULTIPLE);
diff --git a/src/treeview.c b/src/treeview.c
index 119a31b..a0e5dcd 100644
--- a/src/treeview.c
+++ b/src/treeview.c
@@ -153,8 +153,10 @@ gsm_tree_view_load_state (GsmTreeView *tree_view)
sort_id = gtk_tree_view_column_get_sort_column_id (col);
if (priv->excluded_columns &&
- g_hash_table_contains (priv->excluded_columns, GINT_TO_POINTER (sort_id)))
+ g_hash_table_contains (priv->excluded_columns, GINT_TO_POINTER (sort_id))) {
+ gtk_tree_view_column_set_visible (col, FALSE);
continue;
+ }
title = gtk_tree_view_column_get_title (col);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]