From 2505d230498c0f35822e7d10502bb3f899fdf876 Mon Sep 17 00:00:00 2001 From: Meilof Veeningen Date: Mon, 12 Jan 2004 22:22:50 +0000 Subject: support for posting both to mail and to (multiple) folders 2004-01-12 Meilof Veeningen * em-composer-utils.c: support for posting both to mail and to (multiple) folders * em-folder-browser.c: use em_utils_post_to_folder (works with NNTP) * em-folder-selection-button.[ch]: added multiple selection mode * em-folder-selector.[ch]: idem * em-folder-tree.[ch]: added multiple selection mode, no longer show disabled accounts * em-utils.c: various changes to allow posting to (multiple) folders * em-subscribe-editor.c: double-clicking a node in the editor updates it directly * mail-ops.c: for appending messages, set the "X-Mailer" header svn path=/trunk/; revision=24182 --- mail/em-subscribe-editor.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'mail/em-subscribe-editor.c') diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c index 1fb9066362..a23af0a333 100644 --- a/mail/em-subscribe-editor.c +++ b/mail/em-subscribe-editor.c @@ -127,7 +127,6 @@ struct _EMSubscribeNode { static void sub_editor_busy(EMSubscribeEditor *se, int dir); static int sub_queue_fill_level(EMSubscribe *sub, EMSubscribeNode *node); -static void sub_selection_changed(GtkTreeSelection *selection, EMSubscribe *sub); static void sub_node_free(char *key, EMSubscribeNode *node, EMSubscribe *sub) @@ -195,7 +194,7 @@ sub_folder_subscribe (struct _mail_msg *mm) camel_store_unsubscribe_folder (m->sub->store, m->node->info->full_name, &mm->ex); } -static void +static void sub_folder_subscribed (struct _mail_msg *mm) { struct _zsubscribe_msg *m = (struct _zsubscribe_msg *)mm, *next; @@ -503,6 +502,29 @@ sub_selection_changed(GtkTreeSelection *selection, EMSubscribe *sub) gtk_widget_set_sensitive(sub->editor->unsubscribe_button, dounsub); } +/* double-clicking causes a node item to be evaluated directly */ +static void sub_row_activated(GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *col, EMSubscribe *sub) { + EMSubscribeNode *node; + GtkTreeIter iter; + GtkTreeModel *model = gtk_tree_view_get_model(tree); + + if (gtk_tree_model_get_iter(model, &iter, path) != TRUE) return; + + gtk_tree_model_get(model, &iter, 2, &node, -1); + + /* check whether the item is already processed */ + if (node->path == NULL) + return; + + /* remove it from wherever in the list it is, and place it in front instead */ + e_dlist_remove((EDListNode *)node); + e_dlist_addhead(&sub->pending, (EDListNode *)node); + + if (sub->pending_id == -1 + && (node = (EMSubscribeNode *)e_dlist_remtail(&sub->pending))) + sub_queue_fill_level(sub, node); +} + static void sub_row_expanded(GtkTreeView *tree, GtkTreeIter *iter, GtkTreePath *path, EMSubscribe *sub) { @@ -621,6 +643,7 @@ subscribe_set_store(EMSubscribe *sub, CamelStore *store) gtk_tree_view_set_headers_visible (sub->tree, FALSE); g_signal_connect(sub->tree, "row-expanded", G_CALLBACK(sub_row_expanded), sub); + g_signal_connect(sub->tree, "row-activated", G_CALLBACK(sub_row_activated), sub); g_signal_connect(sub->tree, "destroy", G_CALLBACK(sub_destroy), sub); sub_selection_changed(selection, sub); -- cgit