Destination folders not shown in "Move to" dialog for local msgs
[modest] / src / modest-ui-actions.c
index ada820a..caa0c3e 100644 (file)
@@ -88,6 +88,7 @@
 #include <tny-camel-bs-msg.h>
 #include <tny-camel-bs-mime-part.h>
 
+#include <gtk/gtk.h>
 #include <gtkhtml/gtkhtml.h>
 
 #define MODEST_MOVE_TO_DIALOG_FOLDER_VIEW "move-to-dialog-folder-view"
@@ -902,11 +903,29 @@ modest_ui_actions_compose_msg(ModestWindow *win,
                                                   MODEST_TEXT_UTILS_SIGNATURE_MARKER,
                                                   "\n", signature, NULL) : g_strdup(body_str);
        } else {
-               body = use_signature ? g_strconcat("\n", MODEST_TEXT_UTILS_SIGNATURE_MARKER,
-                                                  "\n", signature, NULL) : g_strdup("");
+
+               gchar *gray_color_markup = NULL, *color_begin = NULL, *color_end = NULL;
+               GdkColor color;
+
+               if (win && gtk_style_lookup_color (gtk_widget_get_style ((GtkWidget *) win),
+                                                  "SecondaryTextColor", &color))
+                       gray_color_markup = modest_text_utils_get_color_string (&color);
+               if (!gray_color_markup)
+                       gray_color_markup = g_strdup ("#babababababa");
+
+               color_begin = g_strdup_printf ("<font color=\"%s\">", gray_color_markup);
+               color_end = "</font>";
+
+               body = use_signature ? g_strconcat("<br/>\n", color_begin,
+                                               MODEST_TEXT_UTILS_SIGNATURE_MARKER, "<br/>\n",
+                                               signature, color_end, NULL) : g_strdup("");
+
+               g_free (gray_color_markup);
+               g_free (color_begin);
        }
 
-       msg = modest_tny_msg_new (to_str, from_str, cc_str, bcc_str, subject_str, NULL, NULL, body, NULL, NULL, NULL);
+       msg = modest_tny_msg_new_html_plain (to_str, from_str, cc_str, bcc_str, subject_str,
+                                       NULL, NULL, body, NULL, NULL, NULL, NULL, NULL);
        if (!msg) {
                g_printerr ("modest: failed to create new msg\n");
                goto cleanup;
@@ -1468,6 +1487,11 @@ open_msg_performer(gboolean canceled,
        gboolean can_open;
        gchar *account_name = get_info_from_header (helper->header, &is_draft, &can_open);
 
+       if (!g_strcmp0 (account_name, MODEST_LOCAL_FOLDERS_ACCOUNT_ID)) {
+               g_free (account_name);
+               account_name = g_strdup (modest_window_get_active_account (MODEST_WINDOW (parent_window)));
+       }
+
        if (!can_open) {
                modest_window_mgr_unregister_header (modest_runtime_get_window_mgr (), helper->header);
                g_free (account_name);
@@ -5376,8 +5400,6 @@ create_move_to_dialog (GtkWindow *win,
 
                modest_folder_view_set_style (MODEST_FOLDER_VIEW (tree_view),
                                              MODEST_FOLDER_VIEW_STYLE_SHOW_ALL);
-               /* modest_folder_view_update_model (MODEST_FOLDER_VIEW (tree_view), */
-               /*                               TNY_ACCOUNT_STORE (modest_runtime_get_account_store ())); */
 
                active_account_name = modest_window_get_active_account (MODEST_WINDOW (win));
                mgr = modest_runtime_get_account_mgr ();
@@ -7053,6 +7075,9 @@ modest_ui_actions_on_delete_account (GtkWindow *parent_window,
 
                removed = modest_account_mgr_remove_account (account_mgr, account_name);
                if (removed) {
+#ifdef MODEST_TOOLKIT_HILDON2
+                       hildon_gtk_window_take_screenshot (parent_window, FALSE);
+#endif
                        /* Close all email notifications, we cannot
                           distinguish if the notification belongs to
                           this account or not, so for safety reasons