aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/addressbook.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2000-07-06 04:07:46 +0800
committerChris Toshok <toshok@src.gnome.org>2000-07-06 04:07:46 +0800
commit2ca2244e6b47fa020ba10bcfb6836033ddfc3cc8 (patch)
treea5f1c34e58dee9beb85aedf093422cf1d4c716c5 /addressbook/gui/component/addressbook.c
parentbc4c507c9ef59d92272fccef9cda4994ce507e0a (diff)
downloadgsoc2013-evolution-2ca2244e6b47fa020ba10bcfb6836033ddfc3cc8.tar.gz
gsoc2013-evolution-2ca2244e6b47fa020ba10bcfb6836033ddfc3cc8.tar.zst
gsoc2013-evolution-2ca2244e6b47fa020ba10bcfb6836033ddfc3cc8.zip
call e_ldap_storage_add_server call.
2000-07-05 Chris Toshok <toshok@helixcode.com> * gui/component/addressbook.c (new_server_cb): call e_ldap_storage_add_server call. * gui/component/ldap-server-dialog.glade: add name row. * gui/component/e-ldap-server-dialog.h: remove the ELDAPServer type. * gui/component/e-ldap-server-dialog.c (extract_server_info): add support for the name-entry. * gui/component/e-ldap-server-dialog.c (fill_in_server_info): same. * gui/component/e-ldap-storage.h: add ELDAPServer type, and add prototypes for e_ldap_storage_add_server and e_ldap_storage_remove_server. * gui/component/e-ldap-storage.c (e_ldap_storage_add_server): new function, add it to our hash table, add a shell folder, and save out the metadata. (ldap_server_foreach): add the ldap server info under a "contactserver" node. (setup_ldap_storage): create our hashtable. svn path=/trunk/; revision=3895
Diffstat (limited to 'addressbook/gui/component/addressbook.c')
-rw-r--r--addressbook/gui/component/addressbook.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 97cdb04b53..f248e1e4bd 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -186,19 +186,19 @@ null_cb (EBook *book, EBookStatus status, gpointer closure)
static void
new_server_cb (BonoboUIHandler *uih, void *user_data, const char *path)
{
- ELDAPServer server;
- char *uri;
+ ELDAPServer *server = g_new (ELDAPServer, 1);
EBook *book;
AddressbookView *view = (AddressbookView *) user_data;
GtkObject *object;
/* fill in the defaults */
- server.host = g_strdup("");
- server.port = 389;
- server.description = g_strdup("");
- server.rootdn = g_strdup("");
-
- e_ldap_server_editor_show (&server);
+ server->name = g_strdup("");
+ server->host = g_strdup("");
+ server->port = 389;
+ server->description = g_strdup("");
+ server->rootdn = g_strdup("");
+ server->uri = g_strdup_printf ("ldap://%s:%d/%s", server->host, server->port, server->rootdn);
+ e_ldap_server_editor_show (server);
if (view->view)
object = GTK_OBJECT(view->view);
@@ -207,14 +207,12 @@ new_server_cb (BonoboUIHandler *uih, void *user_data, const char *path)
gtk_object_get(object, "book", &book, NULL);
g_assert (E_IS_BOOK (book));
- /* XXX write out the new server info */
+ /* write out the new server info */
+ e_ldap_storage_add_server (server);
/* now update the view */
- uri = g_strdup_printf ("ldap://%s:%d/%s", server.host, server.port, server.rootdn);
-
e_book_unload_uri (book);
-
- if (! e_book_load_uri (book, uri, null_cb, NULL)) {
+ if (! e_book_load_uri (book, server->uri, null_cb, NULL)) {
g_warning ("error calling load_uri!\n");
}
}