From a1f287ca6bf35d27e5dcb9b89a10f76e9abbd057 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 20 May 2009 12:02:30 -0400 Subject: =?UTF-8?q?Bug=20274117=20=E2=80=93=20Difficult=20to=20post=20a=20?= =?UTF-8?q?new=20message=20to=20newsgroups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Completely rewrite how composer headers are managed. There's now two sets of headers (with some overlap): one set is for sending an email message, the other is for posting to a newsgroup. The correct set of headers is chosen on-the-fly based on the currently selected account type. The user's "view" preferences for these two sets are stored separately, so that switching between an email account and a news account will no longer stomp on your preferences. This also eliminates the need for the "Post New Message to Folder" and "Post a Reply" actions, so they've been removed. Usenet users can now just highlight a newsgroup in the folder tree and click New or Reply, and the composer window will show the correct set of headers with the Post-To field filled in automatically. Comment #6 in the bug discusses other standard news reader behaviors we still don't get right, particularly the missing "Followup To" header. These will be dealt with separately. --- composer/e-composer-actions.c | 132 ++---------------------------------------- 1 file changed, 5 insertions(+), 127 deletions(-) (limited to 'composer/e-composer-actions.c') diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c index 56ec7c5db1..247ac7794f 100644 --- a/composer/e-composer-actions.c +++ b/composer/e-composer-actions.c @@ -308,104 +308,6 @@ action_smime_sign_cb (GtkToggleAction *action, gtkhtml_editor_set_changed (editor, TRUE); } -static void -action_view_bcc_cb (GtkToggleAction *action, - EMsgComposer *composer) -{ - EComposerHeaderTable *table; - gboolean active; - - table = e_msg_composer_get_header_table (composer); - active = gtk_toggle_action_get_active (action); - - e_composer_header_table_set_header_visible ( - table, E_COMPOSER_HEADER_BCC, active); -} - -static void -action_view_cc_cb (GtkToggleAction *action, - EMsgComposer *composer) -{ - EComposerHeaderTable *table; - gboolean active; - - table = e_msg_composer_get_header_table (composer); - active = gtk_toggle_action_get_active (action); - - e_composer_header_table_set_header_visible ( - table, E_COMPOSER_HEADER_CC, active); -} - -static void -action_view_from_cb (GtkToggleAction *action, - EMsgComposer *composer) -{ - EComposerHeaderTable *table; - gboolean active; - - table = e_msg_composer_get_header_table (composer); - active = gtk_toggle_action_get_active (action); - - e_composer_header_table_set_header_visible ( - table, E_COMPOSER_HEADER_FROM, active); -} - -static void -action_view_post_to_cb (GtkToggleAction *action, - EMsgComposer *composer) -{ - EComposerHeaderTable *table; - gboolean active; - - table = e_msg_composer_get_header_table (composer); - active = gtk_toggle_action_get_active (action); - - e_composer_header_table_set_header_visible ( - table, E_COMPOSER_HEADER_POST_TO, active); -} - -static void -action_view_reply_to_cb (GtkToggleAction *action, - EMsgComposer *composer) -{ - EComposerHeaderTable *table; - gboolean active; - - table = e_msg_composer_get_header_table (composer); - active = gtk_toggle_action_get_active (action); - - e_composer_header_table_set_header_visible ( - table, E_COMPOSER_HEADER_REPLY_TO, active); -} - -static void -action_view_subject_cb (GtkToggleAction *action, - EMsgComposer *composer) -{ - EComposerHeaderTable *table; - gboolean active; - - table = e_msg_composer_get_header_table (composer); - active = gtk_toggle_action_get_active (action); - - e_composer_header_table_set_header_visible ( - table, E_COMPOSER_HEADER_SUBJECT, active); -} - -static void -action_view_to_cb (GtkToggleAction *action, - EMsgComposer *composer) -{ - EComposerHeaderTable *table; - gboolean active; - - table = e_msg_composer_get_header_table (composer); - active = gtk_toggle_action_get_active (action); - - e_composer_header_table_set_header_visible ( - table, E_COMPOSER_HEADER_TO, active); -} - static GtkActionEntry entries[] = { { "attach", @@ -542,7 +444,7 @@ static GtkToggleActionEntry toggle_entries[] = { N_("S/MIME Sig_n"), NULL, N_("Sign this message with your S/MIME Signature Certificate"), - G_CALLBACK (action_smime_sign_cb), + NULL, /* Handled by property bindings */ FALSE }, { "view-bcc", @@ -550,7 +452,7 @@ static GtkToggleActionEntry toggle_entries[] = { N_("_Bcc Field"), NULL, N_("Toggles whether the BCC field is displayed"), - G_CALLBACK (action_view_bcc_cb), + NULL, /* Handled by property bindings */ FALSE }, { "view-cc", @@ -558,7 +460,7 @@ static GtkToggleActionEntry toggle_entries[] = { N_("_Cc Field"), NULL, N_("Toggles whether the CC field is displayed"), - G_CALLBACK (action_view_cc_cb), + NULL, /* Handled by property bindings */ FALSE }, { "view-from", @@ -566,15 +468,7 @@ static GtkToggleActionEntry toggle_entries[] = { N_("_From Field"), NULL, N_("Toggles whether the From chooser is displayed"), - G_CALLBACK (action_view_from_cb), - FALSE }, - - { "view-post-to", - NULL, - N_("_Post-To Field"), - NULL, - N_("Toggles whether the Post-To field is displayed"), - G_CALLBACK (action_view_post_to_cb), + NULL, /* Handled by property bindings */ FALSE }, { "view-reply-to", @@ -582,24 +476,8 @@ static GtkToggleActionEntry toggle_entries[] = { N_("_Reply-To Field"), NULL, N_("Toggles whether the Reply-To field is displayed"), - G_CALLBACK (action_view_reply_to_cb), + NULL, /* Handled by property bindings */ FALSE }, - - { "view-subject", - NULL, - N_("_Subject Field"), - NULL, - N_("Toggles whether the Subject field is displayed"), - G_CALLBACK (action_view_subject_cb), - FALSE }, - - { "view-to", - NULL, - N_("_To Field"), - NULL, - N_("Toggles whether the To field is displayed"), - G_CALLBACK (action_view_to_cb), - FALSE } }; void -- cgit v1.2.3