2009-06-02 [colin] 3.7.1cvs65
* src/compose.c * src/prefs_template.c * src/quote_fmt.c Fix error messages in templates, and fix their checking
This commit is contained in:
parent
14a8d8dcba
commit
27e2c52c4a
6 changed files with 47 additions and 26 deletions
|
@ -1,3 +1,11 @@
|
|||
2009-06-02 [colin] 3.7.1cvs65
|
||||
|
||||
* src/compose.c
|
||||
* src/prefs_template.c
|
||||
* src/quote_fmt.c
|
||||
Fix error messages in templates, and fix their
|
||||
checking
|
||||
|
||||
2009-05-22 [colin] 3.7.1cvs64
|
||||
|
||||
* src/compose.c
|
||||
|
|
|
@ -3804,3 +3804,4 @@
|
|||
( cvs diff -u -r 1.382.2.509 -r 1.382.2.510 src/compose.c; ) > 3.7.1cvs62.patchset
|
||||
( cvs diff -u -r 1.382.2.510 -r 1.382.2.511 src/compose.c; ) > 3.7.1cvs63.patchset
|
||||
( cvs diff -u -r 1.382.2.511 -r 1.382.2.512 src/compose.c; ) > 3.7.1cvs64.patchset
|
||||
( cvs diff -u -r 1.382.2.512 -r 1.382.2.513 src/compose.c; cvs diff -u -r 1.12.2.69 -r 1.12.2.70 src/prefs_template.c; cvs diff -u -r 1.8.2.39 -r 1.8.2.40 src/quote_fmt.c; ) > 3.7.1cvs65.patchset
|
||||
|
|
|
@ -12,7 +12,7 @@ MINOR_VERSION=7
|
|||
MICRO_VERSION=1
|
||||
INTERFACE_AGE=0
|
||||
BINARY_AGE=0
|
||||
EXTRA_VERSION=64
|
||||
EXTRA_VERSION=65
|
||||
EXTRA_RELEASE=
|
||||
EXTRA_GTK2_VERSION=
|
||||
|
||||
|
|
|
@ -1124,7 +1124,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
|
|||
compose_quote_fmt(compose, dummyinfo,
|
||||
body_format,
|
||||
NULL, tmp, FALSE, TRUE,
|
||||
_("New message body format error at line %d."));
|
||||
_("The body of the \"New message\" template has an error at line %d."));
|
||||
compose_attach_from_list(compose, quote_fmt_get_attachments_list(), FALSE);
|
||||
quote_fmt_reset_vartable();
|
||||
|
||||
|
@ -1511,7 +1511,7 @@ static Compose *compose_generic_reply(MsgInfo *msginfo,
|
|||
|
||||
buf = quote_fmt_get_buffer();
|
||||
if (buf == NULL)
|
||||
alertpanel_error(_("Message reply From format error."));
|
||||
alertpanel_error(_("The \"From\" field of the \"Reply\" template contains an invalid email address."));
|
||||
else
|
||||
gtk_entry_set_text(GTK_ENTRY(compose->from_name), buf);
|
||||
quote_fmt_reset_vartable();
|
||||
|
@ -1558,7 +1558,7 @@ static Compose *compose_generic_reply(MsgInfo *msginfo,
|
|||
qmark = "> ";
|
||||
compose_quote_fmt(compose, compose->replyinfo,
|
||||
body_fmt, qmark, body, FALSE, TRUE,
|
||||
_("Message reply format error at line %d."));
|
||||
_("The body of the \"Reply\" template has an error at line %d."));
|
||||
compose_attach_from_list(compose, quote_fmt_get_attachments_list(), FALSE);
|
||||
quote_fmt_reset_vartable();
|
||||
}
|
||||
|
@ -1682,7 +1682,7 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
|
|||
|
||||
buf = quote_fmt_get_buffer();
|
||||
if (buf == NULL)
|
||||
alertpanel_error(_("Message forward From format error."));
|
||||
alertpanel_error(_("The \"From\" field of the \"Forward\" template contains an invalid email address."));
|
||||
else
|
||||
gtk_entry_set_text(GTK_ENTRY(compose->from_name), buf);
|
||||
quote_fmt_reset_vartable();
|
||||
|
@ -1747,7 +1747,7 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
|
|||
|
||||
compose_quote_fmt(compose, full_msginfo,
|
||||
body_fmt, qmark, body, FALSE, TRUE,
|
||||
_("Message forward format error at line %d."));
|
||||
_("The body of the \"Forward\" template has an error at line %d."));
|
||||
compose_attach_from_list(compose, quote_fmt_get_attachments_list(), FALSE);
|
||||
quote_fmt_reset_vartable();
|
||||
compose_attach_parts(compose, msginfo);
|
||||
|
@ -1871,7 +1871,7 @@ static Compose *compose_forward_multiple(PrefsAccount *account, GSList *msginfo_
|
|||
|
||||
buf = quote_fmt_get_buffer();
|
||||
if (buf == NULL)
|
||||
alertpanel_error(_("Message forward From format error."));
|
||||
alertpanel_error(_("The \"From\" field of the \"Forward\" template contains an invalid email address."));
|
||||
else
|
||||
gtk_entry_set_text(GTK_ENTRY(compose->from_name), buf);
|
||||
quote_fmt_reset_vartable();
|
||||
|
@ -2329,7 +2329,7 @@ Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo,
|
|||
gtk_editable_set_editable(GTK_EDITABLE(compose->subject_entry), FALSE);
|
||||
|
||||
compose_quote_fmt(compose, msginfo, "%M", NULL, NULL, FALSE, FALSE,
|
||||
_("Message redirect format error at line %d."));
|
||||
_("The body of the \"Redirect\" template has an error at line %d."));
|
||||
quote_fmt_reset_vartable();
|
||||
gtk_text_view_set_editable(GTK_TEXT_VIEW(compose->text), FALSE);
|
||||
|
||||
|
@ -2845,7 +2845,7 @@ static gchar *compose_quote_fmt(Compose *compose, MsgInfo *msginfo,
|
|||
|
||||
buf = quote_fmt_get_buffer();
|
||||
if (buf == NULL)
|
||||
alertpanel_error(_("Quote mark format error."));
|
||||
alertpanel_error(_("The \"Quotation mark\" of the template is invalid."));
|
||||
else
|
||||
Xstrdup_a(quote_str, buf, goto error)
|
||||
}
|
||||
|
@ -7894,7 +7894,7 @@ static void compose_template_apply(Compose *compose, Template *tmpl,
|
|||
const gchar *qmark;
|
||||
gchar *parsed_str = NULL;
|
||||
gint cursor_pos = 0;
|
||||
const gchar *err_msg = _("Template body format error at line %d.");
|
||||
const gchar *err_msg = _("The body of the template has an error at line %d.");
|
||||
if (!tmpl) return;
|
||||
|
||||
/* process the body */
|
||||
|
|
|
@ -681,6 +681,18 @@ gboolean prefs_template_string_is_valid(gchar *string, gint *line, gboolean esca
|
|||
tmp = g_strdup(string);
|
||||
}
|
||||
memset(&dummyinfo, 0, sizeof(MsgInfo));
|
||||
/* init dummy fields, so we can test the result of the parse */
|
||||
dummyinfo.date="Sat, 30 May 2009 01:23:45 +0200";
|
||||
dummyinfo.fromname="John Doe";
|
||||
dummyinfo.from="John Doe <john@example.com>";
|
||||
dummyinfo.to="John Doe <john@example.com>";
|
||||
dummyinfo.cc="John Doe <john@example.com>";
|
||||
dummyinfo.msgid="<1234john@example.com>";
|
||||
dummyinfo.inreplyto="<1234john@example.com>";
|
||||
dummyinfo.newsgroups="alt.test";
|
||||
dummyinfo.subject="subject";
|
||||
|
||||
|
||||
#ifdef USE_ENCHANT
|
||||
quote_fmt_init(&dummyinfo, NULL, NULL, TRUE, account, FALSE, NULL);
|
||||
#else
|
||||
|
@ -738,7 +750,7 @@ static gboolean prefs_template_list_view_set_row(gint row)
|
|||
value = NULL;
|
||||
}
|
||||
if (!prefs_template_string_is_valid(value, &line, TRUE, FALSE)) {
|
||||
alertpanel_error(_("Template body format error at line %d."), line);
|
||||
alertpanel_error(_("The body of the template has an error at line %d."), line);
|
||||
g_free(value);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -746,7 +758,7 @@ static gboolean prefs_template_list_view_set_row(gint row)
|
|||
name = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_name),
|
||||
0, -1);
|
||||
if (*name == '\0') {
|
||||
alertpanel_error(_("Template name is not set."));
|
||||
alertpanel_error(_("The template's name is not set."));
|
||||
g_free(value);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -783,31 +795,31 @@ static gboolean prefs_template_list_view_set_row(gint row)
|
|||
}
|
||||
|
||||
if (!prefs_template_string_is_valid(from, NULL, TRUE, TRUE)) {
|
||||
alertpanel_error(_("Template From format error."));
|
||||
alertpanel_error(_("The \"From\" field of the template contains an invalid email address."));
|
||||
g_free(from);
|
||||
g_free(value);
|
||||
return FALSE;
|
||||
}
|
||||
if (!prefs_template_string_is_valid(to, NULL, TRUE, TRUE)) {
|
||||
alertpanel_error(_("Template To format error."));
|
||||
alertpanel_error(_("The \"To\" field of the template contains an invalid email address."));
|
||||
g_free(to);
|
||||
g_free(value);
|
||||
return FALSE;
|
||||
}
|
||||
if (!prefs_template_string_is_valid(cc, NULL, TRUE, TRUE)) {
|
||||
alertpanel_error(_("Template Cc format error."));
|
||||
alertpanel_error(_("The \"Cc\" field of the template contains an invalid email address."));
|
||||
g_free(cc);
|
||||
g_free(value);
|
||||
return FALSE;
|
||||
}
|
||||
if (!prefs_template_string_is_valid(bcc, NULL, TRUE, TRUE)) {
|
||||
alertpanel_error(_("Template Bcc format error."));
|
||||
alertpanel_error(_("The \"Bcc\" field of the template contains an invalid email address."));
|
||||
g_free(bcc);
|
||||
g_free(value);
|
||||
return FALSE;
|
||||
}
|
||||
if (!prefs_template_string_is_valid(subject, NULL, TRUE, FALSE)) {
|
||||
alertpanel_error(_("Template subject format error."));
|
||||
alertpanel_error(_("The \"Subject\" field of the template is invalid."));
|
||||
g_free(subject);
|
||||
g_free(value);
|
||||
return FALSE;
|
||||
|
|
|
@ -563,13 +563,13 @@ void quotefmt_check_new_msg_formats(gboolean use_format,
|
|||
gint line;
|
||||
|
||||
if (override_from_fmt && !prefs_template_string_is_valid(override_from_fmt, NULL, TRUE, TRUE))
|
||||
alertpanel_error(_("New message From format error."));
|
||||
alertpanel_error(_("The \"From\" field of the \"New message\" template contains an invalid email address."));
|
||||
|
||||
if (!prefs_template_string_is_valid(subject_fmt, NULL, TRUE, FALSE))
|
||||
alertpanel_error(_("New message subject format error."));
|
||||
alertpanel_error(_("The \"Subject\" field of the \"New message\" template is invalid."));
|
||||
|
||||
if (!prefs_template_string_is_valid(body_fmt, &line, TRUE, FALSE)) {
|
||||
alertpanel_error(_("New message body format error at line %d."), line);
|
||||
alertpanel_error(_("The body of the \"New message\" template has an error at line %d."), line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -583,13 +583,13 @@ void quotefmt_check_reply_formats(gboolean use_format,
|
|||
gint line;
|
||||
|
||||
if (!prefs_template_string_is_valid(quotation_mark, NULL, TRUE, FALSE))
|
||||
alertpanel_error(_("Message reply quotation mark format error."));
|
||||
alertpanel_error(_("The \"Quotation mark\" field of the \"Reply\" template is invalid."));
|
||||
|
||||
if (override_from_fmt && !prefs_template_string_is_valid(override_from_fmt, NULL, TRUE, TRUE))
|
||||
alertpanel_error(_("Message reply From format error."));
|
||||
alertpanel_error(_("The \"From\" field of the \"Reply\" template contains an invalid email address."));
|
||||
|
||||
if (!prefs_template_string_is_valid(body_fmt, &line, TRUE, FALSE)) {
|
||||
alertpanel_error(_("Message reply format error at line %d."), line);
|
||||
alertpanel_error(_("The body of the \"Reply\" template has an error at line %d."), line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -603,13 +603,13 @@ void quotefmt_check_forward_formats(gboolean use_format,
|
|||
gint line;
|
||||
|
||||
if (!prefs_template_string_is_valid(quotation_mark, NULL, TRUE, FALSE))
|
||||
alertpanel_error(_("Message forward quotation mark format error."));
|
||||
alertpanel_error(_("The \"Quotation mark\" field of the \"Forward\" template is invalid."));
|
||||
|
||||
if (override_from_fmt && !prefs_template_string_is_valid(override_from_fmt, NULL, TRUE, TRUE))
|
||||
alertpanel_error(_("Message forward From format error."));
|
||||
alertpanel_error(_("The \"From\" field of the \"Forward\" template contains an invalid email address."));
|
||||
|
||||
if (!prefs_template_string_is_valid(body_fmt, &line, TRUE, FALSE)) {
|
||||
alertpanel_error(_("Message forward format error at line %d."), line);
|
||||
alertpanel_error(_("The body of the \"Forward\" template has an error at line %d."), line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue