Build diablo build and fix second line font size and color in maemo and gnome
[modest] / src / maemo / modest-msg-edit-window.c
index d322a21..9fd2947 100644 (file)
@@ -288,6 +288,8 @@ struct _ModestMsgEditWindowPrivate {
        TnyMsg      *draft_msg;
        TnyMsg      *outbox_msg;
        gchar       *msg_uid;
+       gchar       *references;
+       gchar       *in_reply_to;
 
        gboolean    sent;
 };
@@ -425,6 +427,8 @@ modest_msg_edit_window_init (ModestMsgEditWindow *obj)
        priv->draft_msg = NULL;
        priv->outbox_msg = NULL;
        priv->msg_uid = NULL;
+       priv->references = NULL;
+       priv->in_reply_to = NULL;
 
        priv->can_undo = FALSE;
        priv->can_redo = FALSE;
@@ -475,7 +479,7 @@ get_transports (void)
                gchar *from_string  = NULL;
                if (account_name) {
                        from_string = modest_account_mgr_get_from_string (account_mgr,
-                                                                         account_name);
+                                                                         account_name, NULL);
                }
                
                if (from_string && account_name) {
@@ -963,6 +967,8 @@ modest_msg_edit_window_finalize (GObject *obj)
        if (priv->original_account_name)
                g_free (priv->original_account_name);
        g_free (priv->msg_uid);
+       g_free (priv->references);
+       g_free (priv->in_reply_to);
        g_free (priv->last_search);
        g_slist_free (priv->font_items_group);
        g_slist_free (priv->size_items_group);
@@ -1189,6 +1195,7 @@ set_msg (ModestMsgEditWindow *self, TnyMsg *msg, gboolean preserve_is_rich)
                gtk_entry_set_text (GTK_ENTRY(priv->subject_field), subject);
        modest_msg_edit_window_set_priority_flags (MODEST_MSG_EDIT_WINDOW(self),
                                                   priority_flags);
+       modest_tny_msg_get_references (TNY_MSG (msg), NULL, &(priv->references), &(priv->in_reply_to));
 
        update_window_title (self);
 
@@ -1470,7 +1477,10 @@ modest_msg_edit_window_setup_toolbar (ModestMsgEditWindow *window)
 
 
 ModestWindow*
-modest_msg_edit_window_new (TnyMsg *msg, const gchar *account_name, gboolean preserve_is_rich)
+modest_msg_edit_window_new (TnyMsg *msg, 
+                           const gchar *account_name, 
+                           const gchar *mailbox, /* ignored */
+                           gboolean preserve_is_rich)
 {
        GObject *obj;
        ModestWindowPrivate *parent_priv;
@@ -1617,12 +1627,14 @@ modest_msg_edit_window_get_msg_data (ModestMsgEditWindow *edit_window)
        /* don't free these (except from) */
        data = g_slice_new0 (MsgData);
        data->from    =  modest_account_mgr_get_from_string (modest_runtime_get_account_mgr(),
-                                                            account_name);
+                                                            account_name, NULL);
        data->account_name = g_strdup (account_name);
        data->to      =  g_strdup (modest_recpt_editor_get_recipients (MODEST_RECPT_EDITOR (priv->to_field)));
        data->cc      =  g_strdup (modest_recpt_editor_get_recipients (MODEST_RECPT_EDITOR (priv->cc_field)));
        data->bcc     =  g_strdup (modest_recpt_editor_get_recipients (MODEST_RECPT_EDITOR (priv->bcc_field)));
        data->subject =  g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->subject_field)));
