2006-06-24 [paul] 2.3.1cvs17
[claws.git] / src / compose.c
index dd58e1192706846a74f55efd754cfc216a884712..b91b9521c14f56523ae007366b229c008890d40a 100644 (file)
@@ -5014,10 +5014,8 @@ static gchar *compose_get_header(Compose *compose)
        header = g_string_sized_new(64);
 
        /* Date */
-       if (compose->account->add_date) {
-               get_rfc822_date(buf, sizeof(buf));
-               g_string_append_printf(header, "Date: %s\n", buf);
-       }
+       get_rfc822_date(buf, sizeof(buf));
+       g_string_append_printf(header, "Date: %s\n", buf);
 
        /* From */
        
@@ -6172,7 +6170,7 @@ static GtkWidget *compose_account_option_menu_create(Compose *compose)
 
                if (ac == compose->account) def_menu = num;
 
-               name = g_markup_printf_escaped("From: <i>%s</i>",
+               name = g_markup_printf_escaped(_("From: <i>%s</i>"),
                                       ac->account_name);
                
                if (ac == compose->account) {
@@ -8508,10 +8506,36 @@ static void compose_insert_drag_received_cb (GtkWidget          *widget,
 {
        Compose *compose = (Compose *)user_data;
        GList *list, *tmp;
-       AlertValue val = alertpanel(_("Insert or attach?"),
-                                _("Do you want to insert the contents of this file in the email body,"
-                                  "or rather attach it to the email?"),
-                                 GTK_STOCK_CANCEL, _("+_Insert"), _("_Attach"));
+       AlertValue val = G_ALERTDEFAULT;
+
+       switch (prefs_common.compose_dnd_mode) {
+               case COMPOSE_DND_ASK:
+                       val = alertpanel_full(_("Insert or attach?"),
+                                _("Do you want to insert the contents of the file(s) "
+                                  "into the message body, or attach it to the email?"),
+                                 GTK_STOCK_CANCEL, _("+_Insert"), _("_Attach"),
+                                 TRUE, NULL, ALERT_QUESTION, G_ALERTALTERNATE);
+                       break;
+               case COMPOSE_DND_INSERT:
+                       val = G_ALERTALTERNATE;
+                       break;
+               case COMPOSE_DND_ATTACH:
+                       val = G_ALERTOTHER;
+                       break;
+               default:
+                       /* unexpected case */
+                       g_warning("error: unexpected compose_dnd_mode option value in compose_insert_drag_received_cb()");
+       }
+
+       if (val & G_ALERTDISABLE) {
+               val &= ~G_ALERTDISABLE;
+               /* remember what action to perform by default, only if we don't click Cancel */
+               if (val == G_ALERTALTERNATE)
+                       prefs_common.compose_dnd_mode = COMPOSE_DND_INSERT;
+               else
+                       if (val == G_ALERTOTHER)
+                               prefs_common.compose_dnd_mode = COMPOSE_DND_ATTACH;
+       }
        
        if (val == G_ALERTDEFAULT) {
                gtk_drag_finish(drag_context, FALSE, FALSE, time);