aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@src.gnome.org>2000-04-17 15:59:16 +0800
committerChris Toshok <toshok@src.gnome.org>2000-04-17 15:59:16 +0800
commit7aa932f07e5b50cadb8173312119e3252f8c9366 (patch)
treebb1d3efbab6437032664df130b6f213b0b648cae
parentece07d1b3afb6e305f0446d318f26bcaaa522ab3 (diff)
downloadgsoc2013-evolution-7aa932f07e5b50cadb8173312119e3252f8c9366.tar
gsoc2013-evolution-7aa932f07e5b50cadb8173312119e3252f8c9366.tar.gz
gsoc2013-evolution-7aa932f07e5b50cadb8173312119e3252f8c9366.tar.bz2
gsoc2013-evolution-7aa932f07e5b50cadb8173312119e3252f8c9366.tar.lz
gsoc2013-evolution-7aa932f07e5b50cadb8173312119e3252f8c9366.tar.xz
gsoc2013-evolution-7aa932f07e5b50cadb8173312119e3252f8c9366.tar.zst
gsoc2013-evolution-7aa932f07e5b50cadb8173312119e3252f8c9366.zip
new function, actually calls select_msg. (on_row_selection_cmd): register
* message-list.c (on_row_selection_idle): new function, actually calls select_msg. (on_row_selection_cmd): register an idle instead of calling select_msg directly. this fixes the lag before the row is selected - selection is instantaneous now, with message loading happening afterward. * message-list.h: add row_to_select and an idle_id to the message list to make the select_msg call happen in an idle func. svn path=/trunk/; revision=2470
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/message-list.c23
-rw-r--r--mail/message-list.h5
3 files changed, 33 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 8ec2e1c703..28033674e8 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,15 @@
2000-04-17 Chris Toshok <toshok@helixcode.com>
+ * message-list.c (on_row_selection_idle): new function, actually
+ calls select_msg.
+ (on_row_selection_cmd): register an idle instead of calling
+ select_msg directly. this fixes the lag before the row is
+ selected - selection is instantaneous now, with message loading
+ happening afterward.
+
+ * message-list.h: add row_to_select and an idle_id to the message
+ list to make the select_msg call happen in an idle func.
+
* message-list.c (message_list_init_renderers): no more
e_cell_set_editable. this info always comes from the model.
diff --git a/mail/message-list.c b/mail/message-list.c
index 98cf6c5893..be4fac5b9e 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -645,6 +645,8 @@ message_list_new (FolderBrowser *parent_folder_browser)
message_list->parent_folder_browser = parent_folder_browser;
+ message_list->idle_id = 0;
+
message_list_construct (message_list, corba_object);
return BONOBO_OBJECT (message_list);
@@ -728,6 +730,16 @@ message_list_get_widget (MessageList *message_list)
E_MAKE_TYPE (message_list, "MessageList", MessageList, message_list_class_init, message_list_init, PARENT_TYPE);
+static gboolean
+on_row_selection_idle (gpointer data)
+{
+ MessageList *message_list = data;
+
+ select_msg (message_list, message_list->row_to_select);
+
+ message_list->idle_id = 0;
+ return FALSE;
+}
static void
on_row_selection_cmd (ETable *table,
@@ -735,12 +747,15 @@ on_row_selection_cmd (ETable *table,
gboolean selected,
gpointer user_data)
{
- MessageList *message_list;
+ if (selected) {
+ MessageList *message_list;
- message_list = MESSAGE_LIST (user_data);
+ message_list = MESSAGE_LIST (user_data);
+ message_list->row_to_select = row;
- if (selected)
- select_msg (message_list, row);
+ if (!message_list->idle_id)
+ g_idle_add_full (G_PRIORITY_LOW, on_row_selection_idle, message_list, NULL);
+ }
}
diff --git a/mail/message-list.h b/mail/message-list.h
index f045037313..b6ab3d9f1e 100644
--- a/mail/message-list.h
+++ b/mail/message-list.h
@@ -59,7 +59,10 @@ struct _MessageList {
CamelFolder *folder;
CamelFolderSummary *folder_summary;
-
+
+ /* used by the idle-call to select a row */
+ int row_to_select;
+ guint idle_id;
} ;
typedef struct {