aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-05-08 05:13:09 +0800
committerChris Toshok <toshok@src.gnome.org>2001-05-08 05:13:09 +0800
commit37341be2789b0d15b435031e468817169053ec14 (patch)
tree44404f2f4e51fdb0a7bd99892f40813f8a378ee9
parent46e839289d87473c737bb2392b4324976688618f (diff)
downloadgsoc2013-evolution-37341be2789b0d15b435031e468817169053ec14.tar
gsoc2013-evolution-37341be2789b0d15b435031e468817169053ec14.tar.gz
gsoc2013-evolution-37341be2789b0d15b435031e468817169053ec14.tar.bz2
gsoc2013-evolution-37341be2789b0d15b435031e468817169053ec14.tar.lz
gsoc2013-evolution-37341be2789b0d15b435031e468817169053ec14.tar.xz
gsoc2013-evolution-37341be2789b0d15b435031e468817169053ec14.tar.zst
gsoc2013-evolution-37341be2789b0d15b435031e468817169053ec14.zip
Use a different error message in the ldap support/no ldap support/file
2001-05-07 Chris Toshok <toshok@ximian.com> * gui/component/addressbook.c (book_open_cb): Use a different error message in the ldap support/no ldap support/file cases. svn path=/trunk/; revision=9700
-rw-r--r--addressbook/ChangeLog5
-rw-r--r--addressbook/gui/component/addressbook.c60
2 files changed, 43 insertions, 22 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 1c7513e9c5..5e8fa02dde 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,8 @@
+2001-05-07 Chris Toshok <toshok@ximian.com>
+
+ * gui/component/addressbook.c (book_open_cb): Use a different
+ error message in the ldap support/no ldap support/file cases.
+
2001-05-07 Gediminas Paulauskas <menesis@delfi.lt>
* gui/component/addressbook.c: use define from
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index a67b004f31..027a777621 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -394,13 +394,13 @@ passwd_cb (gchar *string, gpointer data)
static void
book_open_cb (EBook *book, EBookStatus status, gpointer closure)
{
- if (status == E_BOOK_STATUS_SUCCESS) {
- AddressbookView *view = closure;
- AddressbookSource *source;
+ AddressbookView *view = closure;
+ AddressbookSource *source;
+ source = addressbook_storage_get_source_by_uri (view->uri);
+ if (status == E_BOOK_STATUS_SUCCESS) {
/* check if the addressbook needs authentication */
- source = addressbook_storage_get_source_by_uri (view->uri);
if (source &&
source->type == ADDRESSBOOK_SOURCE_LDAP &&
source->ldap.auth == ADDRESSBOOK_LDAP_AUTH_SIMPLE) {
@@ -431,34 +431,50 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure)
NULL);
} else {
- GtkWidget *warning_dialog, *label, *href;
+ GtkWidget *warning_dialog, *label;
warning_dialog = gnome_dialog_new (
_("Unable to open addressbook"),
GNOME_STOCK_BUTTON_CLOSE,
NULL);
-
- label = gtk_label_new (
- _("We were unable to open this addressbook. This either\n"
- "means you have entered an incorrect URI, or have tried\n"
- "to access an LDAP server and don't have LDAP support\n"
- "compiled in. If you've entered a URI, check the URI for\n"
- "correctness and reenter. If not, you probably have\n"
- "attempted to access an LDAP server. If you wish to be\n"
- "able to use LDAP, you'll need to download and install\n"
- "OpenLDAP and recompile and install Evolution.\n"));
+
+ if (source->type == ADDRESSBOOK_SOURCE_LDAP) {
+#if HAVE_LDAP
+ label = gtk_label_new (
+ _("We were unable to open this addressbook. This either\n"
+ "means you have entered an incorrect URI, or the LDAP server\n"
+ "is down"));
+#else
+ label = gtk_label_new (
+ _("This version of Evolution does not have LDAP support\n"
+ "compiled in to it. If you want to use LDAP in Evolution\n"
+ "you must compile the program from the CVS sources after\n"
+ "retrieving OpenLDAP from the link below.\n"));
+#endif
+ }
+ else {
+ label = gtk_label_new (
+ _("We were unable to open this addressbook. Please check that the\n"
+ "path exists and that you have permission to access it."));
+ }
+
gtk_misc_set_alignment(GTK_MISC(label),
0, .5);
gtk_label_set_justify(GTK_LABEL(label),
GTK_JUSTIFY_LEFT);
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (warning_dialog)->vbox),
- label, TRUE, TRUE, 0);
- gtk_widget_show (label);
- href = gnome_href_new ("http://www.openldap.org/", "OpenLDAP at http://www.openldap.org/");
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (warning_dialog)->vbox),
- href, FALSE, FALSE, 0);
- gtk_widget_show (href);
-
+ label, TRUE, TRUE, 0);
+ gtk_widget_show (label);
+
+#ifndef HAVE_LDAP
+ if (source->type == ADDRESSBOOK_SOURCE_LDAP) {
+ GtkWidget *href;
+ href = gnome_href_new ("http://www.openldap.org/", "OpenLDAP at http://www.openldap.org/");
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (warning_dialog)->vbox),
+ href, FALSE, FALSE, 0);
+ gtk_widget_show (href);
+ }
+#endif
gnome_dialog_run (GNOME_DIALOG (warning_dialog));
gtk_object_destroy (GTK_OBJECT (warning_dialog));