typedef enum
{
- COMPOSE_CALL_ADVANCED_ACTION_MOVE_BEGINNING_OF_LINE,
+ COMPOSE_CALL_ADVANCED_ACTION_UNDEFINED = -1,
+ COMPOSE_CALL_ADVANCED_ACTION_MOVE_BEGINNING_OF_LINE = 0,
COMPOSE_CALL_ADVANCED_ACTION_MOVE_FORWARD_CHARACTER,
COMPOSE_CALL_ADVANCED_ACTION_MOVE_BACKWARD_CHARACTER,
COMPOSE_CALL_ADVANCED_ACTION_MOVE_FORWARD_WORD,
}
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
}
+static void compose_template_apply_fields_error(const gchar *header)
+{
+ gchar *tr;
+ gchar *text;
+
+ tr = g_strdup(C_("'%s' stands for a header name",
+ "Template '%s' format error."));
+ text = g_strdup_printf(tr, prefs_common_translated_header_name(header));
+ alertpanel_error(text);
+
+ g_free(text);
+ g_free(tr);
+}
+
static void compose_template_apply_fields(Compose *compose, Template *tmpl)
{
MsgInfo* dummyinfo = NULL;
buf = quote_fmt_get_buffer();
if (buf == NULL) {
- alertpanel_error(_("Template From format error."));
+ compose_template_apply_fields_error("From");
} else {
gtk_entry_set_text(GTK_ENTRY(compose->from_name), buf);
}
buf = quote_fmt_get_buffer();
if (buf == NULL) {
- alertpanel_error(_("Template To format error."));
+ compose_template_apply_fields_error("To");
} else {
compose_entry_append(compose, buf, COMPOSE_TO, PREF_TEMPLATE);
}
buf = quote_fmt_get_buffer();
if (buf == NULL) {
- alertpanel_error(_("Template Cc format error."));
+ compose_template_apply_fields_error("Cc");
} else {
compose_entry_append(compose, buf, COMPOSE_CC, PREF_TEMPLATE);
}
buf = quote_fmt_get_buffer();
if (buf == NULL) {
- alertpanel_error(_("Template Bcc format error."));
+ compose_template_apply_fields_error("Bcc");
} else {
compose_entry_append(compose, buf, COMPOSE_BCC, PREF_TEMPLATE);
}
buf = quote_fmt_get_buffer();
if (buf == NULL) {
- alertpanel_error(_("Template Reply-To format error."));
+ compose_template_apply_fields_error("Reply-To");
} else {
compose_entry_append(compose, buf, COMPOSE_REPLYTO, PREF_TEMPLATE);
}
buf = quote_fmt_get_buffer();
if (buf == NULL) {
- alertpanel_error(_("Template subject format error."));
+ compose_template_apply_fields_error("Subject");
} else {
gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), buf);
}
#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()
{
return TRUE;
}
-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 gboolean compose_input_cb(GIOChannel *source, GIOCondition condition,
gpointer data)
{
DO_ACTION("Edit/Advanced/DelForwWord", COMPOSE_CALL_ADVANCED_ACTION_DELETE_FORWARD_WORD);
DO_ACTION("Edit/Advanced/DelLine", COMPOSE_CALL_ADVANCED_ACTION_DELETE_LINE);
DO_ACTION("Edit/Advanced/DelEndLine", COMPOSE_CALL_ADVANCED_ACTION_DELETE_TO_LINE_END);
- return -1;
+ return COMPOSE_CALL_ADVANCED_ACTION_UNDEFINED;
}
static void compose_advanced_action_cb(GtkAction *gaction, gpointer data)
{
Compose *compose = (Compose *)data;
GtkTextView *text = GTK_TEXT_VIEW(compose->text);
- ComposeCallAdvancedAction action = -1;
+ ComposeCallAdvancedAction action = COMPOSE_CALL_ADVANCED_ACTION_UNDEFINED;
action = compose_call_advanced_action_from_path(gaction);