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);
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)
/* 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);
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:
}
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;
}
}
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;
}
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);
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;
}
#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()
{
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");
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;
*\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;