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-header.c | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'composer/e-composer-header.c') diff --git a/composer/e-composer-header.c b/composer/e-composer-header.c index 8cbcf64f1f..272556969d 100644 --- a/composer/e-composer-header.c +++ b/composer/e-composer-header.c @@ -41,6 +41,9 @@ enum { struct _EComposerHeaderPrivate { gchar *label; gboolean button; + + guint sensitive : 1; + guint visible : 1; }; static gpointer parent_class; @@ -302,15 +305,9 @@ e_composer_header_get_label (EComposerHeader *header) gboolean e_composer_header_get_sensitive (EComposerHeader *header) { - gboolean sensitive; - g_return_val_if_fail (E_IS_COMPOSER_HEADER (header), FALSE); - sensitive = GTK_WIDGET_SENSITIVE (header->title_widget); - if (GTK_WIDGET_SENSITIVE (header->input_widget) != sensitive) - g_warning ("%s: Sensitivity is out of sync", G_STRFUNC); - - return sensitive; + return header->priv->sensitive; } void @@ -319,8 +316,7 @@ e_composer_header_set_sensitive (EComposerHeader *header, { g_return_if_fail (E_IS_COMPOSER_HEADER (header)); - gtk_widget_set_sensitive (header->title_widget, sensitive); - gtk_widget_set_sensitive (header->input_widget, sensitive); + header->priv->sensitive = sensitive; g_object_notify (G_OBJECT (header), "sensitive"); } @@ -328,15 +324,9 @@ e_composer_header_set_sensitive (EComposerHeader *header, gboolean e_composer_header_get_visible (EComposerHeader *header) { - gboolean visible; - g_return_val_if_fail (E_IS_COMPOSER_HEADER (header), FALSE); - visible = GTK_WIDGET_VISIBLE (header->title_widget); - if (GTK_WIDGET_VISIBLE (header->input_widget) != visible) - g_warning ("%s: Visibility is out of sync", G_STRFUNC); - - return visible; + return header->priv->visible; } void @@ -345,13 +335,7 @@ e_composer_header_set_visible (EComposerHeader *header, { g_return_if_fail (E_IS_COMPOSER_HEADER (header)); - if (visible) { - gtk_widget_show (header->title_widget); - gtk_widget_show (header->input_widget); - } else { - gtk_widget_hide (header->title_widget); - gtk_widget_hide (header->input_widget); - } + header->priv->visible = visible; g_object_notify (G_OBJECT (header), "visible"); } -- cgit v1.2.3