More translatable header names in UI strings.
[claws.git] / src / compose.c
index 93669d38c4b6a2c0183eff359413f6cd389fd753..0be7a596d38a78031dbcdd2b32595a70fc1a91d0 100644 (file)
@@ -569,7 +569,7 @@ static void compose_check_backwards    (GtkAction *action, gpointer data);
 static void compose_check_forwards_go     (GtkAction *action, gpointer data);
 #endif
 
-static PrefsAccount *compose_guess_forward_account_from_msginfo        (MsgInfo *msginfo);
+static PrefsAccount *compose_find_account      (MsgInfo *msginfo);
 
 static MsgInfo *compose_msginfo_new_from_compose(Compose *compose);
 
@@ -1770,9 +1770,7 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
        cm_return_val_if_fail(msginfo != NULL, NULL);
        cm_return_val_if_fail(msginfo->folder != NULL, NULL);
 
-       if (!account && 
-           !(account = compose_guess_forward_account_from_msginfo
-                               (msginfo)))
+       if (!account && !(account = compose_find_account(msginfo)))
                account = cur_account;
 
        if (!prefs_common.forward_as_attachment)
@@ -1976,8 +1974,7 @@ static Compose *compose_forward_multiple(PrefsAccount *account, GSList *msginfo_
 
        /* guess account from first selected message */
        if (!account && 
-           !(account = compose_guess_forward_account_from_msginfo
-                               (msginfo_list->data)))
+           !(account = compose_find_account(msginfo_list->data)))
                account = cur_account;
 
        cm_return_val_if_fail(account != NULL, NULL);
@@ -2705,7 +2702,7 @@ void compose_toolbar_cb(gint action, gpointer data)
        case A_SEND:
                compose_send_cb(NULL, compose);
                break;
-       case A_SENDL:
+       case A_SEND_LATER:
                compose_send_later_cb(NULL, compose);
                break;
        case A_DRAFT:
@@ -5035,12 +5032,16 @@ static gboolean compose_check_for_set_recipients(Compose *compose)
                }
                if (!found_other) {
                        AlertValue aval;
+                       gchar *text;
                        if (compose->batch) {
                                gtk_widget_show_all(compose->window);
                        }
+                       text = g_strdup_printf(_("The only recipient is the default '%s' address. Send anyway?"),
+                                          prefs_common_translated_header_name("Cc"));
                        aval = alertpanel(_("Send"),
-                                         _("The only recipient is the default CC address. Send anyway?"),
+                                         text,
                                          GTK_STOCK_CANCEL, g_strconcat("+", _("_Send"), NULL), NULL);
+                       g_free(text);
                        if (aval != G_ALERTALTERNATE)
                                return FALSE;
                }
@@ -5067,12 +5068,16 @@ static gboolean compose_check_for_set_recipients(Compose *compose)
                }
                if (!found_other) {
                        AlertValue aval;
+                       gchar *text;
                        if (compose->batch) {
                                gtk_widget_show_all(compose->window);
                        }
+                       text = g_strdup_printf(_("The only recipient is the default '%s' address. Send anyway?"),
+                                          prefs_common_translated_header_name("Bcc"));
                        aval = alertpanel(_("Send"),
-                                         _("The only recipient is the default BCC address. Send anyway?"),
+                                         text,
                                          GTK_STOCK_CANCEL, g_strconcat("+", _("_Send"), NULL), NULL);
+                       g_free(text);
                        if (aval != G_ALERTALTERNATE)
                                return FALSE;
                }
@@ -7506,6 +7511,11 @@ static Compose *compose_create(PrefsAccount *account,
 
        cm_return_val_if_fail(account != NULL, NULL);
 
+       gtkut_convert_int_to_gdk_color(prefs_common.default_header_bgcolor,
+                                          &default_header_bgcolor);
+       gtkut_convert_int_to_gdk_color(prefs_common.default_header_color,
+                                          &default_header_color);
+
        debug_print("Creating compose window...\n");
        compose = g_new0(Compose, 1);
 
@@ -8100,11 +8110,6 @@ static Compose *compose_create(PrefsAccount *account,
                gtk_widget_show(window);
        }
        
-       gtkut_convert_int_to_gdk_color(prefs_common.default_header_bgcolor,
-                                          &default_header_bgcolor);
-       gtkut_convert_int_to_gdk_color(prefs_common.default_header_color,
-                                          &default_header_color);
-
        return compose;
 }
 
@@ -9374,6 +9379,14 @@ static void compose_exec_ext_editor(Compose *compose)
 #endif /* G_OS_UNIX */
 }
 
+static gboolean compose_can_autosave(Compose *compose)
+{
+       if (compose->privacy_system && compose->use_encryption)
+               return prefs_common.autosave && prefs_common.autosave_encrypted;
+       else
+               return prefs_common.autosave;
+}
+
 #ifdef G_OS_UNIX
 static gboolean compose_get_ext_editor_cmd_valid()
 {
@@ -9524,7 +9537,10 @@ static gboolean compose_input_cb(GIOChannel *source, GIOCondition condition,
                gtk_text_buffer_set_text(buffer, "", -1);
                compose_insert_file(compose, compose->exteditor_file);
                compose_changed_cb(NULL, compose);
-               compose_draft((gpointer)compose, COMPOSE_AUTO_SAVE);
+
+               /* Check if we should save the draft or not */
+               if (compose_can_autosave(compose))
+                 compose_draft((gpointer)compose, COMPOSE_AUTO_SAVE);
 
                if (claws_unlink(compose->exteditor_file) < 0)
                        FILE_OP_ERROR(compose->exteditor_file, "unlink");
@@ -10385,14 +10401,6 @@ void compose_close_toolbar(Compose *compose)
        compose_close_cb(NULL, compose);
 }
 
-static gboolean compose_can_autosave(Compose *compose)
-{
-       if (compose->privacy_system && compose->use_encryption)
-               return prefs_common.autosave && prefs_common.autosave_encrypted;
-       else
-               return prefs_common.autosave;
-}
-
 static void compose_close_cb(GtkAction *action, gpointer data)
 {
        Compose *compose = (Compose *)data;
@@ -11722,7 +11730,7 @@ static void compose_check_forwards_go(GtkAction *action, gpointer data)
  *\brief       Guess originating forward account from MsgInfo and several 
  *             "common preference" settings. Return NULL if no guess. 
  */
-static PrefsAccount *compose_guess_forward_account_from_msginfo(MsgInfo *msginfo)
+static PrefsAccount *compose_find_account(MsgInfo *msginfo)
 {
        PrefsAccount *account = NULL;