From 6ae1dd504509573df5a310a73ba83825d311845b Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 22 May 2001 17:32:00 +0000 Subject: Instead of calling message_list_select_uid() here, instead connect to the 2001-05-22 Jeffrey Stedfast * message-browser.c (message_browser_folder_loaded): Instead of calling message_list_select_uid() here, instead connect to the "message_list_loaded" signal since the message-list is not built yet at this point. (message_browser_message_list_built): Call message_list_select_uid() here instead. * message-list.c: Lets have a new signal, MESSAGE_LIST_BUILT, that gets emitted when the message-list has finished being built by one of the built_*() functions. (message_list_class_init): Setup the signal stuff. (regen_list_regened): Emit the signal here (should this perhaps be moved into each of the build_*() functions instead?). svn path=/trunk/; revision=9925 --- mail/message-list.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'mail/message-list.c') diff --git a/mail/message-list.c b/mail/message-list.c index f4235a5642..9d87ad65ae 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -124,6 +124,7 @@ static void clear_info(char *key, ETreePath *node, MessageList *ml); enum { MESSAGE_SELECTED, + MESSAGE_LIST_BUILT, LAST_SIGNAL }; @@ -443,7 +444,7 @@ message_list_select_uid (MessageList *message_list, const char *uid) } else { g_free (message_list->cursor_uid); message_list->cursor_uid = NULL; - gtk_signal_emit (GTK_OBJECT (message_list), message_list_signals [MESSAGE_SELECTED], NULL); + gtk_signal_emit (GTK_OBJECT (message_list), message_list_signals[MESSAGE_SELECTED], NULL); } } @@ -1227,7 +1228,15 @@ message_list_class_init (GtkObjectClass *object_class) GTK_SIGNAL_OFFSET (MessageListClass, message_selected), gtk_marshal_NONE__STRING, GTK_TYPE_NONE, 1, GTK_TYPE_STRING); - + + message_list_signals[MESSAGE_LIST_BUILT] = + gtk_signal_new ("message_list_built", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (MessageListClass, message_list_built), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + gtk_object_class_add_signals(object_class, message_list_signals, LAST_SIGNAL); message_list_init_images (); @@ -2009,7 +2018,7 @@ on_cursor_activated_idle (gpointer data) MessageList *message_list = data; printf("emitting cursor changed signal, for uid %s\n", message_list->cursor_uid); - gtk_signal_emit(GTK_OBJECT (message_list), message_list_signals [MESSAGE_SELECTED], message_list->cursor_uid); + gtk_signal_emit(GTK_OBJECT (message_list), message_list_signals[MESSAGE_SELECTED], message_list->cursor_uid); message_list->idle_id = 0; return FALSE; @@ -2446,17 +2455,20 @@ static void regen_list_regen(struct _mail_msg *mm) m->tree = NULL; } -static void regen_list_regened(struct _mail_msg *mm) +static void +regen_list_regened (struct _mail_msg *mm) { struct _regen_list_msg *m = (struct _regen_list_msg *)mm; - + if (m->summary == NULL) return; - + if (m->dotree) build_tree(m->ml, m->tree, m->changes); else build_flat(m->ml, m->summary, m->changes); + + gtk_signal_emit (GTK_OBJECT (m->ml), message_list_signals[MESSAGE_LIST_BUILT]); } static void regen_list_free(struct _mail_msg *mm) -- cgit v1.2.3