* all:
[modest] / src / gtk / modest-edit-msg-window.c
index 840366e..4c7afcf 100644 (file)
@@ -132,8 +132,7 @@ save_settings (ModestEditMsgWindow *self)
        priv = MODEST_EDIT_MSG_WINDOW_GET_PRIVATE(self);
        conf = modest_tny_platform_factory_get_modest_conf_instance (priv->fact);
 
-       modest_widget_memory_save_settings (conf, GTK_WIDGET(self),
-                                           "modest-edit-msg-window");
+       modest_widget_memory_save (conf, GTK_WIDGET(self), "modest-edit-msg-window");
 }
 
 
@@ -146,8 +145,7 @@ restore_settings (ModestEditMsgWindow *self)
        priv = MODEST_EDIT_MSG_WINDOW_GET_PRIVATE(self);
        conf = modest_tny_platform_factory_get_modest_conf_instance (priv->fact);
 
-       modest_widget_memory_restore_settings (conf, GTK_WIDGET(self),
-                                              "modest-edit-msg-window");
+       modest_widget_memory_restore (conf, GTK_WIDGET(self), "modest-edit-msg-window");
 }
 
        
@@ -241,19 +239,21 @@ menubar_new (ModestEditMsgWindow *self)
 static void
 send_mail (ModestEditMsgWindow *self)
 {
-       const gchar *from, *to, *cc, *bcc, *subject;
-       gchar *body;
+       const gchar *to, *cc, *bcc, *subject;
+       gchar *body, *from;
        ModestEditMsgWindowPrivate *priv;
        TnyTransportAccount *transport_account;
        ModestMailOperation *mail_operation;
+       ModestAccountData *data;
        
        GtkTextBuffer *buf;
        GtkTextIter b, e;
        
        priv = MODEST_EDIT_MSG_WINDOW_GET_PRIVATE(self);
+       data = modest_combo_box_get_active_id (MODEST_COMBO_BOX (priv->from_field));
 
-       /* don't free these */
-       from    = "djcb@djcbsoftware.nl";
+       /* don't free these (except from) */
+       from    =  g_strdup_printf ("%s <%s>", data->full_name, data->email) ;
        to      =  gtk_entry_get_text (GTK_ENTRY(priv->to_field));
        cc      =  gtk_entry_get_text (GTK_ENTRY(priv->cc_field));
        bcc     =  gtk_entry_get_text (GTK_ENTRY(priv->bcc_field));
@@ -291,13 +291,15 @@ send_mail (ModestEditMsgWindow *self)
                transport_account = TNY_TRANSPORT_ACCOUNT (tny_iterator_get_current(iter));
        }
 
-       mail_operation = modest_mail_operation_new (TNY_ACCOUNT (transport_account));
+       mail_operation = modest_mail_operation_new ();
 
        modest_mail_operation_send_new_mail (mail_operation,
+                                            transport_account,
                                             from, to, cc, bcc,
                                             subject, body, NULL);
        /* Clean up */
        g_object_unref (mail_operation);
+       g_free (from);
        g_free (body);
 }
 
@@ -372,10 +374,10 @@ init_window (ModestEditMsgWindow *obj)
 
        priv->from_field    = modest_widget_factory_get_combo_box (priv->factory,
                                                                   MODEST_COMBO_BOX_TYPE_TRANSPORTS);
-       priv->to_field      = gtk_entry_new_with_max_length (40);
-       priv->cc_field      = gtk_entry_new_with_max_length (40);
-       priv->bcc_field     = gtk_entry_new_with_max_length (40);
-       priv->subject_field = gtk_entry_new_with_max_length (40);
+       priv->to_field      = gtk_entry_new_with_max_length (80);
+       priv->cc_field      = gtk_entry_new_with_max_length (80);
+       priv->bcc_field     = gtk_entry_new_with_max_length (80);
+       priv->subject_field = gtk_entry_new_with_max_length (80);
        
        header_table = gtk_table_new (5,2, FALSE);
        
@@ -481,8 +483,13 @@ modest_edit_msg_window_new (ModestWidgetFactory *factory,
 
                buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW(priv->msg_body));
                gtk_text_buffer_set_text (buf,
-                                         (const gchar *) modest_tny_msg_actions_find_body (msg, FALSE),
+                                         (const gchar *) modest_tny_msg_actions_find_body (msg, TRUE),
                                          -1);
+
+               /* TODO: lower priority, select in the From: combo to
+                  the value that comes from msg */
+
+               /* TODO: set attachments */
        }
 
        return GTK_WIDGET (obj);