aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/eab-gui-util.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-09-11 23:34:29 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-09-11 23:34:29 +0800
commitc0a255eb90769638d57ae4122932f75c46e4e531 (patch)
tree5213694107a246763c25c0a089553dd7c8708b32 /addressbook/gui/widgets/eab-gui-util.c
parent4c8aa5982c0132716f473873d0e1d7601df14607 (diff)
downloadgsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar
gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.gz
gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.bz2
gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.lz
gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.xz
gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.zst
gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.zip
Merge revisions 36016:36303 from trunk.
svn path=/branches/kill-bonobo/; revision=36307
Diffstat (limited to 'addressbook/gui/widgets/eab-gui-util.c')
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index 651a44bfa7..154e5bb0c1 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -81,7 +81,12 @@ static const char *status_to_string[] = {
void
eab_error_dialog (const char *msg, EBookStatus status)
{
- const char *status_str = status_to_string [status];
+ const char *status_str;
+
+ if (status < 0 || status >= G_N_ELEMENTS (status_to_string))
+ status_str = "Other error";
+ else
+ status_str = status_to_string [status];
if (status_str)
e_error_run (NULL, "addressbook:generic-error", msg, _(status_str), NULL);
@@ -92,22 +97,24 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status)
{
char *label_string, *label = NULL, *uri;
GtkWidget *dialog;
+ gboolean can_detail_error = TRUE;
g_return_if_fail (source != NULL);
uri = e_source_get_uri (source);
if (status == E_BOOK_ERROR_OFFLINE_UNAVAILABLE) {
- label_string = _("We were unable to open this addressbook. This either means "
+ can_detail_error = FALSE;
+ label_string = _("We were unable to open this address book. This either means "
"this book is not marked for offline usage or not yet downloaded "
- "for offline usage. Please load the addressbook once in online mode "
+ "for offline usage. Please load the address book once in online mode "
"to download its contents");
}
else if (!strncmp (uri, "file:", 5)) {
char *path = g_filename_from_uri (uri, NULL, NULL);
label = g_strdup_printf (
- _("We were unable to open this addressbook. Please check that the "
+ _("We were unable to open this address book. Please check that the "
"path %s exists and that you have permission to access it."), path);
g_free (path);
label_string = label;
@@ -116,10 +123,11 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status)
/* special case for ldap: contact folders so we can tell the user about openldap */
#ifdef HAVE_LDAP
label_string =
- _("We were unable to open this addressbook. This either "
+ _("We were unable to open this address book. This either "
"means you have entered an incorrect URI, or the LDAP server "
"is unreachable.");
#else
+ can_detail_error = FALSE;
label_string =
_("This version of Evolution does not have LDAP support "
"compiled in to it. If you want to use LDAP in Evolution, "
@@ -128,10 +136,12 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status)
} else {
/* other network folders */
label_string =
- _("We were unable to open this addressbook. This either "
+ _("We were unable to open this address book. This either "
"means you have entered an incorrect URI, or the server "
"is unreachable.");
+ }
+ if (can_detail_error) {
/* do not show repository offline message, it's kind of generic error */
if (status != E_BOOK_ERROR_REPOSITORY_OFFLINE && status > 0 && status < G_N_ELEMENTS (status_to_string) && status_to_string [status]) {
label = g_strconcat (label_string, "\n\n", _("Detailed error:"), " ", _(status_to_string [status]), NULL);
@@ -160,19 +170,19 @@ eab_search_result_dialog (GtkWidget *parent,
str = _("More cards matched this query than either the server is \n"
"configured to return or Evolution is configured to display.\n"
"Please make your search more specific or raise the result limit in\n"
- "the directory server preferences for this addressbook.");
+ "the directory server preferences for this address book.");
break;
case E_BOOK_VIEW_STATUS_TIME_LIMIT_EXCEEDED:
str = _("The time to execute this query exceeded the server limit or the limit\n"
- "you have configured for this addressbook. Please make your search\n"
+ "you have configured for this address book. Please make your search\n"
"more specific or raise the time limit in the directory server\n"
- "preferences for this addressbook.");
+ "preferences for this address book.");
break;
case E_BOOK_VIEW_ERROR_INVALID_QUERY:
- str = _("The backend for this addressbook was unable to parse this query.");
+ str = _("The backend for this address book was unable to parse this query.");
break;
case E_BOOK_VIEW_ERROR_QUERY_REFUSED:
- str = _("The backend for this addressbook refused to perform this query.");
+ str = _("The backend for this address book refused to perform this query.");
break;
case E_BOOK_VIEW_ERROR_OTHER_ERROR:
str = _("This query did not complete successfully.");