r3780 - in trunk/src/target/OM-2007.2/applications/openmoko-messages2: . src
chris at sita.openmoko.org
chris at sita.openmoko.org
Mon Jan 7 12:35:12 CET 2008
Author: chris
Date: 2008-01-07 12:35:11 +0100 (Mon, 07 Jan 2008)
New Revision: 3780
Modified:
trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-notes.c
Log:
* src/sms-notes.c: (scroll_notes_to_bottom_cb), (note_progress_cb),
(page_shown):
Scroll the notes treeview to the end of the list when switching to the
page
Modified: trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog 2008-01-07 10:45:28 UTC (rev 3779)
+++ trunk/src/target/OM-2007.2/applications/openmoko-messages2/ChangeLog 2008-01-07 11:35:11 UTC (rev 3780)
@@ -1,3 +1,10 @@
+2008-01-07 Chris Lord <chris at openedhand.com>
+
+ * src/sms-notes.c: (scroll_notes_to_bottom_cb), (note_progress_cb),
+ (page_shown):
+ Scroll the notes treeview to the end of the list when switching to the
+ page
+
2007-12-21 Chris Lord <chris at openedhand.com>
* src/sms-main.c:
Modified: trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-notes.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-notes.c 2008-01-07 10:45:28 UTC (rev 3779)
+++ trunk/src/target/OM-2007.2/applications/openmoko-messages2/src/sms-notes.c 2008-01-07 11:35:11 UTC (rev 3780)
@@ -89,6 +89,25 @@
}
}
+static void
+scroll_notes_to_bottom_cb (GtkAdjustment *vadjust, SmsData *data)
+{
+ /* Scroll note list to the bottom */
+ if (vadjust->value != (vadjust->upper - vadjust->page_size))
+ gtk_adjustment_set_value (vadjust,
+ vadjust->upper - vadjust->page_size);
+}
+
+static void
+note_progress_cb (JanaStoreView *store_view, gint percent, SmsData *data)
+{
+ if (percent != 100) return;
+
+ /* Remove scroll-to-bottom callback */
+ g_signal_handlers_disconnect_by_func (
+ data->notes_treeview, scroll_notes_to_bottom_cb, data);
+}
+
static gboolean
mark_messages_read_idle (SmsData *data)
{
@@ -161,6 +180,8 @@
G_CALLBACK (scroll_changed_cb), data);
g_signal_connect (vadjust, "value-changed",
G_CALLBACK (scroll_changed_cb), data);
+ g_signal_connect (vadjust, "changed",
+ G_CALLBACK (scroll_notes_to_bottom_cb), data);
/* Assign the recipient photo to the generic avatar icon, in case we
* can't find it later.
@@ -199,6 +220,8 @@
}
g_list_free (components);
+ note_progress_cb (store_view, 100, data);
+
return;
}
@@ -226,6 +249,8 @@
G_CALLBACK (note_changed_cb), data);
g_signal_connect (store_view, "modified",
G_CALLBACK (note_changed_cb), data);
+ g_signal_connect (store_view, "progress",
+ G_CALLBACK (note_progress_cb), data);
jana_store_view_start (store_view);
}
g_object_unref (store_view);
More information about the commitlog
mailing list