+       data->references = g_strdup (priv->references);
+       data->in_reply_to = g_strdup (priv->in_reply_to);
        if (priv->draft_msg) {
                data->draft_msg = g_object_ref (priv->draft_msg);
        } else if (priv->outbox_msg) {
@@ -1722,6 +1734,8 @@ modest_msg_edit_window_free_msg_data (ModestMsgEditWindow *edit_window,
        g_free (data->plain_body);
        g_free (data->html_body);
        g_free (data->account_name);
+       g_free (data->in_reply_to);
+       g_free (data->references);
        
        if (data->draft_msg != NULL) {
                g_object_unref (data->draft_msg);
@@ -2216,7 +2230,8 @@ modest_msg_edit_window_insert_image (ModestMsgEditWindow *window)
 
                        if (stream == NULL) {
 
-                               modest_platform_information_banner (NULL, NULL, dgettext("hildon-fm", "sfil_ib_opening_not_allowed"));
+                               modest_platform_information_banner (NULL, NULL, 
+                                                                   _FM("sfil_ib_opening_not_allowed"));
                                
                                g_object_unref (mime_part);
                                gnome_vfs_file_info_unref (info);
@@ -2372,7 +2387,7 @@ modest_msg_edit_window_attach_file_one (ModestMsgEditWindow *window,
                        size = info->size;
                        if (size > allowed_size) {
                                modest_platform_information_banner (NULL, NULL, 
-                                                                   dgettext("hildon-fm", "sfil_ib_opening_not_allowed"));
+                                                                   _FM("sfil_ib_opening_not_allowed"));
                                return 0;
                        }
                } else
@@ -2382,7 +2397,7 @@ modest_msg_edit_window_attach_file_one (ModestMsgEditWindow *window,
                
                if (stream == NULL) {
 
-                       modest_platform_information_banner (NULL, NULL, dgettext("hildon-fm", "sfil_ib_opening_not_allowed"));
+                       modest_platform_information_banner (NULL, NULL, _FM("sfil_ib_opening_not_allowed"));
 
                        g_object_unref (mime_part);
                        gnome_vfs_file_info_unref (info);
@@ -3344,8 +3359,7 @@ subject_field_insert_text (GtkEditable *editable,
 
        if (result_len + old_length > 1000) {
                hildon_banner_show_information (GTK_WIDGET (window), NULL, 
-                                               dgettext("hildon-common-strings",
-                                                        "ckdg_ib_maximum_characters_reached"));
+                                               _CS("ckdg_ib_maximum_characters_reached"));
        }
        
        g_string_free (result, TRUE);
@@ -3453,7 +3467,8 @@ modest_msg_edit_window_find_toolbar_search (GtkWidget *widget,
                g_free (priv->last_search);
                priv->last_search = NULL;
                /* Information banner about empty search */
-               hildon_banner_show_information (NULL, NULL, dgettext ("hildon-common-strings", "ecdg_ib_find_rep_enter_text"));
+               hildon_banner_show_information (NULL, NULL, 
+                                               _CS ("ecdg_ib_find_rep_enter_text"));
                return;
        }
 
@@ -3469,14 +3484,16 @@ modest_msg_edit_window_find_toolbar_search (GtkWidget *widget,
                result = gtk_text_iter_forward_search_insensitive (&selection_end, current_search, 
                                                                   &match_start, &match_end);
                if (!result)
-                       hildon_banner_show_information (NULL, NULL, dgettext ("hildon-libs", "ckct_ib_find_search_complete"));
+                       hildon_banner_show_information (NULL, NULL, 
+                                                       _HL ("ckct_ib_find_search_complete"));
        } else {
                GtkTextIter buffer_start;
                gtk_text_buffer_get_start_iter (priv->text_buffer, &buffer_start);
                result = gtk_text_iter_forward_search_insensitive (&buffer_start, current_search, 
                                                                   &match_start, &match_end);
                if (!result)
-                       hildon_banner_show_information (NULL, NULL, dgettext ("hildon-libs", "ckct_ib_find_no_matches"));
+                       hildon_banner_show_information (NULL, NULL, 
+                                                       _HL ("ckct_ib_find_no_matches"));
        }
 
        /* Mark as selected the string found in search */
@@ -3664,7 +3681,8 @@ on_zoom_minus_plus_not_implemented (ModestWindow *window)
 {
        g_return_val_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window), FALSE);
 
-       hildon_banner_show_information (NULL, NULL, dgettext("hildon-common-strings", "ckct_ib_cannot_zoom_here"));
+       hildon_banner_show_information (NULL, NULL, 
+                                       _CS("ckct_ib_cannot_zoom_here"));
        return FALSE;
 
 }