Revert "Add bottom send button in editor. It's only shown when the top button is"
[modest] / src / widgets / modest-msg-edit-window.c
index e1a24f3..f33c1f5 100644 (file)
@@ -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;
@@ -1078,12 +1081,6 @@ init_window (ModestMsgEditWindow *obj)
 
        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
@@ -1114,6 +1111,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;
@@ -1397,6 +1396,7 @@ set_msg (ModestMsgEditWindow *self, TnyMsg *msg, gboolean preserve_is_rich)
        TnyFolder *msg_folder;
        gboolean is_html = FALSE;
        gboolean field_view_set;
+       TnyList *orig_header_pairs;
        
        g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (self));
        g_return_if_fail (TNY_IS_MSG (msg));
@@ -1532,6 +1532,11 @@ set_msg (ModestMsgEditWindow *self, TnyMsg *msg, gboolean preserve_is_rich)
                g_object_unref (msg_folder);
        }
 
+       orig_header_pairs = TNY_LIST (tny_simple_list_new ());
+       tny_mime_part_get_header_pairs (TNY_MIME_PART (msg), orig_header_pairs);
+       modest_msg_edit_window_set_custom_header_pairs (self, orig_header_pairs);
+       g_object_unref (orig_header_pairs);
+
        g_free (to);
        g_free (subject);
        g_free (cc);
@@ -2035,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;
 }
@@ -2067,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);
@@ -4849,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);
+}