From f248caf515c713b6f5c6892ccf984603bb813fe5 Mon Sep 17 00:00:00 2001 From: Paolo Borelli Date: Tue, 6 Apr 2010 23:34:15 -0400 Subject: Bug 614892 - String leak in the composer --- composer/e-msg-composer.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'composer') diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index c212ea088a..dc50fad5ad 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1356,6 +1356,8 @@ set_editor_text (EMsgComposer *composer, if (set_signature) e_msg_composer_show_sig_file (composer); + + g_free (body); } /* Commands. */ -- cgit v1.2.3 From 1d6ecf87aa0e54f07dcf462459dd26c4056b9fe2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 28 Mar 2010 18:54:27 -0400 Subject: Fix mismatched quotes. --- composer/e-msg-composer.c | 2 +- composer/mail-composer.error.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'composer') diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index dc50fad5ad..f239a2825f 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -381,7 +381,7 @@ add_inlined_images (EMsgComposer *composer, CamelMultipart *multipart) } /* These functions builds a CamelMimeMessage for the message that the user has - * composed in `composer'. + * composed in 'composer'. */ static void diff --git a/composer/mail-composer.error.xml b/composer/mail-composer.error.xml index b9789c23e0..b9d1a3891d 100644 --- a/composer/mail-composer.error.xml +++ b/composer/mail-composer.error.xml @@ -2,13 +2,13 @@ - <_primary>You cannot attach the file `{0}' to this message. + <_primary>You cannot attach the file n{0}' to this message. {1} - <_primary>The file `{0}' is not a regular file and cannot be sent in a message. + <_primary>The file '{0}' is not a regular file and cannot be sent in a message. -- cgit v1.2.3 From 51a35cd8be6904a3bb477eccc544a186a66b541c Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 30 Mar 2010 08:27:49 -0400 Subject: Express: Composer always defaults to HTML mode Composer and signature editor always default to HTML in Express mode. Hide the corresponding composer preference. This will not affect the user preference in normal mode. --- composer/e-msg-composer.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'composer') diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index f239a2825f..308d7e8294 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1663,10 +1663,6 @@ msg_composer_constructed (GObject *object) /* Honor User Preferences */ - active = e_shell_settings_get_boolean ( - shell_settings, "composer-format-html"); - gtkhtml_editor_set_html_mode (GTKHTML_EDITOR (composer), active); - action = GTK_TOGGLE_ACTION (ACTION (REQUEST_READ_RECEIPT)); active = e_shell_settings_get_boolean ( shell_settings, "composer-request-receipt"); -- cgit v1.2.3 From 4db5d55329a4f06b7369c114d6fd565f39747b8a Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Fri, 30 Apr 2010 09:33:35 +0530 Subject: Set transient prop in express mode so that composer appears in the same zone as the mail window. --- composer/e-msg-composer.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'composer') diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 308d7e8294..f8e34718a1 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -2145,8 +2145,14 @@ msg_composer_class_init (EMsgComposerClass *class) static void msg_composer_init (EMsgComposer *composer) { + EShell *shell = e_shell_get_default (); composer->lite = composer_lite; composer->priv = E_MSG_COMPOSER_GET_PRIVATE (composer); + + if (e_shell_get_express_mode (shell)) { + GtkWindow *window = e_shell_get_active_window(shell); + gtk_window_set_transient_for (GTK_WINDOW(composer), window); + } } GType -- cgit v1.2.3 From abd1b7ef77b5dc8ff7ff1c6c405aaf448828c1b9 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 30 Apr 2010 15:30:58 -0500 Subject: Use e_msg_composer_get_lite() instead of a global variable or struct fields This will also make 'grep' easier when we remove the lite stuff by refactoring. Signed-off-by: Federico Mena Quintero --- composer/e-composer-header-table.c | 17 ++++++++--------- composer/e-composer-private.c | 8 ++++---- composer/e-msg-composer.c | 1 - composer/e-msg-composer.h | 1 - 4 files changed, 12 insertions(+), 15 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c index f62dc376fd..bb2c9e714f 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -26,14 +26,13 @@ #include "e-util/gconf-bridge.h" #include "widgets/misc/e-signature-combo-box.h" +#include "e-msg-composer.h" #include "e-composer-private.h" #include "e-composer-from-header.h" #include "e-composer-name-header.h" #include "e-composer-post-header.h" #include "e-composer-text-header.h" -extern gboolean composer_lite; - #define E_COMPOSER_HEADER_TABLE_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_COMPOSER_HEADER_TABLE, EComposerHeaderTablePrivate)) @@ -159,7 +158,7 @@ composer_header_table_notify_header (EComposerHeader *header, { GtkWidget *parent; - if (composer_lite && strcmp (property_name, "destinations-to") == 0) + if (e_msg_composer_get_lite () && strcmp (property_name, "destinations-to") == 0) parent = g_object_get_data ( G_OBJECT (header->input_widget), "parent"); else @@ -174,7 +173,7 @@ composer_header_table_notify_widget (GtkWidget *widget, { GtkWidget *parent; - if (composer_lite) { + if (e_msg_composer_get_lite ()) { parent = gtk_widget_get_parent (widget); parent = g_object_get_data (G_OBJECT (parent), "pdata"); } else @@ -509,7 +508,7 @@ composer_header_table_constructor (GType type, gtk_table_attach ( GTK_TABLE (object), priv->headers[ii]->title_widget, 0, 1, ii, ii + 1, GTK_FILL, GTK_FILL, 0, 3); - if (composer_lite && ii == E_COMPOSER_HEADER_TO) { + if (e_msg_composer_get_lite () && ii == E_COMPOSER_HEADER_TO) { GtkWidget *box = gtk_hbox_new (FALSE, 0); g_object_set_data ( G_OBJECT (priv->headers[ii]->input_widget), @@ -532,7 +531,7 @@ composer_header_table_constructor (GType type, priv->headers[ii]->input_widget, 1, 4, ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, 3); } - if (composer_lite && priv->headers[ii]->action_widget) { + if (e_msg_composer_get_lite () && priv->headers[ii]->action_widget) { /* Pack the widgets to the end. Helps formatting * when hiding the From field. */ gtk_box_pack_end ( @@ -542,7 +541,7 @@ composer_header_table_constructor (GType type, } } - if (composer_lite) + if (e_msg_composer_get_lite ()) gtk_widget_show_all ((GtkWidget *)priv->actions_container); ii = E_COMPOSER_HEADER_FROM; @@ -561,13 +560,13 @@ composer_header_table_constructor (GType type, priv->signature_combo_box, "visible"); /* Now add the signature stuff. */ - if (!composer_lite) { + if (!e_msg_composer_get_lite ()) { gtk_table_attach ( GTK_TABLE (object), priv->signature_label, 2, 3, ii, ii + 1, 0, 0, 0, 3); gtk_table_attach ( GTK_TABLE (object), priv->signature_combo_box, - 3, 4, ii, ii + 1, composer_lite ? GTK_FILL: 0, 0, 0, 3); + 3, 4, ii, ii + 1, e_msg_composer_get_lite () ? GTK_FILL: 0, 0, 0, 3); } else { GtkWidget *box = gtk_hbox_new (FALSE, 0); diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c index b48f9b6cdf..ba022f3972 100644 --- a/composer/e-composer-private.c +++ b/composer/e-composer-private.c @@ -145,7 +145,7 @@ e_composer_private_constructed (EMsgComposer *composer) html = gtkhtml_editor_get_html (editor); ui_manager = gtkhtml_editor_get_ui_manager (editor); - if (composer->lite) { + if (e_msg_composer_get_lite ()) { widget = gtkhtml_editor_get_managed_widget (editor, "/main-menu"); gtk_widget_hide (widget); widget = gtkhtml_editor_get_managed_widget (editor, "/main-toolbar"); @@ -243,7 +243,7 @@ e_composer_private_constructed (EMsgComposer *composer) widget = e_composer_header_table_new (); gtk_container_set_border_width (GTK_CONTAINER (widget), 6); gtk_box_pack_start (GTK_BOX (editor->vbox), widget, FALSE, FALSE, 0); - if (composer->lite) + if (e_msg_composer_get_lite ()) gtk_box_reorder_child (GTK_BOX (editor->vbox), widget, 0); else gtk_box_reorder_child (GTK_BOX (editor->vbox), widget, 2); @@ -253,7 +253,7 @@ e_composer_private_constructed (EMsgComposer *composer) /* Construct the attachment paned. */ - if (composer->lite) { + if (e_msg_composer_get_lite ()) { e_attachment_paned_set_default_height (75); /* short attachment bar for Anjal */ e_attachment_icon_view_set_default_icon_size (GTK_ICON_SIZE_BUTTON); } @@ -262,7 +262,7 @@ e_composer_private_constructed (EMsgComposer *composer) priv->attachment_paned = g_object_ref (widget); gtk_widget_show (widget); - if (composer->lite) { + if (e_msg_composer_get_lite ()) { GtkWidget *tmp, *tmp1, *tmp_box, *container; GtkWidget *combo; diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 308d7e8294..ca8e487223 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -2145,7 +2145,6 @@ msg_composer_class_init (EMsgComposerClass *class) static void msg_composer_init (EMsgComposer *composer) { - composer->lite = composer_lite; composer->priv = E_MSG_COMPOSER_GET_PRIVATE (composer); } diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h index c55237ce52..19f21b7df2 100644 --- a/composer/e-msg-composer.h +++ b/composer/e-msg-composer.h @@ -63,7 +63,6 @@ typedef struct _EMsgComposerPrivate EMsgComposerPrivate; struct _EMsgComposer { GtkhtmlEditor parent; EMsgComposerPrivate *priv; - gboolean lite; }; struct _EMsgComposerClass { -- cgit v1.2.3 From 5b075e47acca63c7d66df597956653aafc2713ac Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 30 Apr 2010 15:44:03 -0500 Subject: Remove unused function Signed-off-by: Federico Mena Quintero --- composer/e-composer-header.c | 9 --------- composer/e-composer-header.h | 2 -- 2 files changed, 11 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-header.c b/composer/e-composer-header.c index 2a6942acd8..d61f44a2ed 100644 --- a/composer/e-composer-header.c +++ b/composer/e-composer-header.c @@ -199,15 +199,6 @@ composer_header_set_property (GObject *object, G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } -void -e_composer_header_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) -{ - composer_header_set_property (object, property_id, value, pspec); -} - static void composer_header_get_property (GObject *object, guint property_id, diff --git a/composer/e-composer-header.h b/composer/e-composer-header.h index 33600900e9..044425b47f 100644 --- a/composer/e-composer-header.h +++ b/composer/e-composer-header.h @@ -69,8 +69,6 @@ void e_composer_header_set_sensitive (EComposerHeader *header, gboolean e_composer_header_get_visible (EComposerHeader *header); void e_composer_header_set_visible (EComposerHeader *header, gboolean visible); -void e_composer_header_set_property (GObject *object, guint property_id, - const GValue *value, GParamSpec *pspec); void e_composer_header_set_title_tooltip (EComposerHeader *header, const gchar *tooltip); -- cgit v1.2.3 From faa40288d4b15950c7df7c324c8afa4ba578b25a Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 30 Apr 2010 16:33:26 -0500 Subject: Don't lay out the headers differently for the lite composer This is basically a selective revert of these commits: 9b0e9dc0aeffd627ce2bdea049cc7c47bb7418f0 631da1b6baf2204ebb844a1d3962c2c7d811eb41 5d4e8994e83c9ab650981c332eaef57f4fab2788 Instead of having buttons to show/hide headers in the same row as the 'To:' header, we will have expanders or something prettier, a la googlemail. Signed-off-by: Federico Mena Quintero --- composer/e-composer-from-header.c | 10 ----- composer/e-composer-from-header.h | 3 -- composer/e-composer-header-table.c | 61 +++++--------------------- composer/e-composer-header.c | 90 -------------------------------------- composer/e-composer-header.h | 1 - composer/e-composer-name-header.c | 24 ---------- composer/e-composer-name-header.h | 8 ---- composer/e-composer-text-header.c | 22 +++++----- composer/e-composer-text-header.h | 4 +- 9 files changed, 23 insertions(+), 200 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-from-header.c b/composer/e-composer-from-header.c index cade5bfed3..4dadfa7ac7 100644 --- a/composer/e-composer-from-header.c +++ b/composer/e-composer-from-header.c @@ -110,16 +110,6 @@ e_composer_from_header_new (const gchar *label) "button", FALSE, NULL); } -EComposerHeader * -e_composer_from_header_new_with_action (const gchar *label, - const gchar *action) -{ - return g_object_new ( - E_TYPE_COMPOSER_FROM_HEADER, "label", label, - "button", FALSE, "addaction_text", action, - "addaction", action != NULL, NULL); -} - EAccountList * e_composer_from_header_get_account_list (EComposerFromHeader *header) { diff --git a/composer/e-composer-from-header.h b/composer/e-composer-from-header.h index 9f9a0e0f82..d2603bd664 100644 --- a/composer/e-composer-from-header.h +++ b/composer/e-composer-from-header.h @@ -63,9 +63,6 @@ struct _EComposerFromHeaderClass { GType e_composer_from_header_get_type (void); EComposerHeader * e_composer_from_header_new (const gchar *label); -EComposerHeader * e_composer_from_header_new_with_action - (const gchar *label, - const gchar *action); EAccountList * e_composer_from_header_get_account_list (EComposerFromHeader *header); void e_composer_from_header_set_account_list diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c index bb2c9e714f..f8ea8df272 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -68,7 +68,6 @@ struct _EComposerHeaderTablePrivate { GtkWidget *signature_label; GtkWidget *signature_combo_box; ENameSelector *name_selector; - GtkHBox *actions_container; }; static gpointer parent_class; @@ -158,11 +157,7 @@ composer_header_table_notify_header (EComposerHeader *header, { GtkWidget *parent; - if (e_msg_composer_get_lite () && strcmp (property_name, "destinations-to") == 0) - parent = g_object_get_data ( - G_OBJECT (header->input_widget), "parent"); - else - parent = gtk_widget_get_parent (header->input_widget); + parent = gtk_widget_get_parent (header->input_widget); g_return_if_fail (E_IS_COMPOSER_HEADER_TABLE (parent)); g_object_notify (G_OBJECT (parent), property_name); } @@ -508,41 +503,12 @@ composer_header_table_constructor (GType type, gtk_table_attach ( GTK_TABLE (object), priv->headers[ii]->title_widget, 0, 1, ii, ii + 1, GTK_FILL, GTK_FILL, 0, 3); - if (e_msg_composer_get_lite () && ii == E_COMPOSER_HEADER_TO) { - GtkWidget *box = gtk_hbox_new (FALSE, 0); - g_object_set_data ( - G_OBJECT (priv->headers[ii]->input_widget), - "parent", object); - gtk_box_pack_start ( - GTK_BOX (box), priv->headers[ii]->input_widget, - TRUE, TRUE, 3); - gtk_box_pack_start ( - GTK_BOX (box), - GTK_WIDGET (priv->actions_container), - FALSE, FALSE, 0); - gtk_widget_show (box); - gtk_table_attach ( - GTK_TABLE (object), box, 1, 4, ii, ii + 1, - GTK_FILL | GTK_EXPAND, 0, 0, 3); - - } else { - gtk_table_attach ( - GTK_TABLE (object), - priv->headers[ii]->input_widget, 1, 4, - ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, 3); - } - if (e_msg_composer_get_lite () && priv->headers[ii]->action_widget) { - /* Pack the widgets to the end. Helps formatting - * when hiding the From field. */ - gtk_box_pack_end ( - GTK_BOX (priv->actions_container), - priv->headers[ii]->action_widget, - FALSE, FALSE, 6); - } + gtk_table_attach ( + GTK_TABLE (object), + priv->headers[ii]->input_widget, 1, 4, + ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, 3); } - if (e_msg_composer_get_lite ()) - gtk_widget_show_all ((GtkWidget *)priv->actions_container); ii = E_COMPOSER_HEADER_FROM; /* Leave room in the "From" row for signature stuff. */ @@ -953,9 +919,7 @@ composer_header_table_init (EComposerHeaderTable *table) name_selector = e_name_selector_new (); table->priv->name_selector = name_selector; - table->priv->actions_container = (GtkHBox *)gtk_hbox_new (FALSE, 6); - - header = e_composer_from_header_new_with_action (_("Fr_om:"), _("From")); + header = e_composer_from_header_new (_("Fr_om:")); composer_header_table_bind_header ("account", "changed", header); composer_header_table_bind_header ("account-list", "refreshed", header); composer_header_table_bind_header ("account-name", "changed", header); @@ -964,24 +928,21 @@ composer_header_table_init (EComposerHeaderTable *table) composer_header_table_from_changed_cb), table); table->priv->headers[E_COMPOSER_HEADER_FROM] = header; - header = e_composer_text_header_new_label (_("_Reply-To:"), ""); + header = e_composer_text_header_new_label (_("_Reply-To:")); composer_header_table_bind_header ("reply-to", "changed", header); table->priv->headers[E_COMPOSER_HEADER_REPLY_TO] = header; - header = e_composer_name_header_new_with_label ( - _("_To:"), name_selector); + header = e_composer_name_header_new (_("_To:"), name_selector); e_composer_header_set_input_tooltip (header, HEADER_TOOLTIP_TO); composer_header_table_bind_header ("destinations-to", "changed", header); table->priv->headers[E_COMPOSER_HEADER_TO] = header; - header = e_composer_name_header_new_with_action ( - _("_Cc:"), _("CC"), name_selector); + header = e_composer_name_header_new (_("_Cc:"), name_selector); e_composer_header_set_input_tooltip (header, HEADER_TOOLTIP_CC); composer_header_table_bind_header ("destinations-cc", "changed", header); table->priv->headers[E_COMPOSER_HEADER_CC] = header; - header = e_composer_name_header_new_with_action ( - _("_Bcc:"), _("BCC"), name_selector); + header = e_composer_name_header_new (_("_Bcc:"), name_selector); e_composer_header_set_input_tooltip (header, HEADER_TOOLTIP_BCC); composer_header_table_bind_header ("destinations-bcc", "changed", header); table->priv->headers[E_COMPOSER_HEADER_BCC] = header; @@ -990,7 +951,7 @@ composer_header_table_init (EComposerHeaderTable *table) composer_header_table_bind_header ("post-to", "changed", header); table->priv->headers[E_COMPOSER_HEADER_POST_TO] = header; - header = e_composer_text_header_new_label (_("S_ubject:"), NULL); + header = e_composer_text_header_new_label (_("S_ubject:")); composer_header_table_bind_header ("subject", "changed", header); table->priv->headers[E_COMPOSER_HEADER_SUBJECT] = header; diff --git a/composer/e-composer-header.c b/composer/e-composer-header.c index d61f44a2ed..34c2c0c451 100644 --- a/composer/e-composer-header.c +++ b/composer/e-composer-header.c @@ -32,8 +32,6 @@ enum { PROP_0, PROP_BUTTON, PROP_LABEL, - PROP_ADDACTION, - PROP_ADDACTION_TEXT, PROP_SENSITIVE, PROP_VISIBLE }; @@ -47,8 +45,6 @@ enum { struct _EComposerHeaderPrivate { gchar *label; gboolean button; - gchar *addaction_text; - gboolean addaction; /*For Add button.*/ GtkWidget *action_label; GtkWidget *add_icon; @@ -71,15 +67,6 @@ composer_header_button_clicked_cb (GtkButton *button, g_signal_emit (header, signal_ids[CLICKED], 0); } -static void -composer_header_addaction_clicked_cb (GtkButton *button, - EComposerHeader *header) -{ - gboolean show = !e_composer_header_get_visible(header); - - e_composer_header_set_visible (header, show); -} - static GObject * composer_header_constructor (GType type, guint n_construct_properties, @@ -109,44 +96,6 @@ composer_header_constructor (GType type, } header->priv->action_label = NULL; - if (header->priv->addaction) { - GtkWidget *box, *tmp; - gchar *str; - - header->priv->action_label = gtk_label_new (NULL); - header->action_widget = gtk_button_new (); - box = gtk_hbox_new (FALSE, 0); - tmp = gtk_image_new_from_stock ( - GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON); - header->priv->add_icon = tmp; - gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3); - tmp = gtk_image_new_from_stock ( - GTK_STOCK_REMOVE, GTK_ICON_SIZE_BUTTON); - header->priv->remove_icon = tmp; - gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3); - tmp = gtk_label_new (NULL); - str = g_strdup_printf ( - "%s %s", _("Show"), - header->priv->addaction_text); - gtk_label_set_markup((GtkLabel *)tmp, str); - g_free (str); - header->priv->show_label = tmp; - gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3); - tmp = gtk_label_new (NULL); - str = g_strdup_printf ( - "%s %s", _("Hide"), - header->priv->addaction_text); - gtk_label_set_markup((GtkLabel *)tmp, str); - header->priv->hide_label = tmp; - gtk_box_pack_start((GtkBox *)box, tmp, FALSE, FALSE, 3); - - gtk_container_add((GtkContainer *)header->action_widget, box); - gtk_widget_show_all(header->action_widget); - g_signal_connect ( - header->action_widget, "clicked", - G_CALLBACK (composer_header_addaction_clicked_cb), - header); - } header->title_widget = g_object_ref_sink (widget); @@ -171,14 +120,6 @@ composer_header_set_property (GObject *object, priv->button = g_value_get_boolean (value); return; - case PROP_ADDACTION: /* construct only */ - priv->addaction = g_value_get_boolean (value); - return; - - case PROP_ADDACTION_TEXT:/* construct only */ - priv->addaction_text = g_value_dup_string (value); - return; - case PROP_LABEL: /* construct only */ priv->label = g_value_dup_string (value); return; @@ -214,15 +155,6 @@ composer_header_get_property (GObject *object, g_value_set_boolean (value, priv->button); return; - case PROP_ADDACTION: /* construct only */ - g_value_set_boolean (value, priv->button); - return; - - case PROP_ADDACTION_TEXT: /* construct only */ - g_value_take_string ( - value, priv->addaction_text); - return; - case PROP_LABEL: /* construct only */ g_value_take_string ( value, e_composer_header_get_label ( @@ -289,28 +221,6 @@ composer_header_class_init (EComposerHeaderClass *class) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property ( - object_class, - PROP_ADDACTION, - g_param_spec_boolean ( - "addaction", - NULL, - NULL, - FALSE, - G_PARAM_READWRITE | - G_PARAM_CONSTRUCT_ONLY)); - - g_object_class_install_property ( - object_class, - PROP_ADDACTION_TEXT, - g_param_spec_string ( - "addaction_text", - NULL, - NULL, - NULL, - G_PARAM_READWRITE | - G_PARAM_CONSTRUCT_ONLY)); - g_object_class_install_property ( object_class, PROP_LABEL, diff --git a/composer/e-composer-header.h b/composer/e-composer-header.h index 044425b47f..971b55968c 100644 --- a/composer/e-composer-header.h +++ b/composer/e-composer-header.h @@ -49,7 +49,6 @@ struct _EComposerHeader { GObject parent; GtkWidget *title_widget; GtkWidget *input_widget; - GtkWidget *action_widget; EComposerHeaderPrivate *priv; }; diff --git a/composer/e-composer-name-header.c b/composer/e-composer-name-header.c index 658e7cc292..aaa253b9c1 100644 --- a/composer/e-composer-name-header.c +++ b/composer/e-composer-name-header.c @@ -297,30 +297,6 @@ e_composer_name_header_new (const gchar *label, "button", !e_msg_composer_get_lite(), "name-selector", name_selector, NULL); } -EComposerHeader * -e_composer_name_header_new_with_label (const gchar *label, - ENameSelector *name_selector) -{ - return g_object_new ( - E_TYPE_COMPOSER_NAME_HEADER, "label", label, - "button", !e_msg_composer_get_lite(), "name-selector", name_selector, - "addaction", FALSE, "visible", TRUE, NULL); -} - -EComposerHeader * -e_composer_name_header_new_with_action (const gchar *label, - const gchar *action_label, - ENameSelector *name_selector) -{ - g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL); - - return g_object_new ( - E_TYPE_COMPOSER_NAME_HEADER, "label", label, - "button", !e_msg_composer_get_lite(), "name-selector", name_selector, - "addaction_text", action_label, - "addaction", action_label != NULL, NULL); -} - ENameSelector * e_composer_name_header_get_name_selector (EComposerNameHeader *header) { diff --git a/composer/e-composer-name-header.h b/composer/e-composer-name-header.h index 100d6c8980..785f7d11e8 100644 --- a/composer/e-composer-name-header.h +++ b/composer/e-composer-name-header.h @@ -62,14 +62,6 @@ struct _EComposerNameHeaderClass { GType e_composer_name_header_get_type (void); EComposerHeader * e_composer_name_header_new (const gchar *label, ENameSelector *name_selector); -/*No button. Just a label.*/ -EComposerHeader * e_composer_name_header_new_with_label (const gchar *label, - ENameSelector *name_selector); - -/*No button. Label with a Link button for show/hide.*/ -EComposerHeader * e_composer_name_header_new_with_action (const gchar *label, - const gchar *action, - ENameSelector *name_selector); ENameSelector * e_composer_name_header_get_name_selector (EComposerNameHeader *header); diff --git a/composer/e-composer-text-header.c b/composer/e-composer-text-header.c index e765237a2d..efbf141cea 100644 --- a/composer/e-composer-text-header.c +++ b/composer/e-composer-text-header.c @@ -108,23 +108,21 @@ e_composer_text_header_get_type (void) } EComposerHeader * -e_composer_text_header_new_label (const gchar *label, const gchar *action_label) +e_composer_text_header_new_label (const gchar *label) { - return g_object_new ( - E_TYPE_COMPOSER_TEXT_HEADER, "label", label, - "button", FALSE, "addaction", action_label && *action_label, - "addaction_text", action_label, - "visible", action_label == NULL, NULL); + return g_object_new (E_TYPE_COMPOSER_TEXT_HEADER, + "label", label, + "button", FALSE, + NULL); } EComposerHeader * -e_composer_text_header_new_button (const gchar *label, const gchar *action_label) +e_composer_text_header_new_button (const gchar *label) { - return g_object_new ( - E_TYPE_COMPOSER_TEXT_HEADER, "label", label, - "button", TRUE, "addaction", action_label != NULL, - "addaction_text", action_label, - "visible", action_label == NULL, NULL); + return g_object_new (E_TYPE_COMPOSER_TEXT_HEADER, + "label", label, + "button", TRUE, + NULL); } const gchar * diff --git a/composer/e-composer-text-header.h b/composer/e-composer-text-header.h index 74fb86f9b0..278b2b1116 100644 --- a/composer/e-composer-text-header.h +++ b/composer/e-composer-text-header.h @@ -59,10 +59,10 @@ struct _EComposerTextHeaderClass { GType e_composer_text_header_get_type (void); EComposerHeader * -e_composer_text_header_new_label (const gchar *label, const gchar *action_label); +e_composer_text_header_new_label (const gchar *label); EComposerHeader * -e_composer_text_header_new_button (const gchar *label, const gchar *action_label); +e_composer_text_header_new_button (const gchar *label); const gchar * e_composer_text_header_get_text (EComposerTextHeader *header); void e_composer_text_header_set_text (EComposerTextHeader *header, -- cgit v1.2.3 From 9a6064142f77c7ca112424bad68ddc5dd6d63d8f Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Mon, 3 May 2010 16:54:35 -0500 Subject: Always show a button in the label of name selectors This is so that the address picker will be available; there is no good reason to hide it. This basically reverts commit 70c799f348cc366668cac2510294f68fb5d8f6a8 Signed-off-by: Federico Mena Quintero --- composer/e-composer-name-header.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-name-header.c b/composer/e-composer-name-header.c index aaa253b9c1..39e079a790 100644 --- a/composer/e-composer-name-header.c +++ b/composer/e-composer-name-header.c @@ -292,9 +292,11 @@ e_composer_name_header_new (const gchar *label, { g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL); - return g_object_new ( - E_TYPE_COMPOSER_NAME_HEADER, "label", label, - "button", !e_msg_composer_get_lite(), "name-selector", name_selector, NULL); + return g_object_new (E_TYPE_COMPOSER_NAME_HEADER, + "label", label, + "button", TRUE, + "name-selector", name_selector, + NULL); } ENameSelector * -- cgit v1.2.3 From e92669121800419e63c903d446548e25362f0606 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Mon, 3 May 2010 17:18:52 -0500 Subject: Right-align the labels of the composer's headers This is so that the colons of the labels will align vertically. Although the labels inside buttons don't align 100% perfectly with the buttonless labels, this looks good enough for now, and certainly much better than all-centered labels. Signed-off-by: Federico Mena Quintero --- composer/e-composer-header.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-header.c b/composer/e-composer-header.c index 34c2c0c451..4c968d43d8 100644 --- a/composer/e-composer-header.c +++ b/composer/e-composer-header.c @@ -75,6 +75,7 @@ composer_header_constructor (GType type, GObject *object; GtkWidget *widget; EComposerHeader *header; + GtkWidget *label; /* Chain up to parent's constructor() method. */ object = G_OBJECT_CLASS (parent_class)->constructor ( @@ -89,12 +90,15 @@ composer_header_constructor (GType type, widget, "clicked", G_CALLBACK (composer_header_button_clicked_cb), header); + label = gtk_bin_get_child (GTK_BIN (widget)); } else { widget = gtk_label_new_with_mnemonic (header->priv->label); - gtk_label_set_mnemonic_widget ( - GTK_LABEL (widget), header->input_widget); + gtk_label_set_mnemonic_widget (GTK_LABEL (widget), header->input_widget); + label = widget; } + gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5); + header->priv->action_label = NULL; header->title_widget = g_object_ref_sink (widget); -- cgit v1.2.3 From 6dce401d7379e8b5724bccde1f731de65435089f Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 4 May 2010 15:40:31 -0500 Subject: Remove the 'View From' menu item from the composer Now the From header will only be shown if you have more than one mail account. Signed-off-by: Federico Mena Quintero --- composer/e-composer-actions.c | 8 -------- composer/e-composer-actions.h | 2 -- composer/e-composer-private.c | 4 ---- composer/evolution-composer.ui | 1 - 4 files changed, 15 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c index 0c1a28b130..70f7c44ed9 100644 --- a/composer/e-composer-actions.c +++ b/composer/e-composer-actions.c @@ -420,14 +420,6 @@ static GtkToggleActionEntry toggle_entries[] = { NULL, /* Handled by property bindings */ FALSE }, - { "view-from", - NULL, - N_("_From Field"), - NULL, - N_("Toggles whether the From chooser is displayed"), - NULL, /* Handled by property bindings */ - FALSE }, - { "view-reply-to", NULL, N_("_Reply-To Field"), diff --git a/composer/e-composer-actions.h b/composer/e-composer-actions.h index 18c75eb3be..80147a8f24 100644 --- a/composer/e-composer-actions.h +++ b/composer/e-composer-actions.h @@ -57,8 +57,6 @@ E_COMPOSER_ACTION ((composer), "view-bcc") #define E_COMPOSER_ACTION_VIEW_CC(composer) \ E_COMPOSER_ACTION ((composer), "view-cc") -#define E_COMPOSER_ACTION_VIEW_FROM(composer) \ - E_COMPOSER_ACTION ((composer), "view-from") #define E_COMPOSER_ACTION_VIEW_REPLY_TO(composer) \ E_COMPOSER_ACTION ((composer), "view-reply-to") diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c index ba022f3972..293393cf35 100644 --- a/composer/e-composer-private.c +++ b/composer/e-composer-private.c @@ -351,10 +351,6 @@ e_composer_private_constructed (EMsgComposer *composer) action = ACTION (VIEW_CC); break; - case E_COMPOSER_HEADER_FROM: - action = ACTION (VIEW_FROM); - break; - case E_COMPOSER_HEADER_REPLY_TO: action = ACTION (VIEW_REPLY_TO); break; diff --git a/composer/evolution-composer.ui b/composer/evolution-composer.ui index 3b1fee7a72..f283d35dcb 100644 --- a/composer/evolution-composer.ui +++ b/composer/evolution-composer.ui @@ -22,7 +22,6 @@ - -- cgit v1.2.3 From ac2ef9fb41e51292b379c6dee62dd765f783dae0 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 4 May 2010 13:39:23 -0500 Subject: Hide the From header if only one account is set up This lets us save vertical space in the mail composer in the common case where the user has only a single email account configured - then he doesn't need to choose which account to send from. Signed-off-by: Federico Mena Quintero --- composer/e-composer-header-table.c | 44 ++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 9 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c index f8ea8df272..8a252c66e2 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -276,6 +276,27 @@ skip_custom: return new_destinations; } +static int +count_from_accounts (EComposerHeaderTable *table) +{ + EComposerHeader *header; + EAccountComboBox *combo_box; + + header = e_composer_header_table_get_header (table, E_COMPOSER_HEADER_FROM); + combo_box = E_ACCOUNT_COMBO_BOX (header->input_widget); + + return e_account_combo_box_count_displayed_accounts (combo_box); +} + +static gboolean +from_header_should_be_visible (EComposerHeaderTable *table) +{ + int num_accounts; + + num_accounts = count_from_accounts (table); + return (num_accounts > 1); +} + static void composer_header_table_setup_mail_headers (EComposerHeaderTable *table) { @@ -288,6 +309,8 @@ composer_header_table_setup_mail_headers (EComposerHeaderTable *table) EComposerHeader *header; const gchar *key; guint binding_id; + gboolean sensitive; + gboolean visible; binding_id = table->priv->gconf_bindings[ii]; header = e_composer_header_table_get_header (table, ii); @@ -304,10 +327,6 @@ composer_header_table_setup_mail_headers (EComposerHeaderTable *table) key = COMPOSER_GCONF_PREFIX "/show_mail_cc"; break; - case E_COMPOSER_HEADER_FROM: - key = COMPOSER_GCONF_PREFIX "/show_mail_from"; - break; - case E_COMPOSER_HEADER_REPLY_TO: key = COMPOSER_GCONF_PREFIX "/show_mail_reply_to"; break; @@ -318,22 +337,29 @@ composer_header_table_setup_mail_headers (EComposerHeaderTable *table) } switch (ii) { + case E_COMPOSER_HEADER_FROM: + sensitive = TRUE; + visible = from_header_should_be_visible (table); + break; + case E_COMPOSER_HEADER_BCC: case E_COMPOSER_HEADER_CC: - case E_COMPOSER_HEADER_FROM: case E_COMPOSER_HEADER_REPLY_TO: case E_COMPOSER_HEADER_SUBJECT: case E_COMPOSER_HEADER_TO: - e_composer_header_set_sensitive (header, TRUE); - e_composer_header_set_visible (header, TRUE); + sensitive = TRUE; + visible = TRUE; break; default: - e_composer_header_set_sensitive (header, FALSE); - e_composer_header_set_visible (header, FALSE); + sensitive = FALSE; + visible = FALSE; break; } + e_composer_header_set_sensitive (header, sensitive); + e_composer_header_set_visible (header, visible); + if (key != NULL) binding_id = gconf_bridge_bind_property ( bridge, key, G_OBJECT (header), "visible"); -- cgit v1.2.3 From f9352579b48ee7a697979e3f7043399097652cd9 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 7 May 2010 15:03:03 -0500 Subject: Use the lite-composer when the shell is in small-screen mode Remove various utility functions that conditionally create a lite composer, and just use the normal functions to create a composer. The composer will know by itself whether it needs to adjust for small screens. Signed-off-by: Federico Mena Quintero --- composer/e-msg-composer.c | 32 +++++++++++--------------------- composer/e-msg-composer.h | 2 -- 2 files changed, 11 insertions(+), 23 deletions(-) (limited to 'composer') diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 888705d0d1..e5d21862f0 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -85,8 +85,6 @@ enum { LAST_SIGNAL }; -gboolean composer_lite = FALSE; - static gpointer parent_class; static guint signals[LAST_SIGNAL]; @@ -2198,29 +2196,21 @@ e_msg_composer_new (void) "html", e_web_view_new (), NULL); } -void -e_msg_composer_set_lite (void) -{ - composer_lite = TRUE; -} - +/** + * e_msg_composer_get_lite: + * + * Used within the composer to see if it should be made suitable for small + * screens. + * + * Return value: whether the surrounding #EShell is in small screen mode. + */ gboolean e_msg_composer_get_lite (void) { - return composer_lite; -} - -EMsgComposer * -e_msg_composer_lite_new (void) -{ - EMsgComposer *composer; - - /* Init lite-composer for ever for the session */ - composer_lite = TRUE; - - composer = e_msg_composer_new (); + EShell *shell; - return composer; + shell = e_shell_get_default (); + return e_shell_get_small_screen_mode (shell); } EFocusTracker * diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h index 19f21b7df2..884b077862 100644 --- a/composer/e-msg-composer.h +++ b/composer/e-msg-composer.h @@ -71,9 +71,7 @@ struct _EMsgComposerClass { GType e_msg_composer_get_type (void); EMsgComposer * e_msg_composer_new (void); -void e_msg_composer_set_lite (void); gboolean e_msg_composer_get_lite (void); -EMsgComposer * e_msg_composer_lite_new (void); EMsgComposer * e_msg_composer_new_with_message (CamelMimeMessage *msg); EMsgComposer * e_msg_composer_new_from_url (const gchar *url); EMsgComposer * e_msg_composer_new_redirect (CamelMimeMessage *message, -- cgit v1.2.3 From 5b75d85a0c6f76a8c13bfdc335fdffd14272a6fc Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 7 May 2010 15:47:57 -0500 Subject: Pack the header-table's headers closer together for small screens Signed-off-by: Federico Mena Quintero --- composer/e-composer-header-table.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c index 8a252c66e2..b7f2e8e437 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -502,6 +502,17 @@ composer_header_table_from_changed_cb (EComposerHeaderTable *table) composer_header_table_setup_mail_headers (table); } +static int +get_row_padding (void) +{ + /* For small screens, make the header-table's rows be packed closely together */ + + if (e_msg_composer_get_lite ()) + return 0; + else + return 3; +} + static GObject * composer_header_table_constructor (GType type, guint n_construct_properties, @@ -510,6 +521,7 @@ composer_header_table_constructor (GType type, GObject *object; EComposerHeaderTablePrivate *priv; guint rows, ii; + int row_padding; /* Chain up to parent's constructor() method. */ object = G_OBJECT_CLASS (parent_class)->constructor ( @@ -525,14 +537,16 @@ composer_header_table_constructor (GType type, /* Use "ypadding" instead of "row-spacing" because some rows may * be invisible and we don't want spacing around them. */ + row_padding = get_row_padding (); + for (ii = 0; ii < rows; ii++) { gtk_table_attach ( GTK_TABLE (object), priv->headers[ii]->title_widget, - 0, 1, ii, ii + 1, GTK_FILL, GTK_FILL, 0, 3); + 0, 1, ii, ii + 1, GTK_FILL, GTK_FILL, 0, row_padding); gtk_table_attach ( GTK_TABLE (object), priv->headers[ii]->input_widget, 1, 4, - ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, 3); + ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, row_padding); } ii = E_COMPOSER_HEADER_FROM; @@ -555,10 +569,10 @@ composer_header_table_constructor (GType type, if (!e_msg_composer_get_lite ()) { gtk_table_attach ( GTK_TABLE (object), priv->signature_label, - 2, 3, ii, ii + 1, 0, 0, 0, 3); + 2, 3, ii, ii + 1, 0, 0, 0, row_padding); gtk_table_attach ( GTK_TABLE (object), priv->signature_combo_box, - 3, 4, ii, ii + 1, e_msg_composer_get_lite () ? GTK_FILL: 0, 0, 0, 3); + 3, 4, ii, ii + 1, e_msg_composer_get_lite () ? GTK_FILL: 0, 0, 0, row_padding); } else { GtkWidget *box = gtk_hbox_new (FALSE, 0); @@ -571,7 +585,7 @@ composer_header_table_constructor (GType type, g_object_set_data (G_OBJECT (box), "pdata", object); gtk_table_attach ( GTK_TABLE (object), box, - 3, 4, ii, ii + 1, GTK_FILL, 0, 0, 3); + 3, 4, ii, ii + 1, GTK_FILL, 0, 0, row_padding); gtk_widget_hide (box); } -- cgit v1.2.3 From 20cb61bd444cc8db3c1188b15af99886c84c140e Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 7 May 2010 20:20:09 -0500 Subject: Don't hide the composer's menu bar in lite mode We are not ready to hide it just yet, as there are useful commands there that are not available from the composer's other widgets. Signed-off-by: Federico Mena Quintero --- composer/e-composer-private.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'composer') diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c index 293393cf35..5fbf7cdb86 100644 --- a/composer/e-composer-private.c +++ b/composer/e-composer-private.c @@ -146,8 +146,17 @@ e_composer_private_constructed (EMsgComposer *composer) ui_manager = gtkhtml_editor_get_ui_manager (editor); if (e_msg_composer_get_lite ()) { +#if 0 + /* In the lite composer, for small screens, we are not ready yet + * to hide the menubar. It still has useful items like the ones + * to show/hide the various header fields, plus the security options. + * + * When we move those options out of the menu and into the composer's + * toplevel, we can probably get rid of the menu. + */ widget = gtkhtml_editor_get_managed_widget (editor, "/main-menu"); gtk_widget_hide (widget); +#endif widget = gtkhtml_editor_get_managed_widget (editor, "/main-toolbar"); gtk_toolbar_set_style (GTK_TOOLBAR (widget), GTK_TOOLBAR_BOTH_HORIZ); gtk_widget_hide (widget); @@ -244,7 +253,7 @@ e_composer_private_constructed (EMsgComposer *composer) gtk_container_set_border_width (GTK_CONTAINER (widget), 6); gtk_box_pack_start (GTK_BOX (editor->vbox), widget, FALSE, FALSE, 0); if (e_msg_composer_get_lite ()) - gtk_box_reorder_child (GTK_BOX (editor->vbox), widget, 0); + gtk_box_reorder_child (GTK_BOX (editor->vbox), widget, 1); else gtk_box_reorder_child (GTK_BOX (editor->vbox), widget, 2); -- cgit v1.2.3 From d3c7420fb977fe5c337f2c917839a6e982a47902 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 21 May 2010 16:25:26 +0100 Subject: get the composer dialog size right on MeeGo --- composer/e-msg-composer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'composer') diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index e5d21862f0..dfcd5b924d 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1640,7 +1640,8 @@ msg_composer_constructed (GObject *object) gtk_window_set_title (GTK_WINDOW (composer), _("Compose Message")); gtk_window_set_icon_name (GTK_WINDOW (composer), "mail-message-new"); - + + e_shell_adapt_window_size (shell, GTK_WINDOW (composer)); e_shell_watch_window (shell, GTK_WINDOW (object)); /* Restore Persistent State */ -- cgit v1.2.3 From 6139fb4d0b5e8f820df338be61d307b5c2782a57 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 21 May 2010 17:33:59 +0200 Subject: Bug #617557 - Quits without asking user to save unfinished messages --- composer/e-msg-composer.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'composer') diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index dc50fad5ad..cf10578af0 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1605,6 +1605,17 @@ msg_composer_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); } +static gboolean +msg_composer_delete_event_cb (GtkWidget *widget, gpointer user_data) +{ + /* This is needed for the ACTION macro. */ + EMsgComposer *composer = E_MSG_COMPOSER (widget); + + gtk_action_activate (ACTION (CLOSE)); + + return FALSE; +} + static void msg_composer_constructed (GObject *object) { @@ -1643,6 +1654,9 @@ msg_composer_constructed (GObject *object) gtk_window_set_title (GTK_WINDOW (composer), _("Compose Message")); gtk_window_set_icon_name (GTK_WINDOW (composer), "mail-message-new"); + g_signal_connect (object, "delete-event", + G_CALLBACK (msg_composer_delete_event_cb), NULL); + e_shell_watch_window (shell, GTK_WINDOW (object)); /* Restore Persistent State */ @@ -1801,18 +1815,6 @@ msg_composer_map (GtkWidget *widget) gtkhtml_editor_run_command (GTKHTML_EDITOR (widget), "grab-focus"); } -static gint -msg_composer_delete_event (GtkWidget *widget, - GdkEventAny *event) -{ - /* This is needed for the ACTION macro. */ - EMsgComposer *composer = E_MSG_COMPOSER (widget); - - gtk_action_activate (ACTION (CLOSE)); - - return TRUE; -} - static gboolean msg_composer_key_press_event (GtkWidget *widget, GdkEventKey *event) @@ -2094,7 +2096,6 @@ msg_composer_class_init (EMsgComposerClass *class) widget_class = GTK_WIDGET_CLASS (class); widget_class->map = msg_composer_map; - widget_class->delete_event = msg_composer_delete_event; widget_class->key_press_event = msg_composer_key_press_event; widget_class->drag_motion = msg_composer_drag_motion; widget_class->drag_data_received = msg_composer_drag_data_received; -- cgit v1.2.3 From 96538878911586a9e9ca26b81e1916c04e538980 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 25 May 2010 10:15:32 -0400 Subject: Coding style and whitespace cleanup. --- composer/e-composer-header-table.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c index b7f2e8e437..98b004d616 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -276,7 +276,7 @@ skip_custom: return new_destinations; } -static int +static gint count_from_accounts (EComposerHeaderTable *table) { EComposerHeader *header; @@ -291,7 +291,7 @@ count_from_accounts (EComposerHeaderTable *table) static gboolean from_header_should_be_visible (EComposerHeaderTable *table) { - int num_accounts; + gint num_accounts; num_accounts = count_from_accounts (table); return (num_accounts > 1); @@ -502,7 +502,7 @@ composer_header_table_from_changed_cb (EComposerHeaderTable *table) composer_header_table_setup_mail_headers (table); } -static int +static gint get_row_padding (void) { /* For small screens, make the header-table's rows be packed closely together */ @@ -521,7 +521,7 @@ composer_header_table_constructor (GType type, GObject *object; EComposerHeaderTablePrivate *priv; guint rows, ii; - int row_padding; + gint row_padding; /* Chain up to parent's constructor() method. */ object = G_OBJECT_CLASS (parent_class)->constructor ( -- cgit v1.2.3