summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-18 20:32:53 +0100
committerinfirit <[email protected]>2014-12-18 20:32:53 +0100
commit396b01dc3e3a704c0015874002b76a5ccda0678a (patch)
treec5ad54e47abb876023d3e5550aad1cc80d3be6ff /src
parentdb877ef14b15c2c2f8572954589fc81fcf6d8626 (diff)
downloadmate-system-monitor-396b01dc3e3a704c0015874002b76a5ccda0678a.tar.bz2
mate-system-monitor-396b01dc3e3a704c0015874002b76a5ccda0678a.tar.xz
Save sort column and order when they change
Taken from GSM commit: 5b836afa87a27691f008a26bba9e3829d2b31be6 From: Stefano Facchini <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=649398
Diffstat (limited to 'src')
-rw-r--r--src/procman.cpp3
-rw-r--r--src/proctable.cpp13
2 files changed, 13 insertions, 3 deletions
diff --git a/src/procman.cpp b/src/procman.cpp
index 6e99dc8..6f4057e 100644
--- a/src/procman.cpp
+++ b/src/procman.cpp
@@ -518,9 +518,6 @@ procman_save_config (ProcData *data)
g_assert(data);
- procman_save_tree_state (data->settings, data->tree, "proctree");
- procman_save_tree_state (data->settings, data->disk_list, "disktreenew");
-
data->config.width = gdk_window_get_width(gtk_widget_get_window(data->app));
data->config.height = gdk_window_get_height(gtk_widget_get_window(data->app));
gtk_window_get_position(GTK_WINDOW(data->app), &data->config.xpos, &data->config.ypos);
diff --git a/src/proctable.cpp b/src/proctable.cpp
index 686ca45..6824124 100644
--- a/src/proctable.cpp
+++ b/src/proctable.cpp
@@ -95,6 +95,16 @@ cb_columns_changed(GtkTreeView *treeview, gpointer user_data)
"proctree");
}
+static void
+cb_sort_changed (GtkTreeSortable *model, gpointer user_data)
+{
+ ProcData * const procdata = static_cast<ProcData*>(user_data);
+
+ procman_save_tree_state (procdata->settings,
+ GTK_WIDGET (procdata->tree),
+ "proctree");
+}
+
static GtkTreeViewColumn*
my_gtk_tree_view_get_column_with_sort_column_id(GtkTreeView *treeview, int id)
@@ -436,6 +446,9 @@ proctable_new (ProcData * const procdata)
g_signal_connect (G_OBJECT(proctree), "columns-changed",
G_CALLBACK(cb_columns_changed), procdata);
+ g_signal_connect (G_OBJECT (model), "sort-column-changed",
+ G_CALLBACK (cb_sort_changed), procdata);
+
return scrolled;
}