[empathy: 61/80] LogWindow: scroll the events view to the end
- From: Emilio Pozuelo Monfort <epm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy: 61/80] LogWindow: scroll the events view to the end
- Date: Fri, 10 Jun 2011 08:44:17 +0000 (UTC)
commit ee8c16e7d70527760ebb2c5894dd85c545daa2e4
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date: Tue May 3 11:55:59 2011 +0100
LogWindow: scroll the events view to the end
Where newest messages are.
libempathy-gtk/empathy-log-window.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 2203ee2..21300cd 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]