* src/modest-ui-actions.c:
authorJose Dapena Paz <jdapena@igalia.com>
Wed, 6 Jun 2007 13:07:00 +0000 (13:07 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Wed, 6 Jun 2007 13:07:00 +0000 (13:07 +0000)
        * Added a blank space in front of signature when it's added
          in a blank message. It makes easier to edit the blank message.
* src/maemo/modest-msg-edit-window.c:
        * Now changing the size also sets the font and text direction.
          Though it shouldn't be related, this makes setting size
          from toolbar work (fixes #56945).

pmo-trunk-r2081

src/maemo/modest-msg-edit-window.c
src/modest-ui-actions.c

index 3a13607..eb3522b 100644 (file)
@@ -1622,11 +1622,15 @@ modest_msg_edit_window_size_change (GtkCheckMenuItem *menu_item,
                gchar *markup;
                WPTextBufferFormat format;
 
+               memset (&format, 0, sizeof (format));
+               wp_text_buffer_get_current_state (WP_TEXT_BUFFER (priv->text_buffer), &format);
+
                label = gtk_bin_get_child (GTK_BIN (menu_item));
                
                new_size_index = atoi (gtk_label_get_text (GTK_LABEL (label)));
-               memset (&format, 0, sizeof (format));
                format.cs.font_size = TRUE;
+               format.cs.text_position = TRUE;
+               format.cs.font = TRUE;
                format.font_size = wp_get_font_size_index (new_size_index, DEFAULT_FONT_SIZE);
                wp_text_buffer_set_format (WP_TEXT_BUFFER (priv->text_buffer), &format);
 
index 15be43a..19c2619 100644 (file)
@@ -468,7 +468,7 @@ modest_ui_actions_on_new_msg (GtkAction *action, ModestWindow *win)
 /*     GError *err = NULL; */
        TnyAccount *account = NULL;
        ModestWindowMgr *mgr;
-       gchar *signature = NULL;
+       gchar *signature = NULL, *blank_and_signature = NULL;
        
        account_name = g_strdup(modest_window_get_active_account (win));
        if (!account_name)
@@ -496,11 +496,13 @@ modest_ui_actions_on_new_msg (GtkAction *action, ModestWindow *win)
                                         MODEST_ACCOUNT_USE_SIGNATURE, FALSE)) {
                signature = modest_account_mgr_get_string (modest_runtime_get_account_mgr (), account_name,
                                                           MODEST_ACCOUNT_SIGNATURE, FALSE);
+               blank_and_signature = g_strconcat ("\n", signature, NULL);
+               g_free (signature);
        } else {
-               signature = g_strdup ("");
+               blank_and_signature = g_strdup ("");
        }
 
-       msg = modest_tny_msg_new ("", from_str, "", "", "", signature, NULL);
+       msg = modest_tny_msg_new ("", from_str, "", "", "", blank_and_signature, NULL);
        if (!msg) {
                g_printerr ("modest: failed to create new msg\n");
                goto cleanup;
@@ -534,7 +536,7 @@ modest_ui_actions_on_new_msg (GtkAction *action, ModestWindow *win)
 cleanup:
        g_free (account_name);
        g_free (from_str);
-       g_free (signature);
+       g_free (blank_and_signature);
        if (account)
                g_object_unref (G_OBJECT(account));
        if (msg)