aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-log-window.c
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-05-03 18:55:59 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-09 19:34:57 +0800
commitee8c16e7d70527760ebb2c5894dd85c545daa2e4 (patch)
treef11c08d1bbbb56f339efefb38c528b53a029a4e9 /libempathy-gtk/empathy-log-window.c
parent90f40d91fb39eff7e64113411c3efa9f81803418 (diff)
downloadgsoc2013-empathy-ee8c16e7d70527760ebb2c5894dd85c545daa2e4.tar
gsoc2013-empathy-ee8c16e7d70527760ebb2c5894dd85c545daa2e4.tar.gz
gsoc2013-empathy-ee8c16e7d70527760ebb2c5894dd85c545daa2e4.tar.bz2
gsoc2013-empathy-ee8c16e7d70527760ebb2c5894dd85c545daa2e4.tar.lz
gsoc2013-empathy-ee8c16e7d70527760ebb2c5894dd85c545daa2e4.tar.xz
gsoc2013-empathy-ee8c16e7d70527760ebb2c5894dd85c545daa2e4.tar.zst
gsoc2013-empathy-ee8c16e7d70527760ebb2c5894dd85c545daa2e4.zip
LogWindow: scroll the events view to the end
Where newest messages are.
Diffstat (limited to 'libempathy-gtk/empathy-log-window.c')
-rw-r--r--libempathy-gtk/empathy-log-window.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 2203ee241..21300cdd1 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -2292,9 +2292,13 @@ log_window_got_messages_for_date_cb (GObject *manager,
gpointer user_data)
{
Ctx *ctx = user_data;
+ GtkTreeView *view;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
GList *events;
GList *l;
GError *error = NULL;
+ gint n;
if (log_window == NULL)
goto out;
@@ -2363,6 +2367,19 @@ log_window_got_messages_for_date_cb (GObject *manager,
}
g_list_free (events);
+ view = GTK_TREE_VIEW (log_window->treeview_events);
+ model = gtk_tree_view_get_model (view);
+ n = gtk_tree_model_iter_n_children (model, NULL) - 1;
+
+ if (n >= 0 && gtk_tree_model_iter_nth_child (model, &iter, NULL, n))
+ {
+ GtkTreePath *path;
+
+ path = gtk_tree_model_get_path (model, &iter);
+ gtk_tree_view_scroll_to_cell (view, path, NULL, FALSE, 0, 0);
+ gtk_tree_path_free (path);
+ }
+
out:
ctx_free (ctx);