X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-msg-edit-window.c;h=ea9a00d0705d221a0d319e30abe275d5bb30eb7b;hb=0ca412c0351f777d1fb3e3ff12317a3068b01642;hp=910379e1e177feb8d37f3f4e554c978245db6e0f;hpb=006c77c50703143ddf6f7d8962e6ac08575ccfe9;p=modest diff --git a/src/widgets/modest-msg-edit-window.c b/src/widgets/modest-msg-edit-window.c index 910379e..ea9a00d 100644 --- a/src/widgets/modest-msg-edit-window.c +++ b/src/widgets/modest-msg-edit-window.c @@ -346,6 +346,8 @@ struct _ModestMsgEditWindowPrivate { GtkWidget *brand_icon; GtkWidget *brand_label; GtkWidget *brand_container; + + TnyList *custom_header_pairs; }; #define MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), \ @@ -475,6 +477,7 @@ modest_msg_edit_window_init (ModestMsgEditWindow *obj) priv->references = NULL; priv->in_reply_to = NULL; priv->max_chars_banner = NULL; + priv->custom_header_pairs = TNY_LIST (tny_simple_list_new ()); if (!is_wp_text_buffer_started) { is_wp_text_buffer_started = TRUE; @@ -1057,15 +1060,14 @@ init_window (ModestMsgEditWindow *obj) NULL); gtk_widget_set_no_show_all (priv->isearch_toolbar, TRUE); -/* g_signal_connect (G_OBJECT (obj), "key_pressed", G_CALLBACK (on_key_pressed), NULL) */ - priv->scrollable = modest_toolkit_factory_create_scrollable (modest_runtime_get_toolkit_factory ()); g_object_set (G_OBJECT (priv->scrollable), "horizontal-policy", GTK_POLICY_NEVER, NULL); - + main_vbox = gtk_vbox_new (FALSE, DEFAULT_MAIN_VBOX_SPACING); window_align = gtk_alignment_new (0.0, 0.0, 1.0, 1.0); - gtk_alignment_set_padding (GTK_ALIGNMENT (window_align), 0, 0, MODEST_MARGIN_DOUBLE, MODEST_MARGIN_DEFAULT); + gtk_alignment_set_padding (GTK_ALIGNMENT (window_align), MODEST_MARGIN_HALF, 0, + MODEST_MARGIN_DOUBLE, MODEST_MARGIN_DEFAULT); gtk_box_pack_start (GTK_BOX(main_vbox), priv->header_box, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX(main_vbox), priv->msg_body, TRUE, TRUE, 0); @@ -1073,14 +1075,20 @@ init_window (ModestMsgEditWindow *obj) modest_scrollable_add_with_viewport (MODEST_SCROLLABLE (priv->scrollable), window_align); gtk_widget_show_all (GTK_WIDGET(priv->scrollable)); - + window_box = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER(obj), window_box); gtk_box_pack_start (GTK_BOX (window_box), priv->scrollable, TRUE, TRUE, 0); + /* Set window icon */ + window_icon = modest_platform_get_icon (MODEST_APP_MSG_EDIT_ICON, MODEST_ICON_SIZE_BIG); + if (window_icon) { + gtk_window_set_icon (GTK_WINDOW (obj), window_icon); + g_object_unref (window_icon); + } } - + static void modest_msg_edit_window_disconnect_signals (ModestWindow *window) { @@ -1109,6 +1117,8 @@ modest_msg_edit_window_finalize (GObject *obj) { ModestMsgEditWindowPrivate *priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (obj); + g_object_unref (priv->custom_header_pairs); + if (priv->max_chars_banner) { g_object_weak_unref (G_OBJECT (priv->max_chars_banner), (GWeakNotify) max_chars_banner_unref, obj); priv->max_chars_banner = FALSE; @@ -1765,6 +1775,9 @@ modest_msg_edit_window_setup_toolbar (ModestMsgEditWindow *window) tool_item = gtk_ui_manager_get_widget (parent_priv->ui_manager, "/ToolBar/ActionsItalics"); gtk_tool_item_set_expand (GTK_TOOL_ITEM (tool_item), TRUE); gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (tool_item), TRUE); + tool_item = gtk_ui_manager_get_widget (parent_priv->ui_manager, "/ToolBar/ActionsInsertImage"); + gtk_tool_item_set_expand (GTK_TOOL_ITEM (tool_item), TRUE); + gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (tool_item), TRUE); /* Explicitelly show all the toolbar (a normal gtk_widget_show will not show the tool items added to the placeholders) */ @@ -1772,7 +1785,7 @@ modest_msg_edit_window_setup_toolbar (ModestMsgEditWindow *window) /* Set the no show all *after* showing all items. We do not want the toolbar to be shown with a show all because it - could go agains the gconf setting regarding showing or not + could go against the gconf setting regarding showing or not the toolbar of the editor window */ gtk_widget_set_no_show_all (parent_priv->toolbar, TRUE); } @@ -2027,6 +2040,7 @@ modest_msg_edit_window_get_msg_data (ModestMsgEditWindow *edit_window) g_object_unref (att_iter); data->priority_flags = priv->priority_flags; + data->custom_header_pairs = tny_list_copy (priv->custom_header_pairs); return data; } @@ -2059,6 +2073,8 @@ modest_msg_edit_window_free_msg_data (ModestMsgEditWindow *edit_window, g_free (data->account_name); g_free (data->references); g_free (data->in_reply_to); + + g_object_unref (data->custom_header_pairs); if (data->draft_msg != NULL) { g_object_unref (data->draft_msg); @@ -4841,3 +4857,17 @@ modest_msg_edit_window_has_pending_addresses (ModestMsgEditWindow *self) else return TRUE; } + +void +modest_msg_edit_window_set_custom_header_pairs (ModestMsgEditWindow *self, + TnyList *header_pairs) +{ + ModestMsgEditWindowPrivate *priv = NULL; + + g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (self)); + g_return_if_fail (TNY_IS_LIST (header_pairs)); + + priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (self); + g_object_unref (priv->custom_header_pairs); + priv->custom_header_pairs = tny_list_copy (header_pairs); +}