diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-02-18 01:15:48 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-02-18 01:15:48 +0800 |
commit | b5a4e10a04b653109991aa30a07f4a14bf1fa787 (patch) | |
tree | cc70c5b5d07a671ed6b13ae6271d9dc7f9724951 /e-util/e-alert.c | |
parent | 65737b99914b7e26049ce052e06e7a7299b38eed (diff) | |
download | gsoc2013-evolution-b5a4e10a04b653109991aa30a07f4a14bf1fa787.tar.gz gsoc2013-evolution-b5a4e10a04b653109991aa30a07f4a14bf1fa787.tar.zst gsoc2013-evolution-b5a4e10a04b653109991aa30a07f4a14bf1fa787.zip |
Add option to escape EAlert strings.
EAlertDialog wants the primary and secondary strings escaped for use in
markup text, EActivityProxy does not use markup. So make it an explicit
part of the EAlert API.
Diffstat (limited to 'e-util/e-alert.c')
-rw-r--r-- | e-util/e-alert.c | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/e-util/e-alert.c b/e-util/e-alert.c index 7a08c30e83..b3a7859da5 100644 --- a/e-util/e-alert.c +++ b/e-util/e-alert.c @@ -589,58 +589,70 @@ e_alert_get_default_response (EAlert *alert) } gchar * -e_alert_get_title (EAlert *alert) +e_alert_get_title (EAlert *alert, + gboolean escaped) { GString *formatted; + g_return_val_if_fail (alert && alert->priv && alert->priv->definition, NULL); formatted = g_string_new (""); - if (alert->priv->definition->title) { - e_alert_format_string (formatted, - alert->priv->definition->title, - alert->priv->args, FALSE); - } + + if (alert->priv->definition->title != NULL) + e_alert_format_string ( + formatted, alert->priv->definition->title, + alert->priv->args, escaped); + return g_string_free (formatted, FALSE); } gchar * -e_alert_get_primary_text (EAlert *alert) +e_alert_get_primary_text (EAlert *alert, + gboolean escaped) { GString *formatted; + g_return_val_if_fail (alert && alert->priv, NULL); formatted = g_string_new (""); - if (alert->priv->definition) - if (alert->priv->definition->primary) { - e_alert_format_string (formatted, - alert->priv->definition->primary, - alert->priv->args, TRUE); + + if (alert->priv->definition != NULL) + if (alert->priv->definition->primary != NULL) { + e_alert_format_string ( + formatted, alert->priv->definition->primary, + alert->priv->args, escaped); } else { - gchar *title = e_alert_get_title (alert); + gchar *title; + + title = e_alert_get_title (alert, escaped); g_string_append (formatted, title); g_free (title); } else { - g_string_append_printf(formatted, - _("Internal error, unknown error '%s' requested"), - alert->priv->tag); + g_string_append_printf( + formatted, + _("Internal error, unknown error '%s' requested"), + alert->priv->tag); } return g_string_free (formatted, FALSE); } gchar * -e_alert_get_secondary_text (EAlert *alert) +e_alert_get_secondary_text (EAlert *alert, + gboolean escaped) { GString *formatted; + g_return_val_if_fail (alert && alert->priv && alert->priv->definition, NULL); formatted = g_string_new (""); - if (alert->priv->definition->secondary) { - e_alert_format_string (formatted, - alert->priv->definition->secondary, - alert->priv->args, TRUE); - } + + if (alert->priv->definition->secondary != NULL) + e_alert_format_string ( + formatted, alert->priv->definition->secondary, + alert->priv->args, escaped); + return g_string_free (formatted, FALSE); } |