diff options
author | Not Zed <NotZed@Ximian.com> | 2003-06-17 11:15:46 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2003-06-17 11:15:46 +0800 |
commit | cec1fb093d53dc08d92b0e2f245640817c5a0fc2 (patch) | |
tree | ae5151f6d38efa9ffcefea9b9b1c51ea7174bee9 /mail/message-list.c | |
parent | c574e976632b6178e04f453b023df5691b6af23d (diff) | |
download | gsoc2013-evolution-cec1fb093d53dc08d92b0e2f245640817c5a0fc2.tar gsoc2013-evolution-cec1fb093d53dc08d92b0e2f245640817c5a0fc2.tar.gz gsoc2013-evolution-cec1fb093d53dc08d92b0e2f245640817c5a0fc2.tar.bz2 gsoc2013-evolution-cec1fb093d53dc08d92b0e2f245640817c5a0fc2.tar.lz gsoc2013-evolution-cec1fb093d53dc08d92b0e2f245640817c5a0fc2.tar.xz gsoc2013-evolution-cec1fb093d53dc08d92b0e2f245640817c5a0fc2.tar.zst gsoc2013-evolution-cec1fb093d53dc08d92b0e2f245640817c5a0fc2.zip |
** See bug #44609
2003-06-16 Not Zed <NotZed@Ximian.com>
** See bug #44609
* mail-vfolder.c (vfolder_edit_rule): put the ok/cancel buttons in
the stupid gnome 2 order.
** See bug #33593
* message-list.c (on_selection_changed_cmd): also listedn to
selection changed events, since the etable api has changed.
(get_selected_cb): helper for above.
(message_list_construct): hook to selection change signal.
* mail-callbacks.c (composer_send_queued_cb): Unref the composer
to match the ref composer_send_cb();
** See bug #44519
* message-browser.c (message_browser_message_list_built): We want
to disconnect from the messagelist, not folderbrowser signal.
svn path=/trunk/; revision=21452
Diffstat (limited to 'mail/message-list.c')
-rw-r--r-- | mail/message-list.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index 1d9ca11aaa..d694dd2629 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -131,6 +131,7 @@ typedef struct _EMailAddress EMailAddress; static ETreeScrolledClass *message_list_parent_class; static void on_cursor_activated_cmd (ETree *tree, int row, ETreePath path, gpointer user_data); +static void on_selection_changed_cmd(ETree *tree, MessageList *ml); static gint on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, MessageList *list); static char *filter_date (time_t date); static char *filter_size (int size); @@ -1453,6 +1454,10 @@ message_list_construct (MessageList *message_list) g_signal_connect((message_list->tree), "click", G_CALLBACK (on_click), message_list); + + g_signal_connect((message_list->tree), "selection_change", + G_CALLBACK (on_selection_changed_cmd), message_list); + } GtkWidget * @@ -2235,7 +2240,7 @@ on_cursor_activated_idle (gpointer data) MessageList *message_list = data; ESelectionModel *esm = e_tree_get_selection_model (message_list->tree); int selected = e_selection_model_selected_count (esm); - + if (selected == 1 && message_list->cursor_uid) { d(printf ("emitting cursor changed signal, for uid %s\n", message_list->cursor_uid)); g_signal_emit (message_list, message_list_signals[MESSAGE_SELECTED], 0, message_list->cursor_uid); @@ -2252,7 +2257,7 @@ on_cursor_activated_cmd (ETree *tree, int row, ETreePath path, gpointer user_dat { MessageList *message_list = MESSAGE_LIST (user_data); const char *new_uid; - + if (path == NULL) new_uid = NULL; else @@ -2272,6 +2277,29 @@ on_cursor_activated_cmd (ETree *tree, int row, ETreePath path, gpointer user_dat } } +static void +get_selected_cb(ETreePath path, MessageList *ml) +{ + g_free(ml->cursor_uid); + ml->cursor_uid = g_strdup(get_message_uid(ml, path)); +} + +static void +on_selection_changed_cmd(ETree *tree, MessageList *ml) +{ + ESelectionModel *esm = e_tree_get_selection_model (ml->tree); + int selected = e_selection_model_selected_count (esm); + + g_free(ml->cursor_uid); + ml->cursor_uid = NULL; + + if (selected == 1) + e_tree_selected_path_foreach(ml->tree, (ETreeForeachFunc)get_selected_cb, ml); + + if ((selected == 1 || selected == 0) && !ml->idle_id) + g_idle_add_full (G_PRIORITY_LOW, on_cursor_activated_idle, ml, NULL); +} + static gint on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, MessageList *list) { |