[hotssh] Sort connections by descending order of last used by default
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hotssh] Sort connections by descending order of last used by default
- Date: Tue, 31 Dec 2013 19:01:57 +0000 (UTC)
commit cc65e1ac80bb81fee79e24ff1ab8c718e3662949
Author: Colin Walters <walters verbum org>
Date: Tue Dec 31 14:01:26 2013 -0500
Sort connections by descending order of last used by default
src/hotssh-hostdb.c | 3 +++
src/hotssh-tab.c | 4 ++++
src/tab.ui | 1 +
3 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/hotssh-hostdb.c b/src/hotssh-hostdb.c
index c67cc53..e909513 100644
--- a/src/hotssh-hostdb.c
+++ b/src/hotssh-hostdb.c
@@ -535,6 +535,9 @@ hotssh_hostdb_init (HotSshHostDB *self)
G_TYPE_BOOLEAN, /* is-known */
G_TYPE_UINT64 /* openssh-knownhost-line */
);
+ gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*)priv->model,
+ HOTSSH_HOSTDB_COLUMN_LAST_USED,
+ GTK_SORT_DESCENDING);
homedir = g_get_home_dir ();
g_assert (homedir);
diff --git a/src/hotssh-tab.c b/src/hotssh-tab.c
index e06d46b..a32df2d 100644
--- a/src/hotssh-tab.c
+++ b/src/hotssh-tab.c
@@ -1003,6 +1003,10 @@ hotssh_tab_constructed (GObject *object)
(GtkCellRenderer*)priv->lastused_renderer,
render_last_used,
self, NULL);
+ g_object_set (priv->lastused_column,
+ "sort-indicator", TRUE,
+ "sort-order", GTK_SORT_DESCENDING,
+ NULL);
}
static void
diff --git a/src/tab.ui b/src/tab.ui
index b467397..0b5186a 100644
--- a/src/tab.ui
+++ b/src/tab.ui
@@ -188,6 +188,7 @@
<object class="GtkTreeViewColumn" id="lastused_column">
<property name="title" translatable="yes">Last Used</property>
<property name="sort_indicator">True</property>
+ <property name="sort_order">descending</property>
<property name="sort_column_id">4</property>
<child>
<object class="GtkCellRendererText" id="lastused_renderer"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]