aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/addressbook.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2000-12-30 13:25:57 +0800
committerChris Toshok <toshok@src.gnome.org>2000-12-30 13:25:57 +0800
commitc4dfc8669bf21acf8c06cc7f79d0864c8e3d4fab (patch)
treec8ac453d3b440e00f0de9481441b5c9ad60491aa /addressbook/gui/component/addressbook.c
parent5e2b0aaf12ece4d701550cfda441eaaa38b89113 (diff)
downloadgsoc2013-evolution-c4dfc8669bf21acf8c06cc7f79d0864c8e3d4fab.tar.gz
gsoc2013-evolution-c4dfc8669bf21acf8c06cc7f79d0864c8e3d4fab.tar.zst
gsoc2013-evolution-c4dfc8669bf21acf8c06cc7f79d0864c8e3d4fab.zip
new function, calling our new config ui code. (control_activate): no
2000-12-29 Chris Toshok <toshok@helixcode.com> * gui/component/addressbook.c (config_cb): new function, calling our new config ui code. (control_activate): no longer load evolution-addressbook-ldap.xml, as it's not there. * gui/component/addressbook-component.c (owner_set_cb): setup_ldap_storage => addressbook_storage_setup. * gui/component/Makefile.am (evolution_addressbook_SOURCES): remove e-ldap-storage.[ch] and add addressbook-storage.[ch]. (glade_DATA): remove ldap-server-dialog.glade and add addressbook-config.glade. (EXTRA_DIST): same. * gui/component/addressbook-config.[ch]: add another dialog to give a list of our sources and offer the Add/Delete/Edit interface. This plugs into the previous dialog work (the source editor.) * gui/component/addressbook-storage.[ch]: new files, containing the remains of e-ldap-storage.[ch] and adding the new AddressbookSource type and it's subordinates. Also, the xml format has changed slightly and the file name is no longer ~/evolution/ldap-servers.xml - it's ~/evolution/addressbook-sources.xml. * gui/component/addressbook-config.glade: new file, new config interface. * gui/component/ldap-server-dialog.glade: removed. * gui/component/e-ldap-storage.[ch]: removed. svn path=/trunk/; revision=7198
Diffstat (limited to 'addressbook/gui/component/addressbook.c')
-rw-r--r--addressbook/gui/component/addressbook.c49
1 files changed, 5 insertions, 44 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 0392caf3b6..49367bd041 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -29,7 +29,7 @@
#include "e-contact-editor.h"
#include "e-contact-save-as.h"
-#include "e-ldap-server-dialog.h"
+#include "addressbook-config.h"
#include <addressbook/printing/e-contact-print.h>
@@ -127,46 +127,13 @@ new_contact_cb (BonoboUIComponent *uih, void *user_data, const char *path)
gtk_object_sink(GTK_OBJECT(card));
}
-#ifdef HAVE_LDAP
static void
-null_cb (EBook *book, EBookStatus status, gpointer closure)
+config_cb (BonoboUIComponent *uih, void *user_data, const char *path)
{
+ addressbook_config (NULL /* XXX */);
}
static void
-new_server_cb (BonoboUIComponent *uih, void *user_data, const char *path)
-{
- ELDAPServer *server = g_new (ELDAPServer, 1);
- EBook *book;
- AddressbookView *view = (AddressbookView *) user_data;
-
- /* fill in the defaults */
- server->name = g_strdup("");
- server->host = g_strdup("");
- server->port = g_strdup_printf("%d", 389);
- server->description = g_strdup("");
- server->rootdn = g_strdup("");
- server->uri = g_strdup_printf ("ldap://%s:%s/%s", server->host, server->port, server->rootdn);
- e_ldap_server_editor_show (server);
-
- gtk_object_get(GTK_OBJECT(view->view),
- "book", &book,
- NULL);
-
- g_assert (E_IS_BOOK (book));
-
- /* write out the new server info */
- e_ldap_storage_add_server (server);
-
- /* now update the view */
- e_book_unload_uri (book);
- if (! e_book_load_uri (book, server->uri, null_cb, NULL)) {
- g_warning ("error calling load_uri!\n");
- }
-}
-#endif
-
-static void
search_cb (BonoboUIComponent *uih, void *user_data, const char *path)
{
EBook *book;
@@ -302,14 +269,13 @@ BonoboUIVerb verbs [] = {
BONOBO_UI_UNSAFE_VERB ("ViewNewContact", new_contact_cb),
BONOBO_UI_UNSAFE_VERB ("ToolSearch", search_cb),
+ BONOBO_UI_UNSAFE_VERB ("AddressbookConfig", config_cb),
+
BONOBO_UI_UNSAFE_VERB ("ContactNew", new_contact_cb),
/* BONOBO_UI_UNSAFE_VERB ("ContactFind", find_contact_cb),*/
BONOBO_UI_UNSAFE_VERB ("ContactDelete", delete_contact_cb),
BONOBO_UI_UNSAFE_VERB ("ContactViewAll", show_all_contacts_cb),
BONOBO_UI_UNSAFE_VERB ("ContactStop", stop_loading_cb),
-#ifdef HAVE_LDAP
- BONOBO_UI_UNSAFE_VERB ("ContactNewServer", new_server_cb),
-#endif
BONOBO_UI_VERB_END
};
@@ -333,11 +299,6 @@ control_activate (BonoboControl *control,
bonobo_ui_util_set_ui (uic, EVOLUTION_DATADIR,
"evolution-addressbook.xml",
"evolution-addressbook");
-#ifdef HAVE_LDAP
- bonobo_ui_util_set_ui (uic, EVOLUTION_DATADIR,
- "evolution-addressbook-ldap.xml",
- "evolution-addressbook");
-#endif
e_addressbook_view_setup_menus (view->view, uic);