From 9b7cc54d6ff67c83590706ee0b6749a7e1f3ca21 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 18 Apr 2002 21:26:48 +0000 Subject: fix memory leaks. 2002-04-18 Chris Toshok * backend/pas/pas-backend-ldap.c (get_ldap_library_info): fix memory leaks. * gui/component/GNOME_Evolution_Addressbook.oaf.in: remove the Addressbook_ConfigControl stuff to LDAP_ConfigControl. * gui/component/Makefile.am (evolution_addressbook_SOURCES): remove addressbook-config.* and add ldap-config.* (glade_DATA): same. (evolution_addressbook_LDADD): add LDAP_LIBS. * gui/component/addressbook-component.c (owner_set_cb): addressbook_config_register_factory => ldap_config_register_factory. * gui/component/addressbook.c (book_open_cb): remove source->type check - they're always LDAP. (load_uri_cb): same. * gui/component/addressbook-storage.c (ldap_unparse_ssl): new function. (ldap_parse_ssl): new function. (addressbook_storage_init_source_uri): use a more flexible scheme to build up the uri's, and add in the ssl parameter. (load_source_data): fill in source->ssl, and remove source->type assignment. (addressbook_source_copy): copy source->ssl, and remove source->type copy. (create_ldap_folder): addressbook_create_new_source => ldap_config_create_new_source. * gui/component/addressbook-storage.h: remove AddressbookSourceType (it was always LDAP), and add AddressbookLDAPSSLType. svn path=/trunk/; revision=16524 --- addressbook/ChangeLog | 37 + addressbook/backend/pas/pas-backend-ldap.c | 4 +- .../component/GNOME_Evolution_Addressbook.oaf.in | 11 +- addressbook/gui/component/Makefile.am | 18 +- addressbook/gui/component/addressbook-component.c | 4 +- addressbook/gui/component/addressbook-config.c | 589 -- addressbook/gui/component/addressbook-config.glade | 1210 ---- addressbook/gui/component/addressbook-config.h | 34 - addressbook/gui/component/addressbook-storage.c | 65 +- addressbook/gui/component/addressbook-storage.h | 17 +- addressbook/gui/component/addressbook.c | 5 +- addressbook/gui/component/ldap-config.c | 1664 ++++++ addressbook/gui/component/ldap-config.glade | 5819 ++++++++++++++++++++ addressbook/gui/component/ldap-config.h | 33 + 14 files changed, 7634 insertions(+), 1876 deletions(-) delete mode 100644 addressbook/gui/component/addressbook-config.c delete mode 100644 addressbook/gui/component/addressbook-config.glade delete mode 100644 addressbook/gui/component/addressbook-config.h create mode 100644 addressbook/gui/component/ldap-config.c create mode 100644 addressbook/gui/component/ldap-config.glade create mode 100644 addressbook/gui/component/ldap-config.h (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 8fb8c5fc2b..7b151d6ebc 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,40 @@ +2002-04-18 Chris Toshok + + * backend/pas/pas-backend-ldap.c (get_ldap_library_info): fix + memory leaks. + + * gui/component/GNOME_Evolution_Addressbook.oaf.in: remove the + Addressbook_ConfigControl stuff to LDAP_ConfigControl. + + * gui/component/Makefile.am (evolution_addressbook_SOURCES): + remove addressbook-config.* and add ldap-config.* + (glade_DATA): same. + (evolution_addressbook_LDADD): add LDAP_LIBS. + + * gui/component/addressbook-component.c (owner_set_cb): + addressbook_config_register_factory => + ldap_config_register_factory. + + * gui/component/addressbook.c (book_open_cb): remove source->type + check - they're always LDAP. + (load_uri_cb): same. + + * gui/component/addressbook-storage.c (ldap_unparse_ssl): new + function. + (ldap_parse_ssl): new function. + (addressbook_storage_init_source_uri): use a more flexible scheme + to build up the uri's, and add in the ssl parameter. + (load_source_data): fill in source->ssl, and remove source->type + assignment. + (addressbook_source_copy): copy source->ssl, and remove + source->type copy. + (create_ldap_folder): addressbook_create_new_source => + ldap_config_create_new_source. + + * gui/component/addressbook-storage.h: remove + AddressbookSourceType (it was always LDAP), and add + AddressbookLDAPSSLType. + 2002-04-18 Dan Winship * backend/ebook/e-book-util.c (e_book_load_default_book): Append diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c index b8adccf7f1..9af0a8c1a4 100644 --- a/addressbook/backend/pas/pas-backend-ldap.c +++ b/addressbook/backend/pas/pas-backend-ldap.c @@ -448,12 +448,14 @@ get_ldap_library_info () info.ldapai_vendor_version % 1000); g_message ("extensions present:"); + /* yuck. we have to free these? */ for (i = 0; info.ldapai_extensions[i]; i++) { char *extension = info.ldapai_extensions[i]; g_message (extension); - /* yuck. we have to free this? */ ldap_memfree (extension); } + ldap_memfree (info.ldapai_extensions); + ldap_memfree (info.ldapai_vendor_name); } ldap_unbind_ext_s (ldap, NULL, NULL); diff --git a/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in b/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in index cfcd262220..1c12c46faf 100644 --- a/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in +++ b/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in @@ -131,7 +131,7 @@ - @@ -144,9 +144,9 @@ - + location="OAFIID:GNOME_Evolution_LDAPStorage_ConfigControlFactory"> @@ -161,11 +161,6 @@ - - - - - - -#include "addressbook-config.h" - -#include "addressbook-storage.h" - -#include "evolution-config-control.h" - -#include -#include - -#include - -#include -#include -#include -#include - -#include - -#include - -#include - - -#define CONFIG_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_ConfigControlFactory" - -typedef struct _AddressbookSourceDialog AddressbookSourceDialog; -typedef struct _AddressbookSourcePageItem AddressbookSourcePageItem; - -struct _AddressbookSourceDialog { - GladeXML *gui; - - GtkWidget *dialog; - - GtkWidget *notebook; - GtkWidget *basic_notebook; - GtkWidget *advanced_notebook; - - GtkWidget *name; - GtkWidget *host; - - GtkWidget *auth_checkbutton; - GtkWidget *auth_optionmenu; - GtkWidget *auth_notebook; - GtkWidget *email; - GtkWidget *binddn; - int auth; - - GtkWidget *port; - GtkWidget *rootdn; - GtkWidget *limit; - GtkWidget *scope_optionmenu; - AddressbookLDAPScopeType ldap_scope; - - gint id; /* button we closed the dialog with */ - - AddressbookSource *source; /* our result if the Ok button was clicked */ -}; - -static void -addressbook_source_edit_changed (GtkWidget *item, AddressbookSourceDialog *dialog) -{ - char *data; - gboolean complete = TRUE; - - if (complete) { - data = e_utf8_gtk_editable_get_chars (GTK_EDITABLE (dialog->name), 0, -1); - if (!data || !*data) - complete = FALSE; - g_free (data); - } - - if (complete) { - if (complete) { - data = e_utf8_gtk_editable_get_chars (GTK_EDITABLE (dialog->host), 0, -1); - if (!data || !*data) - complete = FALSE; - g_free (data); - } - - if (complete) { - data = e_utf8_gtk_editable_get_chars (GTK_EDITABLE (dialog->port), 0, -1); - if (!data || !*data) - complete = FALSE; - /* XXX more validation on port here */ - g_free (data); - } - } - - gnome_dialog_set_sensitive (GNOME_DIALOG (dialog->dialog), 0, complete); -} - -static void -auth_checkbutton_changed (GtkWidget *item, AddressbookSourceDialog *dialog) -{ - /* make sure the change is reflected by the state of the dialog's OK button */ - addressbook_source_edit_changed (item, dialog); - - - gtk_widget_set_sensitive (dialog->auth_optionmenu, - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->auth_checkbutton))); - gtk_widget_set_sensitive (dialog->auth_notebook, - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(dialog->auth_checkbutton))); -} - -static void -scope_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog) -{ - /* make sure the change is reflected by the state of the dialog's OK button */ - addressbook_source_edit_changed (item, dialog); - - dialog->ldap_scope = g_list_index (gtk_container_children (GTK_CONTAINER (item->parent)), - item); -} - -static void -auth_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog) -{ - /* make sure the change is reflected by the state of the dialog's OK button */ - addressbook_source_edit_changed (item, dialog); - - dialog->auth = g_list_index (gtk_container_children (GTK_CONTAINER (item->parent)), - item) + 1; - - gtk_notebook_set_page (GTK_NOTEBOOK(dialog->auth_notebook), dialog->auth - 1); -} - -typedef struct { - GtkWidget *notebook; - int page_num; -} FocusHelpClosure; - -static void -focus_help (GtkWidget *w, GdkEventFocus *event, FocusHelpClosure *closure) -{ - gtk_notebook_set_page (GTK_NOTEBOOK(closure->notebook), closure->page_num); -} - -static void -add_focus_handler (GtkWidget *widget, GtkWidget *notebook, int page_num) -{ - FocusHelpClosure *focus_closure = g_new0 (FocusHelpClosure, 1); - focus_closure->notebook = notebook; - focus_closure->page_num = page_num; - - gtk_signal_connect_full (GTK_OBJECT (widget), - "focus_in_event" /* XXX */, - (GtkSignalFunc) focus_help, NULL, - focus_closure, - (GtkDestroyNotify) g_free, - FALSE, FALSE); -} - -static void -addressbook_source_dialog_set_source (AddressbookSourceDialog *dialog, AddressbookSource *source) -{ - char *string; - e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->name), source ? source->name : ""); - e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->host), source ? source->host : ""); - e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->email), source ? source->email_addr : ""); - e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->binddn), source ? source->binddn : ""); - e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->port), source ? source->port : "389"); - e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->rootdn), source ? source->rootdn : ""); - - string = g_strdup_printf ("%d", source ? source->limit : 100); - e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->limit), string); - g_free (string); - - dialog->auth = source ? source->auth : ADDRESSBOOK_LDAP_AUTH_NONE; - if (dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE) { - gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->auth_optionmenu), dialog->auth - 1); - gtk_notebook_set_page (GTK_NOTEBOOK(dialog->auth_notebook), dialog->auth - 1); - } - - dialog->ldap_scope = source ? source->scope : ADDRESSBOOK_LDAP_SCOPE_ONELEVEL; - gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->scope_optionmenu), dialog->ldap_scope); - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(dialog->auth_checkbutton), source && source->auth != ADDRESSBOOK_LDAP_AUTH_NONE); - gtk_widget_set_sensitive (dialog->auth_optionmenu, source && source->auth != ADDRESSBOOK_LDAP_AUTH_NONE); - gtk_widget_set_sensitive (dialog->auth_notebook, source && source->auth != ADDRESSBOOK_LDAP_AUTH_NONE); -} - -static AddressbookSource * -addressbook_source_dialog_get_source (AddressbookSourceDialog *dialog) -{ - AddressbookSource *source = g_new0 (AddressbookSource, 1); - - source->name = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->name)); - source->host = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->host)); - source->email_addr = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->email)); - source->binddn = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->binddn)); - source->port = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->port)); - source->rootdn = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->rootdn)); - source->limit = atoi(e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->limit))); - source->scope = dialog->ldap_scope; - source->auth = dialog->auth; - - addressbook_storage_init_source_uri (source); - - return source; -} - -static void -addressbook_source_dialog_ok_clicked (GtkWidget *widget, AddressbookSourceDialog *dialog) -{ - dialog->source = addressbook_source_dialog_get_source (dialog); -} - -static void -add_scope_activate_cb (GtkWidget *item, AddressbookSourceDialog *dialog) -{ - gtk_signal_connect (GTK_OBJECT (item), "activate", - GTK_SIGNAL_FUNC (scope_optionmenu_activated), dialog); -} - -static void -add_auth_activate_cb (GtkWidget *item, AddressbookSourceDialog *dialog) -{ - gtk_signal_connect (GTK_OBJECT (item), "activate", - GTK_SIGNAL_FUNC (auth_optionmenu_activated), dialog); -} - - -static AddressbookSourceDialog* -addressbook_source_dialog (GladeXML *gui, AddressbookSource *source, GtkWidget *parent) -{ - AddressbookSourceDialog *dialog = g_new0 (AddressbookSourceDialog, 1); - GtkWidget *menu; - - dialog->gui = gui; - - dialog->dialog = glade_xml_get_widget (gui, "add_addressbook"); - - if (source) - gtk_window_set_title (GTK_WINDOW (dialog->dialog), _("Edit Addressbook")); - - gtk_window_set_modal (GTK_WINDOW (dialog->dialog), TRUE); - gtk_window_set_policy (GTK_WINDOW (dialog->dialog), - FALSE, TRUE, FALSE); - - gnome_dialog_set_parent (GNOME_DIALOG (dialog->dialog), - GTK_WINDOW (parent)); - - dialog->notebook = glade_xml_get_widget (gui, "add-addressbook-notebook"); - dialog->basic_notebook = glade_xml_get_widget (gui, "basic-notebook"); - dialog->advanced_notebook = glade_xml_get_widget (gui, "advanced-notebook"); - - /* BASIC STUFF */ - dialog->name = glade_xml_get_widget (gui, "account-name-entry"); - gtk_signal_connect (GTK_OBJECT (dialog->name), "changed", - GTK_SIGNAL_FUNC (addressbook_source_edit_changed), dialog); - add_focus_handler (dialog->name, dialog->basic_notebook, 0); - - dialog->host = glade_xml_get_widget (gui, "server-name-entry"); - gtk_signal_connect (GTK_OBJECT (dialog->host), "changed", - GTK_SIGNAL_FUNC (addressbook_source_edit_changed), dialog); - add_focus_handler (dialog->host, dialog->basic_notebook, 1); - - /* BASIC -> AUTH STUFF */ - dialog->auth_notebook = glade_xml_get_widget (gui, "auth-notebook"); - - dialog->auth_checkbutton = glade_xml_get_widget (gui, "auth-checkbutton"); - add_focus_handler (dialog->auth_checkbutton, dialog->basic_notebook, 2); - gtk_signal_connect (GTK_OBJECT (dialog->auth_checkbutton), "toggled", - GTK_SIGNAL_FUNC (auth_checkbutton_changed), dialog); - - dialog->auth_optionmenu = glade_xml_get_widget (gui, "auth-optionmenu"); - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU(dialog->auth_optionmenu)); - gtk_container_foreach (GTK_CONTAINER (menu), (GtkCallback)add_auth_activate_cb, dialog); - add_focus_handler (dialog->auth_optionmenu, dialog->basic_notebook, 3); - - dialog->email = glade_xml_get_widget (gui, "email-entry"); - add_focus_handler (dialog->email, dialog->basic_notebook, 4); - - dialog->binddn = glade_xml_get_widget (gui, "dn-entry"); - add_focus_handler (dialog->binddn, dialog->basic_notebook, 5); - - /* ADVANCED STUFF */ - dialog->port = glade_xml_get_widget (gui, "port-entry"); - gtk_signal_connect (GTK_OBJECT (dialog->port), "changed", - GTK_SIGNAL_FUNC (addressbook_source_edit_changed), dialog); - add_focus_handler (dialog->port, dialog->advanced_notebook, 0); - - dialog->rootdn = glade_xml_get_widget (gui, "rootdn-entry"); - gtk_signal_connect (GTK_OBJECT (dialog->rootdn), "changed", - GTK_SIGNAL_FUNC (addressbook_source_edit_changed), dialog); - add_focus_handler (dialog->rootdn, dialog->advanced_notebook, 1); - - dialog->scope_optionmenu = glade_xml_get_widget (gui, "scope-optionmenu"); - add_focus_handler (dialog->scope_optionmenu, dialog->advanced_notebook, 2); - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU(dialog->scope_optionmenu)); - gtk_container_foreach (GTK_CONTAINER (menu), (GtkCallback)add_scope_activate_cb, dialog); - - dialog->limit = glade_xml_get_widget (gui, "limit-entry"); - gtk_signal_connect (GTK_OBJECT (dialog->limit), "changed", - GTK_SIGNAL_FUNC (addressbook_source_edit_changed), dialog); - add_focus_handler (dialog->limit, dialog->advanced_notebook, 3); - - /* fill in source info if there is some */ - addressbook_source_dialog_set_source (dialog, source); - - /* always start out on the first page. */ - gtk_notebook_set_page (GTK_NOTEBOOK (dialog->notebook), 0); - - gnome_dialog_set_sensitive (GNOME_DIALOG (dialog->dialog), 0, FALSE); - - gnome_dialog_button_connect( GNOME_DIALOG (dialog->dialog), 0, - GTK_SIGNAL_FUNC (addressbook_source_dialog_ok_clicked), - dialog); - - /* and set focus to be the Account field (the first editable - field on the first page) */ - gtk_widget_grab_focus (dialog->name); - - return dialog; -} - -static AddressbookSourceDialog * -addressbook_config_source_with_gui (GladeXML *gui, AddressbookSource *source, GtkWidget *parent) -{ - AddressbookSourceDialog* dialog; - - dialog = addressbook_source_dialog (gui, source, parent); - - gnome_dialog_close_hides (GNOME_DIALOG(dialog->dialog), TRUE); - - dialog->id = gnome_dialog_run_and_close (GNOME_DIALOG (dialog->dialog)); - - return dialog; -} - -void -addressbook_create_new_source (const char *new_source, GtkWidget *parent) -{ - AddressbookSourceDialog *dialog; - GladeXML *gui; - - gui = glade_xml_new (EVOLUTION_GLADEDIR "/addressbook-config.glade", NULL); - - dialog = addressbook_source_dialog (gui, NULL, parent); - - e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->name), new_source); - - gnome_dialog_close_hides (GNOME_DIALOG(dialog->dialog), TRUE); - - dialog->id = gnome_dialog_run_and_close (GNOME_DIALOG (dialog->dialog)); - - gtk_object_unref (GTK_OBJECT (dialog->gui)); - - if (dialog->id == 0) { - /* Ok was clicked */ - addressbook_storage_add_source (addressbook_source_copy(dialog->source)); - addressbook_storage_write_sources(); - } -} - - - -typedef struct { - EvolutionConfigControl *config_control; - GtkWidget *page; - - GladeXML *gui; - GNOME_Evolution_Shell shell; - - GtkWidget *clistSources; - GtkWidget *addSource; - GtkWidget *editSource; - GtkWidget *deleteSource; - gint source_row; -} AddressbookDialog; - -static void -update_sensitivity (AddressbookDialog *dialog) -{ - gboolean sensitive = dialog->source_row != -1; - - gtk_widget_set_sensitive (dialog->editSource, sensitive); - gtk_widget_set_sensitive (dialog->deleteSource, sensitive); -} - -static void -add_source_clicked (GtkWidget *widget, AddressbookDialog *dialog) -{ - AddressbookSourceDialog *sdialog; - - sdialog = addressbook_config_source_with_gui (dialog->gui, NULL, dialog->page); - if (sdialog->id == 0) { - /* Ok was clicked */ - AddressbookSource *source = addressbook_source_copy(sdialog->source); - gint row; - gchar *text[2]; - - text[0] = source->name; - text[1] = source->host; - - row = e_utf8_gtk_clist_append (GTK_CLIST(dialog->clistSources), text); - gtk_clist_set_row_data_full (GTK_CLIST(dialog->clistSources), row, source, (GtkDestroyNotify) addressbook_source_free); - - evolution_config_control_changed (dialog->config_control); - update_sensitivity (dialog); - } -} - -static void -edit_source_clicked (GtkWidget *widget, AddressbookDialog *dialog) -{ - AddressbookSource *source; - AddressbookSourceDialog *sdialog; - - source = gtk_clist_get_row_data (GTK_CLIST (dialog->clistSources), dialog->source_row); - - sdialog = addressbook_config_source_with_gui (dialog->gui, source, dialog->page); - if (sdialog->id == 0) { - /* Ok was clicked */ - source = addressbook_source_copy(sdialog->source); - - e_utf8_gtk_clist_set_text (GTK_CLIST (dialog->clistSources), dialog->source_row, 0, source->name); - e_utf8_gtk_clist_set_text (GTK_CLIST (dialog->clistSources), dialog->source_row, 1, source->host); - gtk_clist_set_row_data (GTK_CLIST (dialog->clistSources), dialog->source_row, source); - - evolution_config_control_changed (dialog->config_control); - - update_sensitivity (dialog); - } -} - -static void -delete_source_clicked (GtkWidget *widget, AddressbookDialog *dialog) -{ - gtk_clist_remove (GTK_CLIST (dialog->clistSources), dialog->source_row); - dialog->source_row = -1; - - evolution_config_control_changed (dialog->config_control); - - update_sensitivity (dialog); -} - -static void -sources_select_row (GtkWidget *widget, gint row, gint column, - GdkEventButton *event, AddressbookDialog *dialog) -{ - dialog->source_row = row; - - update_sensitivity (dialog); -} - -static void -config_control_destroy_callback (EvolutionConfigControl *config_control, - void *data) -{ - AddressbookDialog *dialog; - - dialog = (AddressbookDialog *) data; - - gtk_object_unref (GTK_OBJECT (dialog->gui)); - g_free (dialog); -} - -static void -config_control_apply_callback (EvolutionConfigControl *config_control, - void *data) -{ - AddressbookDialog *dialog; - int i; - - dialog = (AddressbookDialog *) data; - - addressbook_storage_clear_sources(); - - for (i = 0; i < GTK_CLIST(dialog->clistSources)->rows; i ++) { - AddressbookSource *source = (AddressbookSource*)gtk_clist_get_row_data (GTK_CLIST (dialog->clistSources), i); - addressbook_storage_add_source (addressbook_source_copy (source)); - } - - addressbook_storage_write_sources(); -} - -static EvolutionConfigControl * -config_control_new (GNOME_Evolution_Shell shell) -{ - AddressbookDialog *dialog; - GladeXML *gui; - GtkWidget *clist; - GList *l; - - dialog = g_new0 (AddressbookDialog, 1); - - dialog->source_row = -1; - - gui = glade_xml_new (EVOLUTION_GLADEDIR "/addressbook-config.glade", NULL); - dialog->gui = gui; - dialog->shell = shell; - - dialog->page = glade_xml_get_widget (gui, "addressbook_sources_main_hbox"); - - gtk_widget_ref (dialog->page); - gtk_container_remove (GTK_CONTAINER (dialog->page->parent), dialog->page); - - dialog->config_control = evolution_config_control_new (dialog->page); - gtk_signal_connect (GTK_OBJECT (dialog->config_control), "apply", - GTK_SIGNAL_FUNC (config_control_apply_callback), dialog); - gtk_signal_connect (GTK_OBJECT (dialog->config_control), "destroy", - GTK_SIGNAL_FUNC (config_control_destroy_callback), dialog); - - gtk_widget_unref (dialog->page); - - clist = glade_xml_get_widget (gui, "clistSources"); - dialog->clistSources = clist; - - gtk_clist_column_titles_passive (GTK_CLIST (clist)); - gtk_clist_set_column_width (GTK_CLIST (clist), 0, 80); - - dialog->addSource = glade_xml_get_widget (gui, "addSource"); - gtk_signal_connect (GTK_OBJECT(dialog->addSource), "clicked", - GTK_SIGNAL_FUNC (add_source_clicked), - dialog); - - dialog->editSource = glade_xml_get_widget (gui, "editSource"); - gtk_signal_connect (GTK_OBJECT(dialog->editSource), "clicked", - GTK_SIGNAL_FUNC (edit_source_clicked), - dialog); - - dialog->deleteSource = glade_xml_get_widget (gui, "deleteSource"); - gtk_signal_connect (GTK_OBJECT(dialog->deleteSource), "clicked", - GTK_SIGNAL_FUNC (delete_source_clicked), - dialog); - - update_sensitivity (dialog); - - l = addressbook_storage_get_sources (); - for (; l != NULL; l = l->next) { - AddressbookSource *source; - gint row; - gchar *text[2]; - - source = addressbook_source_copy ((AddressbookSource*)l->data); - - text[0] = source->name; - text[1] = source->host; - - row = e_utf8_gtk_clist_append (GTK_CLIST(clist), text); - gtk_clist_set_row_data_full (GTK_CLIST(clist), row, source, (GtkDestroyNotify) addressbook_source_free); - } - - gtk_signal_connect (GTK_OBJECT (clist), "select_row", - GTK_SIGNAL_FUNC (sources_select_row), - dialog); - - return dialog->config_control; -} - - -/* Implementation of the factory for the configuration control. */ - -static BonoboGenericFactory *factory = NULL; - -static BonoboObject * -config_control_factory_fn (BonoboGenericFactory *factory, - void *data) -{ - GNOME_Evolution_Shell shell; - EvolutionConfigControl *control; - - shell = (GNOME_Evolution_Shell) data; - - control = config_control_new (shell); - return BONOBO_OBJECT (control); -} - -gboolean -addressbook_config_register_factory (GNOME_Evolution_Shell shell) -{ - g_return_val_if_fail (shell != CORBA_OBJECT_NIL, FALSE); - - factory = bonobo_generic_factory_new (CONFIG_CONTROL_FACTORY_ID, - config_control_factory_fn, - shell); - - if (factory != NULL) { - return TRUE; - } else { - g_warning ("Cannot register factory %s", CONFIG_CONTROL_FACTORY_ID); - return FALSE; - } -} diff --git a/addressbook/gui/component/addressbook-config.glade b/addressbook/gui/component/addressbook-config.glade deleted file mode 100644 index 7396c3c818..0000000000 --- a/addressbook/gui/component/addressbook-config.glade +++ /dev/null @@ -1,1210 +0,0 @@ - - - - - addressbook-config-mockup - addressbook-config-mockup - - src - pixmaps - C - True - True - - - - GnomeDialog - add_addressbook - False - Add Addressbook - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 417 - 332 - False - True - False - False - False - - - GtkVBox - GnomeDialog:vbox - dialog-vbox1 - False - 8 - - 4 - True - True - - - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - button1 - True - True - GNOME_STOCK_BUTTON_OK - - - - GtkButton - button3 - True - True - GNOME_STOCK_BUTTON_CANCEL - - - - - GtkNotebook - main_notebook - True - True - True - GTK_POS_TOP - False - 2 - 2 - False - - 0 - True - True - - - - GtkVBox - vbox1 - 3 - False - 3 - - - GtkLabel - label29 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkTable - table1 - 3 - 2 - 2 - False - 3 - 3 - - 0 - False - True - - - - GtkLabel - label15 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - account-name-entry - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - - - GtkEntry - account-name-entry - True - True - True - 0 - - - 1 - 2 - 0 - 1 - 0 - 0 - True - False - False - False - True - False - - - - - GtkLabel - label16 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - server-name-entry - - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - - - - GtkEntry - server-name-entry - True - True - True - 0 - - - 1 - 2 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - - - - - - GtkAlignment - alignment2 - 0 - 0.5 - 1 - 1 - - 0 - False - False - - - - GtkVBox - auth-vbox - False - 3 - - - GtkHBox - hbox9 - False - 0 - - 0 - False - False - - - - GtkCheckButton - auth-checkbutton - True - - False - True - - 0 - False - False - - - - - GtkHBox - hbox10 - False - 3 - - 0 - True - True - - - - GtkOptionMenu - auth-optionmenu - True - Email address -Distinguished name (DN) - - 0 - - 0 - False - False - - - - - - - GtkNotebook - auth-notebook - False - False - GTK_POS_TOP - False - 2 - 2 - False - - 0 - True - True - - - - GtkHBox - hbox5 - 3 - False - 3 - - - GtkLabel - email-label - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - email-entry - - 0 - False - False - - - - - GtkEntry - email-entry - True - True - True - 0 - - - 0 - True - True - - - - - - GtkLabel - Notebook:tab - label52 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkHBox - hbox6 - False - 3 - - - GtkLabel - dn-label - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - dn-entry - - 0 - False - False - - - - - GtkEntry - dn-entry - True - True - True - 0 - - - 0 - True - True - - - - - - GtkLabel - Notebook:tab - label53 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - - GtkNotebook - basic-notebook - False - False - GTK_POS_TOP - False - 2 - 2 - False - - 0 - True - True - - - - GtkLabel - label28 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - Notebook:tab - label18 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - label31 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - Notebook:tab - label19 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - label57 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - Notebook:tab - label56 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - label61 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - Notebook:tab - label60 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - label48 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - Notebook:tab - label47 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - label59 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - Notebook:tab - label58 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - GtkLabel - Notebook:tab - label12 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkVBox - vbox2 - 3 - False - 3 - - - GtkLabel - label30 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkTable - table2 - 3 - 4 - 2 - False - 3 - 3 - - 0 - False - False - - - - GtkLabel - label22 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - port-entry - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - - - GtkEntry - port-entry - True - True - True - 0 - 389 - - 1 - 2 - 0 - 1 - 0 - 0 - True - False - False - False - True - False - - - - - GtkLabel - label23 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - rootdn-entry - - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - - - - GtkEntry - rootdn-entry - True - True - True - 0 - - - 1 - 2 - 1 - 2 - 0 - 0 - True - False - False - False - True - False - - - - - GtkLabel - label24 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - - - - - GtkAlignment - alignment1 - 7.45058e-09 - 7.45058e-09 - 0 - 1 - - 1 - 2 - 2 - 3 - 0 - 0 - True - False - False - False - True - False - - - - GtkOptionMenu - scope-optionmenu - True - One -Base -Sub - - 0 - - - - - GtkLabel - label49 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - limit-entry - - 0 - 1 - 3 - 4 - 0 - 0 - False - False - False - False - True - False - - - - - GtkEntry - limit-entry - True - True - True - 0 - 100 - - 1 - 2 - 3 - 4 - 0 - 0 - True - False - False - False - True - False - - - - - - GtkNotebook - advanced-notebook - False - False - GTK_POS_TOP - False - 2 - 2 - False - - 0 - True - True - - - - GtkLabel - label35 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - Notebook:tab - label25 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - label36 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - Notebook:tab - label26 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - label37 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - Notebook:tab - label27 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - label51 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - Notebook:tab - label50 - - GTK_JUSTIFY_CENTER - True - 0.5 - 0.5 - 0 - 0 - - - - - - GtkLabel - Notebook:tab - label13 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - - GnomeDialog - addressbook_sources - False - Addressbook Sources - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 355 - 285 - True - True - False - False - False - - - GtkVBox - GnomeDialog:vbox - dialog-vbox2 - False - 8 - - 4 - True - True - - - - GtkHButtonBox - GnomeDialog:action_area - dialog-action_area2 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - button7 - True - True - GNOME_STOCK_BUTTON_OK - - - - GtkButton - button8 - True - True - GNOME_STOCK_BUTTON_APPLY - - - - GtkButton - button9 - True - True - GNOME_STOCK_BUTTON_CLOSE - - - - - GtkHBox - addressbook_sources_main_hbox - False - 0 - - 0 - True - True - - - - GtkScrolledWindow - scrolledwindow2 - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - 0 - True - True - - - - GtkCList - clistSources - True - 2 - 100,80 - GTK_SELECTION_SINGLE - True - GTK_SHADOW_IN - - - GtkLabel - CList:title - label43 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - CList:title - label44 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - GtkVBox - vbox4 - False - 0 - - 0 - False - False - - - - GtkLabel - label45 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkVButtonBox - vbuttonbox3 - GTK_BUTTONBOX_START - 0 - 85 - 27 - 7 - 0 - - 0 - True - True - - - - GtkButton - addSource - True - True - - GTK_RELIEF_NORMAL - - - - GtkButton - editSource - True - True - - GTK_RELIEF_NORMAL - - - - GtkButton - deleteSource - True - True - - GTK_RELIEF_NORMAL - - - - - - - - diff --git a/addressbook/gui/component/addressbook-config.h b/addressbook/gui/component/addressbook-config.h deleted file mode 100644 index e1bdc18bae..0000000000 --- a/addressbook/gui/component/addressbook-config.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* addressbook-storage.h - * - * Copyright (C) 2000 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Author: Chris Toshok - */ - -#ifndef __ADDRESSBOOK_CONFIG_H__ -#define __ADDRESSBOOK_CONFIG_H__ - -#include "addressbook-storage.h" - -void addressbook_config (GNOME_Evolution_Shell shell); -void addressbook_create_new_source (const char *new_source, - GtkWidget *parent); - -gboolean addressbook_config_register_factory (GNOME_Evolution_Shell shell); - -#endif /* __ADDRESSBOOK_CONFIG_H__ */ diff --git a/addressbook/gui/component/addressbook-storage.c b/addressbook/gui/component/addressbook-storage.c index 95af6c52ad..2b54c5019e 100644 --- a/addressbook/gui/component/addressbook-storage.c +++ b/addressbook/gui/component/addressbook-storage.c @@ -65,7 +65,7 @@ #include "evolution-shell-component.h" -#include "addressbook-config.h" +#include "ldap-config.h" #define ADDRESSBOOK_SOURCES_XML "addressbook-sources.xml" @@ -151,7 +151,7 @@ create_ldap_folder (EvolutionStorage *storage, const Bonobo_Listener listener, notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); return; } - addressbook_create_new_source (path + 1, NULL); + ldap_config_create_new_source (path + 1, NULL); notify_listener (listener, GNOME_Evolution_Storage_OK); } @@ -322,6 +322,38 @@ ldap_parse_scope (const char *scope) } #endif +static char * +ldap_unparse_ssl (AddressbookLDAPSSLType ssl_type) +{ + switch (ssl_type) { + case ADDRESSBOOK_LDAP_SSL_NEVER: + return "never"; + case ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE: + return "whenever_possible"; + case ADDRESSBOOK_LDAP_SSL_ALWAYS: + return "always"; + default: + g_assert(0); + return ""; + } +} + +#ifdef HAVE_LDAP +static AddressbookLDAPSSLType +ldap_parse_ssl (const char *ssl) +{ + if (!ssl) + return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE; /* XXX good default? */ + + if (!strcmp (ssl, "always")) + return ADDRESSBOOK_LDAP_SSL_ALWAYS; + else if (!strcmp (ssl, "never")) + return ADDRESSBOOK_LDAP_SSL_NEVER; + else + return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE; +} +#endif + const char* addressbook_storage_auth_type_to_string (AddressbookLDAPAuthType auth_type) { @@ -331,18 +363,27 @@ addressbook_storage_auth_type_to_string (AddressbookLDAPAuthType auth_type) void addressbook_storage_init_source_uri (AddressbookSource *source) { + GString *str; + if (source->uri) g_free (source->uri); + str = g_string_new ("ldap://"); + + g_string_sprintfa (str, "%s:%s/%s?"/*trigraph prevention*/"?%s", + source->host, source->port, source->rootdn, ldap_unparse_scope (source->scope)); + if (source->limit != 100) - source->uri = g_strdup_printf ("ldap://%s:%s/%s?"/*trigraph prevention*/ "?%s;limit=%d", - source->host, source->port, - source->rootdn, ldap_unparse_scope(source->scope), - source->limit); - else - source->uri = g_strdup_printf ("ldap://%s:%s/%s?"/*trigraph prevention*/ "?%s", - source->host, source->port, - source->rootdn, ldap_unparse_scope(source->scope)); + g_string_sprintfa (str, ";limit=%d", source->limit); + + if (source->ssl != ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE) + g_string_sprintfa (str, ";ssl=%s", ldap_unparse_ssl (source->ssl)); + + /* XXX need to do timeout info */ + + source->uri = str->str; + + g_string_free (str, FALSE); } #ifdef HAVE_LDAP @@ -395,12 +436,12 @@ load_source_data (const char *file_path) source = g_new0 (AddressbookSource, 1); if (!strcmp (child->name, "contactserver")) { - source->type = ADDRESSBOOK_SOURCE_LDAP; source->port = get_string_value (child, "port"); source->host = get_string_value (child, "host"); source->rootdn = get_string_value (child, "rootdn"); source->scope = ldap_parse_scope (get_string_value (child, "scope")); source->auth = ldap_parse_auth (get_string_value (child, "authmethod")); + source->ssl = ldap_parse_ssl (get_string_value (child, "ssl")); source->email_addr = get_string_value (child, "emailaddr"); source->binddn = get_string_value (child, "binddn"); source->limit = get_integer_value (child, "limit", 100); @@ -645,7 +686,6 @@ addressbook_source_copy (const AddressbookSource *source) copy = g_new0 (AddressbookSource, 1); copy->name = g_strdup (source->name); copy->description = g_strdup (source->description); - copy->type = source->type; copy->uri = g_strdup (source->uri); copy->host = g_strdup (source->host); @@ -653,6 +693,7 @@ addressbook_source_copy (const AddressbookSource *source) copy->rootdn = g_strdup (source->rootdn); copy->scope = source->scope; copy->auth = source->auth; + copy->ssl = source->ssl; copy->email_addr = g_strdup (source->email_addr); copy->binddn = g_strdup (source->binddn); copy->remember_passwd = source->remember_passwd; diff --git a/addressbook/gui/component/addressbook-storage.h b/addressbook/gui/component/addressbook-storage.h index 6d0c6252cf..edaa5cfb83 100644 --- a/addressbook/gui/component/addressbook-storage.h +++ b/addressbook/gui/component/addressbook-storage.h @@ -26,12 +26,6 @@ #include "evolution-shell-component.h" #include "evolution-storage.h" -typedef enum { - ADDRESSBOOK_SOURCE_LDAP, - ADDRESSBOOK_SOURCE_FILE, - ADDRESSBOOK_SOURCE_LAST -} AddressbookSourceType; - typedef enum { ADDRESSBOOK_LDAP_AUTH_NONE, ADDRESSBOOK_LDAP_AUTH_SIMPLE_EMAIL, @@ -45,8 +39,13 @@ typedef enum { ADDRESSBOOK_LDAP_SCOPE_LAST } AddressbookLDAPScopeType; +typedef enum { + ADDRESSBOOK_LDAP_SSL_NEVER, + ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE, + ADDRESSBOOK_LDAP_SSL_ALWAYS +} AddressbookLDAPSSLType; + typedef struct { - AddressbookSourceType type; char *name; char *description; char *host; @@ -54,11 +53,13 @@ typedef struct { char *rootdn; AddressbookLDAPScopeType scope; AddressbookLDAPAuthType auth; + AddressbookLDAPSSLType ssl; char *email_addr; /* used in AUTH_SIMPLE_EMAIL */ char *binddn; /* used in AUTH_SIMPLE_BINDDN */ gboolean remember_passwd; - char *uri; /* filled in from the above */ int limit; + + char *uri; /* filled in from the above */ } AddressbookSource; void addressbook_storage_setup (EvolutionShellComponent *shell_component, diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index 42f05f8217..99ba3b9521 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -32,7 +32,7 @@ #include "evolution-activity-client.h" #include "e-contact-editor.h" #include "e-contact-save-as.h" -#include "addressbook-config.h" +#include "ldap-config.h" #include "addressbook.h" #include "addressbook-component.h" #include "addressbook/gui/search/e-addressbook-search-dialog.h" @@ -519,7 +519,7 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure) source = addressbook_storage_get_source_by_uri (view->uri); - if (source && source->type == ADDRESSBOOK_SOURCE_LDAP) { + if (source) { #if HAVE_LDAP label = gtk_label_new ( _("We were unable to open this addressbook. This either\n" @@ -629,7 +629,6 @@ load_uri_cb (EBook *book, EBookStatus status, gpointer closure) /* check if the addressbook needs authentication */ if (source && - source->type == ADDRESSBOOK_SOURCE_LDAP && source->auth != ADDRESSBOOK_LDAP_AUTH_NONE) { const char *password; char *pass_dup = NULL; diff --git a/addressbook/gui/component/ldap-config.c b/addressbook/gui/component/ldap-config.c new file mode 100644 index 0000000000..59e924c5af --- /dev/null +++ b/addressbook/gui/component/ldap-config.c @@ -0,0 +1,1664 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +/*#define STANDALONE*/ +/*#define NEW_ADVANCED_UI*/ + +#include + +#include "ldap-config.h" + +#include "addressbook-storage.h" + +#include "evolution-config-control.h" + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +#include "ldap.h" +#include "ldap_schema.h" + +#define LDAP_PORT_STRING "389" +#define LDAPS_PORT_STRING "636" + +#define GLADE_FILE_NAME "ldap-config.glade" + +#define CONFIG_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_LDAPStorage_ConfigControlFactory" + +GtkWidget* addressbook_dialog_create_sources_table (char *name, char *string1, char *string2, + int num1, int num2); +GtkWidget* supported_bases_create_table (char *name, char *string1, char *string2, + int num1, int num2); + +#ifdef NEW_ADVANCED_GUI +GtkWidget* objectclasses_create_server_table (char *name, char *string1, char *string2, + int num1, int num2); +GtkWidget* objectclasses_create_evolution_table (char *name, char *string1, char *string2, + int num1, int num2); +#endif + +/* default objectclasses */ +#define TOP "top" +#define PERSON "person" +#define ORGANIZATIONALPERSON "organizationalPerson" +#define INETORGPERSON "inetOrgPerson" +#define EVOLUTIONPERSON "evolutionPerson" +#define CALENTRY "calEntry" + + +typedef struct { + GtkWidget *notebook; + int page_num; +} FocusHelpClosure; + +static void +focus_help (GtkWidget *w, GdkEventFocus *event, FocusHelpClosure *closure) +{ + gtk_notebook_set_page (GTK_NOTEBOOK(closure->notebook), closure->page_num); +} + +static void +add_focus_handler (GtkWidget *widget, GtkWidget *notebook, int page_num) +{ + FocusHelpClosure *focus_closure = g_new0 (FocusHelpClosure, 1); + focus_closure->notebook = notebook; + focus_closure->page_num = page_num; + + gtk_signal_connect_full (GTK_OBJECT (widget), + "focus_in_event" /* XXX */, + (GtkSignalFunc) focus_help, NULL, + focus_closure, + (GtkDestroyNotify) g_free, + FALSE, FALSE); +} + + +typedef struct { + EvolutionConfigControl *config_control; + GtkWidget *page; + + GladeXML *gui; + GNOME_Evolution_Shell shell; + + GtkWidget *sourcesTable; + ETableModel *sourcesModel; + GtkWidget *addSource; + GtkWidget *editSource; + GtkWidget *deleteSource; + +} AddressbookDialog; + +typedef struct { + AddressbookDialog *addressbook_dialog; + GladeXML *gui; + + GtkWidget *window; + GtkWidget *druid; /* only used (obviously) in the druid */ + + /* info page fields */ + GtkSignalFunc general_modify_func; + GtkWidget *host; + GtkWidget *auth_optionmenu; + AddressbookLDAPAuthType auth; + GtkWidget *auth_label_notebook; + GtkWidget *auth_entry_notebook; + GtkWidget *email; + GtkWidget *binddn; + + /* connecting page fields */ + GtkSignalFunc connecting_modify_func; + GtkWidget *port_combo; + GtkWidget *ssl_optionmenu; + int ssl; /* XXX this should be AddressbookLDAPSSLType */ + + /* searching page fields */ + GtkSignalFunc searching_modify_func; + GtkWidget *rootdn; + AddressbookLDAPScopeType scope; + GtkWidget *scope_optionmenu; + GtkWidget *timeout_scale; + GtkWidget *limit_spinbutton; + + /* display name page fields */ + GtkWidget *display_name; + gboolean display_name_changed; /* only used in the druid */ + + gboolean schema_query_successful; + +#ifdef NEW_ADVANCED_UI + /* objectclasses tab fields */ + GPtrArray *server_objectclasses; /* the objectclasses available on the server */ + GPtrArray *evolution_objectclasses; /* the objectclasses evolution will use */ + GPtrArray *default_objectclasses; /* the objectclasses we default to (actually the + intersection between defaults and server_objectclasses) */ + GtkSignalFunc objectclasses_modify_func; + GtkWidget *objectclasses_server_table; + ETableModel *objectclasses_server_model; + GtkWidget *objectclasses_evolution_table; + ETableModel *objectclasses_evolution_model; + GtkWidget *objectclasses_add_button; + GtkWidget *objectclasses_remove_button; +#endif + + /* stuff for the account editor window */ + int source_model_row; + GtkWidget *ok_button; + GtkWidget *apply_button; + GtkWidget *close_button; + GtkWidget *advanced_button_notebook; + GtkWidget *notebook; /* the toplevel notebook */ +#ifdef NEW_ADVANCED_UI + GtkWidget *objectclasses_tab; + GtkWidget *objectclasses_label; + GtkWidget *mappings_tab; + GtkWidget *mappings_label; + GtkWidget *dn_customization_tab; + GtkWidget *dn_customization_label; +#endif + gboolean advanced; + +} AddressbookSourceDialog; + + +/* ldap api foo */ +static LDAP * +addressbook_ldap_init (AddressbookSource *source) +{ + LDAP *ldap = ldap_init (source->host, atoi(source->port)); + + if (!ldap) { + gnome_error_dialog (_("Failed to connect to LDAP server")); + + return NULL; + } + + /* XXX do TLS if it's configured in */ + + return ldap; +} + +static int +addressbook_ldap_auth (AddressbookSource *source, LDAP *ldap) +{ + int ldap_error; + + /* XXX use auth info from source */ + ldap_error = ldap_simple_bind_s (ldap, NULL, NULL); + if (LDAP_SUCCESS != ldap_error) + gnome_error_dialog (_("Failed to authenticate with LDAP server")); + return ldap_error; + +} + +static int +addressbook_root_dse_query (AddressbookSource *source, LDAP *ldap, char **attrs, LDAPMessage **resp) +{ + int ldap_error; + struct timeval timeout; + + /* 3 second timeout */ + timeout.tv_sec = 3; + timeout.tv_usec = 0; + + ldap_error = ldap_search_ext_s (ldap, + LDAP_ROOT_DSE, LDAP_SCOPE_BASE, + "(objectclass=*)", + attrs, 0, NULL, NULL, NULL, 0, resp); + if (LDAP_SUCCESS != ldap_error) + gnome_error_dialog (_("Could not perform query on Root DSE")); + + return ldap_error; +} + + +static AddressbookSource * +addressbook_dialog_get_source (AddressbookSourceDialog *dialog) +{ + AddressbookSource *source = g_new0 (AddressbookSource, 1); + + source->name = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->display_name)); + source->host = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->host)); + source->email_addr = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->email)); + source->binddn = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->binddn)); + source->port = e_utf8_gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(dialog->port_combo)->entry)); + source->rootdn = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->rootdn)); + source->limit = atoi(e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->limit_spinbutton))); + source->scope = dialog->scope; + source->auth = dialog->auth; + + addressbook_storage_init_source_uri (source); + + return source; +} + +static void +addressbook_source_dialog_set_source (AddressbookSourceDialog *dialog, AddressbookSource *source) +{ + char *string; + e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->display_name), source ? source->name : ""); + e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->host), source ? source->host : ""); + e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->email), source ? source->email_addr : ""); + e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->binddn), source ? source->binddn : ""); + e_utf8_gtk_entry_set_text (GTK_ENTRY (GTK_COMBO(dialog->port_combo)->entry), source ? source->port : LDAP_PORT_STRING); + e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->rootdn), source ? source->rootdn : ""); + + string = g_strdup_printf ("%d", source ? source->limit : 100); + e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->limit_spinbutton), string); + g_free (string); + +#if 0 + dialog->auth = source ? source->auth : ADDRESSBOOK_LDAP_AUTH_NONE; + if (dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE) { + gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->auth_optionmenu), dialog->auth - 1); + gtk_notebook_set_page (GTK_NOTEBOOK(dialog->auth_notebook), dialog->auth - 1); + } + + dialog->ldap_scope = source ? source->scope : ADDRESSBOOK_LDAP_SCOPE_ONELEVEL; + gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->scope_optionmenu), dialog->ldap_scope); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(dialog->auth_checkbutton), source && source->auth != ADDRESSBOOK_LDAP_AUTH_NONE); + gtk_widget_set_sensitive (dialog->auth_optionmenu, source && source->auth != ADDRESSBOOK_LDAP_AUTH_NONE); + gtk_widget_set_sensitive (dialog->auth_notebook, source && source->auth != ADDRESSBOOK_LDAP_AUTH_NONE); +#endif +} + +static void +addressbook_add_server_druid_destroy (GtkWidget *widget, AddressbookSourceDialog *dialog) +{ + /* XXX free other stuff */ + + g_free (dialog); +} + +static void +addressbook_add_server_druid_cancel (GtkWidget *widget, AddressbookSourceDialog *dialog) +{ + gtk_widget_destroy (dialog->window); +} + +static void +addressbook_add_server_druid_finish (GnomeDruidPage *druid_page, GtkWidget *gnome_druid, AddressbookSourceDialog *sdialog) +{ + AddressbookSource *source = addressbook_dialog_get_source (sdialog); + AddressbookDialog *dialog = sdialog->addressbook_dialog; + void *source_data[2]; + + printf ("in finish (%s,%s)\n", source->name, source->host); + + source_data[0] = source->name; + source_data[1] = source->host; + + e_table_memory_store_insert (E_TABLE_MEMORY_STORE (dialog->sourcesModel), + -1, source_data, source); + + evolution_config_control_changed (dialog->config_control); + + /* tear down the widgets */ + gtk_widget_destroy (sdialog->window); +} + +static void +reparent_to_vbox (AddressbookSourceDialog *dialog, char *vbox_name, char *widget_name) +{ + GtkWidget *vbox, *widget; + + vbox = glade_xml_get_widget (dialog->gui, vbox_name); + widget = glade_xml_get_widget (dialog->gui, widget_name); + + gtk_widget_reparent (widget, vbox); + gtk_box_set_child_packing (GTK_BOX (vbox), widget, TRUE, TRUE, 0, GTK_PACK_START); +} + +static void +auth_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + dialog->auth = g_list_index (gtk_container_children (GTK_CONTAINER (item->parent)), + item); + + dialog->general_modify_func (item, dialog); + + if (dialog->auth == 0) { + gtk_widget_set_sensitive (dialog->auth_label_notebook, FALSE); + gtk_widget_set_sensitive (dialog->auth_entry_notebook, FALSE); + } + else { + gtk_widget_set_sensitive (dialog->auth_label_notebook, TRUE); + gtk_widget_set_sensitive (dialog->auth_entry_notebook, TRUE); + gtk_notebook_set_page (GTK_NOTEBOOK(dialog->auth_label_notebook), dialog->auth - 1); + gtk_notebook_set_page (GTK_NOTEBOOK(dialog->auth_entry_notebook), dialog->auth - 1); + } +} + +static void +add_auth_activate_cb (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + gtk_signal_connect (GTK_OBJECT (item), "activate", + GTK_SIGNAL_FUNC (auth_optionmenu_activated), dialog); +} + +static void +setup_general_tab (AddressbookSourceDialog *dialog, GtkSignalFunc modify_func) +{ + GtkWidget *general_tab_help; + GtkWidget *menu; + + general_tab_help = glade_xml_get_widget (dialog->gui, "general-tab-help"); + + dialog->general_modify_func = modify_func; + dialog->host = glade_xml_get_widget (dialog->gui, "server-name-entry"); + gtk_signal_connect (GTK_OBJECT (dialog->host), "changed", + modify_func, dialog); + add_focus_handler (dialog->host, general_tab_help, 0); + + dialog->auth_label_notebook = glade_xml_get_widget (dialog->gui, "auth-label-notebook"); + dialog->auth_entry_notebook = glade_xml_get_widget (dialog->gui, "auth-entry-notebook"); + dialog->email = glade_xml_get_widget (dialog->gui, "email-entry"); + gtk_signal_connect (GTK_OBJECT (dialog->email), "changed", + modify_func, dialog); + add_focus_handler (dialog->email, general_tab_help, 1); + dialog->binddn = glade_xml_get_widget (dialog->gui, "dn-entry"); + gtk_signal_connect (GTK_OBJECT (dialog->binddn), "changed", + modify_func, dialog); + add_focus_handler (dialog->binddn, general_tab_help, 2); + + dialog->auth_optionmenu = glade_xml_get_widget (dialog->gui, "auth-optionmenu"); + menu = gtk_option_menu_get_menu (GTK_OPTION_MENU(dialog->auth_optionmenu)); + gtk_container_foreach (GTK_CONTAINER (menu), (GtkCallback)add_auth_activate_cb, dialog); + add_focus_handler (dialog->auth_optionmenu, general_tab_help, 3); +} + +static gboolean +general_tab_check (AddressbookSourceDialog *dialog) +{ + gboolean valid = TRUE; + char *string; + + string = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->host)); + if (!string || !string[0]) + valid = FALSE; + g_free (string); + + if (valid) { + if (dialog->auth != ADDRESSBOOK_LDAP_AUTH_NONE) { + if (dialog->auth == ADDRESSBOOK_LDAP_AUTH_SIMPLE_BINDDN) + string = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->binddn)); + else + string = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->email)); + + if (!string || !string[0]) + valid = FALSE; + g_free (string); + } + } + + return valid; +} + +static void +druid_info_page_modify_cb (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + gnome_druid_set_buttons_sensitive (GNOME_DRUID(dialog->druid), + TRUE, /* back */ + general_tab_check (dialog), /* next */ + TRUE /* cancel */); +} + +static void +druid_info_page_prepare (GnomeDruidPage *dpage, GtkWidget *gdruid, AddressbookSourceDialog *dialog) +{ + druid_info_page_modify_cb (NULL, dialog); + /* stick the focus in the hostname field */ + gtk_widget_grab_focus (dialog->host); +} + + +/* connecting page */ +static void +ssl_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + dialog->ssl = g_list_index (gtk_container_children (GTK_CONTAINER (item->parent)), + item); + + dialog->connecting_modify_func (item, dialog); +} + +static void +ssl_optionmenu_selected (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + GtkWidget *connecting_tab_help; + int ssl_type = g_list_index (gtk_container_children (GTK_CONTAINER (item->parent)), + item); + + connecting_tab_help = glade_xml_get_widget (dialog->gui, "connecting-tab-help"); + + gtk_notebook_set_page (GTK_NOTEBOOK(connecting_tab_help), ssl_type + 1); +} + +static void +add_ssl_activate_cb (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + gtk_signal_connect (GTK_OBJECT (item), "activate", + GTK_SIGNAL_FUNC (ssl_optionmenu_activated), dialog); + gtk_signal_connect (GTK_OBJECT (item), "select", + GTK_SIGNAL_FUNC (ssl_optionmenu_selected), dialog); +} + +static void +port_changed_func (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + /* if the port value is ldaps, set the SSL/TLS option menu to + Always and desensitize it */ + char *string = e_utf8_gtk_entry_get_text (GTK_ENTRY (item)); + + dialog->connecting_modify_func (item, dialog); + + if (!strcmp (string, LDAPS_PORT_STRING)) { + dialog->ssl = 0; /* XXX SSL_ALWAYS */ + gtk_option_menu_set_history (GTK_OPTION_MENU(dialog->ssl_optionmenu), + dialog->ssl); + + gtk_widget_set_sensitive (dialog->ssl_optionmenu, FALSE); + } + else { + gtk_widget_set_sensitive (dialog->ssl_optionmenu, TRUE); + } + + + g_free (string); +} + +static void +setup_connecting_tab (AddressbookSourceDialog *dialog, GtkSignalFunc modify_func) +{ + GtkWidget *menu; + GtkWidget *connecting_tab_help; + + dialog->connecting_modify_func = modify_func; + + connecting_tab_help = glade_xml_get_widget (dialog->gui, "connecting-tab-help"); + + dialog->port_combo = glade_xml_get_widget (dialog->gui, "port-combo"); + add_focus_handler (dialog->port_combo, connecting_tab_help, 0); + add_focus_handler (GTK_COMBO(dialog->port_combo)->entry, connecting_tab_help, 0); + gtk_signal_connect (GTK_OBJECT (GTK_COMBO(dialog->port_combo)->entry), "changed", + modify_func, dialog); + gtk_signal_connect (GTK_OBJECT (GTK_COMBO(dialog->port_combo)->entry), "changed", + port_changed_func, dialog); + dialog->ssl_optionmenu = glade_xml_get_widget (dialog->gui, "ssl-optionmenu"); + menu = gtk_option_menu_get_menu (GTK_OPTION_MENU(dialog->ssl_optionmenu)); + gtk_container_foreach (GTK_CONTAINER (menu), (GtkCallback)add_ssl_activate_cb, dialog); +} + +static gboolean +connecting_tab_check (AddressbookSourceDialog *dialog) +{ + gboolean valid = TRUE; + char *string; + + string = e_utf8_gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(dialog->port_combo)->entry)); + if (!string || !string[0]) + valid = FALSE; + g_free (string); + + return valid; +} + +static void +druid_connecting_page_modify_cb (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + gnome_druid_set_buttons_sensitive (GNOME_DRUID(dialog->druid), + TRUE, /* back */ + connecting_tab_check (dialog), /* next */ + TRUE /* cancel */); +} + +static void +druid_connecting_page_prepare (GnomeDruidPage *dpage, GtkWidget *gdruid, AddressbookSourceDialog *dialog) +{ + druid_connecting_page_modify_cb (NULL, dialog); + /* stick the focus in the port combo */ + gtk_widget_grab_focus (GTK_COMBO(dialog->port_combo)->entry); +} + + +/* searching page */ +static ETableMemoryStoreColumnInfo bases_table_columns[] = { + E_TABLE_MEMORY_STORE_STRING, + E_TABLE_MEMORY_STORE_TERMINATOR +}; + +#define BASES_TABLE_SPEC \ +" \ + \ + \ + \ + \ + \ +" + +GtkWidget* +supported_bases_create_table (char *name, char *string1, char *string2, int num1, int num2) +{ + GtkWidget *table; + ETableModel *model; + + model = e_table_memory_store_new (bases_table_columns); + + table = e_table_scrolled_new (model, NULL, BASES_TABLE_SPEC, NULL); + + gtk_object_set_data (GTK_OBJECT (table), "model", model); + + return table; +} + +static gboolean +do_ldap_root_dse_query (ETableModel *model, AddressbookSource *source, char ***rvalues) +{ + LDAP* ldap; + char *attrs[2]; + int ldap_error; + char **values; + LDAPMessage *resp; + int i; + + ldap = addressbook_ldap_init (source); + if (!ldap) + return FALSE; + + if (LDAP_SUCCESS != addressbook_ldap_auth (source, ldap)) + goto fail; + + attrs[0] = "namingContexts"; + attrs[1] = NULL; + + ldap_error = addressbook_root_dse_query (source, ldap, attrs, &resp); + + if (ldap_error != LDAP_SUCCESS) + goto fail; + + values = ldap_get_values (ldap, resp, "namingContexts"); + if (!values || values[0] == NULL) { + gnome_ok_dialog (_("The server responded with no supported search bases")); + goto fail; + } + + for (i = 0; values[i]; i++) + e_table_memory_store_insert (E_TABLE_MEMORY_STORE (model), + -1, (void**)&values[i], GINT_TO_POINTER(i)); + + *rvalues = values; + + ldap_unbind_s (ldap); + return TRUE; + + fail: + ldap_unbind_s (ldap); + return FALSE; +} + +static void +search_base_selection_model_changed (ESelectionModel *selection_model, GtkWidget *dialog) +{ + gnome_dialog_set_sensitive (GNOME_DIALOG (dialog), + 0 /* OK */, e_selection_model_selected_count (selection_model) == 1); +} + +static void +query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog) +{ + ESelectionModel *selection_model; + AddressbookSource *source = addressbook_dialog_get_source (sdialog); + GtkWidget *dialog; + GtkWidget *supported_bases_table; + ETableModel *model; + int id; + char **values; + + dialog = glade_xml_get_widget (sdialog->gui, "supported-bases-dialog"); + + supported_bases_table = glade_xml_get_widget (sdialog->gui, "supported-bases-table"); + selection_model = e_table_get_selection_model (e_table_scrolled_get_table (E_TABLE_SCROLLED(supported_bases_table))); + model = gtk_object_get_data (GTK_OBJECT (supported_bases_table), "model"); + + gtk_signal_connect (GTK_OBJECT (selection_model), "selection_changed", + search_base_selection_model_changed, dialog); + + search_base_selection_model_changed (selection_model, dialog); + + if (do_ldap_root_dse_query (model, source, &values)) { + gnome_dialog_close_hides (GNOME_DIALOG(dialog), TRUE); + + id = gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + + if (id == 0) { + int i; + /* OK was clicked */ + + /* ugh. */ + for (i = 0; values[i]; i ++) { + if (e_selection_model_is_row_selected (selection_model, i)) { + e_utf8_gtk_entry_set_text (GTK_ENTRY (sdialog->rootdn), values[i]); + break; /* single selection, so we can quit when we've found it. */ + } + } + } + + ldap_value_free (values); + + e_table_memory_store_clear (E_TABLE_MEMORY_STORE (model)); + } + + addressbook_source_free (source); + + gtk_object_unref (GTK_OBJECT (selection_model)); +} + +static void +scope_optionmenu_activated (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + dialog->scope = g_list_index (gtk_container_children (GTK_CONTAINER (item->parent)), + item); + + dialog->searching_modify_func (item, dialog); +} + +static void +add_scope_activate_cb (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + gtk_signal_connect (GTK_OBJECT (item), "activate", + GTK_SIGNAL_FUNC (scope_optionmenu_activated), dialog); +} + +static void +setup_searching_tab (AddressbookSourceDialog *dialog, GtkSignalFunc modify_func) +{ + GtkWidget *menu; + GtkWidget *rootdn_button; + GtkWidget *searching_tab_help; + + dialog->searching_modify_func = modify_func; + + searching_tab_help = glade_xml_get_widget (dialog->gui, "searching-tab-help"); + + dialog->rootdn = glade_xml_get_widget (dialog->gui, "rootdn-entry"); + add_focus_handler (dialog->rootdn, searching_tab_help, 0); + if (modify_func) + gtk_signal_connect (GTK_OBJECT (dialog->rootdn), "changed", + modify_func, dialog); + + dialog->scope_optionmenu = glade_xml_get_widget (dialog->gui, "scope-optionmenu"); + add_focus_handler (dialog->scope_optionmenu, searching_tab_help, 1); + menu = gtk_option_menu_get_menu (GTK_OPTION_MENU(dialog->scope_optionmenu)); + gtk_container_foreach (GTK_CONTAINER (menu), (GtkCallback)add_scope_activate_cb, dialog); + + dialog->timeout_scale = glade_xml_get_widget (dialog->gui, "timeout-scale"); + add_focus_handler (dialog->timeout_scale, searching_tab_help, 2); + if (modify_func) + gtk_signal_connect (GTK_OBJECT (GTK_RANGE(dialog->timeout_scale)->adjustment), + "value_changed", + modify_func, dialog); + + dialog->limit_spinbutton = glade_xml_get_widget (dialog->gui, "download-limit-spinbutton"); + if (modify_func) + gtk_signal_connect (GTK_OBJECT (dialog->limit_spinbutton), "changed", + modify_func, dialog); + + /* special handling for the "Show Supported Bases button" */ + rootdn_button = glade_xml_get_widget (dialog->gui, "rootdn-button"); + gtk_signal_connect (GTK_OBJECT (rootdn_button), "clicked", + GTK_SIGNAL_FUNC(query_for_supported_bases), dialog); +} + +static void +druid_searching_page_prepare (GnomeDruidPage *dpage, GtkWidget *gdruid, AddressbookSourceDialog *dialog) +{ + gnome_druid_set_buttons_sensitive (GNOME_DRUID(dialog->druid), + TRUE, /* back */ + TRUE, /* next */ + TRUE /* cancel */); +} + + +/* display name page */ +static gboolean +display_name_check (AddressbookSourceDialog *dialog) +{ + gboolean valid = TRUE; + char *string; + + string = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->display_name)); + if (!string || !string[0]) + valid = FALSE; + g_free (string); + + return valid; +} + +static void +display_name_page_prepare (GtkWidget *page, GtkWidget *gnome_druid, AddressbookSourceDialog *dialog) +{ + if (!dialog->display_name_changed) { + char *server_name = e_utf8_gtk_entry_get_text (GTK_ENTRY (dialog->host)); + e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->display_name), server_name); + g_free (server_name); + } + + gnome_druid_set_buttons_sensitive (GNOME_DRUID(dialog->druid), + TRUE, /* back */ + display_name_check (dialog), /* next */ + TRUE /* cancel */); +} + +static void +druid_display_name_page_modify_cb (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + dialog->display_name_changed = TRUE; + display_name_page_prepare (NULL, NULL, dialog); +} + + +#ifdef NEW_ADVANCED_UI +/* objectclasses page */ +static ETableMemoryStoreColumnInfo objectclasses_table_columns[] = { + E_TABLE_MEMORY_STORE_STRING, + E_TABLE_MEMORY_STORE_TERMINATOR +}; + +#define OBJECTCLASSES_TABLE_SPEC \ +" \ + \ + \ + \ + \ + \ +" + +GtkWidget* +objectclasses_create_server_table (char *name, char *string1, char *string2, + int num1, int num2) +{ + GtkWidget *table; + ETableModel *model; + + model = e_table_memory_store_new (objectclasses_table_columns); + + table = e_table_scrolled_new (model, NULL, OBJECTCLASSES_TABLE_SPEC, NULL); + + gtk_object_set_data (GTK_OBJECT (table), "model", model); + + return table; +} + +GtkWidget* +objectclasses_create_evolution_table (char *name, char *string1, char *string2, + int num1, int num2) +{ + GtkWidget *table; + ETableModel *model; + + model = e_table_memory_store_new (objectclasses_table_columns); + + table = e_table_scrolled_new (model, NULL, OBJECTCLASSES_TABLE_SPEC, NULL); + + gtk_object_set_data (GTK_OBJECT (table), "model", model); + + return table; +} + +static void +objectclasses_add_foreach (int model_row, AddressbookSourceDialog *dialog) +{ + LDAPObjectClass *oc = e_table_memory_get_data (E_TABLE_MEMORY (dialog->objectclasses_server_model), model_row); + e_table_memory_store_remove (E_TABLE_MEMORY_STORE (dialog->objectclasses_server_model), model_row); + /* XXX remove from the server array */ + e_table_memory_store_insert (E_TABLE_MEMORY_STORE (dialog->objectclasses_evolution_model), + -1, (void**)&oc->oc_names[0], oc); + /* XXX add to the evolution array */ +} + +static void +objectclasses_add (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + ESelectionModel *esm = e_table_get_selection_model (e_table_scrolled_get_table (E_TABLE_SCROLLED(dialog->objectclasses_server_table))); + + e_selection_model_foreach (esm, (EForeachFunc)objectclasses_add_foreach, dialog); + dialog->objectclasses_modify_func (item, dialog); +} + +static void +objectclasses_server_double_click (ETable *et, int row, int col, GdkEvent *event, AddressbookSourceDialog *dialog) +{ + objectclasses_add_foreach (row, dialog); + dialog->objectclasses_modify_func (GTK_WIDGET (et), dialog); +} + +static void +objectclasses_remove_foreach (int model_row, AddressbookSourceDialog *dialog) +{ + LDAPObjectClass *oc = e_table_memory_get_data (E_TABLE_MEMORY (dialog->objectclasses_evolution_model), model_row); + e_table_memory_store_remove (E_TABLE_MEMORY_STORE (dialog->objectclasses_evolution_model), model_row); + /* XXX remove from the evolution array */ + e_table_memory_store_insert (E_TABLE_MEMORY_STORE (dialog->objectclasses_server_model), + -1, (void**)&oc->oc_names[0], oc); + /* XXX add to the server array */ +} + +static void +objectclasses_remove (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + ESelectionModel *esm = e_table_get_selection_model (e_table_scrolled_get_table (E_TABLE_SCROLLED(dialog->objectclasses_evolution_table))); + + e_selection_model_foreach (esm, (EForeachFunc)objectclasses_add_foreach, dialog); + + dialog->objectclasses_modify_func (item, dialog); +} + +static void +objectclasses_evolution_double_click (ETable *et, int row, int col, GdkEvent *event, AddressbookSourceDialog *dialog) +{ + objectclasses_remove_foreach (row, dialog); + dialog->objectclasses_modify_func (GTK_WIDGET (et), dialog); +} + +static void +objectclasses_restore_default (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + int i; + + dialog->objectclasses_modify_func (item, dialog); + + /* clear out our evolution list */ + for (i = 0; i < dialog->evolution_objectclasses->len; i ++) { + g_ptr_array_add (dialog->server_objectclasses, g_ptr_array_index (dialog->evolution_objectclasses, i)); + } + g_ptr_array_set_size (dialog->evolution_objectclasses, 0); + + e_table_memory_store_clear (E_TABLE_MEMORY_STORE (dialog->objectclasses_evolution_model)); + + for (i = 0; i < dialog->default_objectclasses->len; i++) { + LDAPObjectClass *oc = g_ptr_array_index (dialog->default_objectclasses, i); + g_ptr_array_add (dialog->evolution_objectclasses, oc); + e_table_memory_store_insert (E_TABLE_MEMORY_STORE (dialog->objectclasses_evolution_model), + i, (void**)&oc->oc_names[0], oc); + } +} + +static void +server_selection_model_changed (ESelectionModel *selection_model, AddressbookSourceDialog *dialog) +{ + gtk_widget_set_sensitive (dialog->objectclasses_add_button, + e_selection_model_selected_count (selection_model) > 0); +} + +static void +evolution_selection_model_changed (ESelectionModel *selection_model, AddressbookSourceDialog *dialog) +{ + gtk_widget_set_sensitive (dialog->objectclasses_remove_button, + e_selection_model_selected_count (selection_model) > 0); +} + +static void +setup_objectclasses_tab (AddressbookSourceDialog *dialog, GtkSignalFunc modify_func) +{ + ETable *table; + GtkWidget *restore_default; + ESelectionModel *esm; + + dialog->server_objectclasses = g_ptr_array_new (); + dialog->evolution_objectclasses = g_ptr_array_new (); + dialog->default_objectclasses = g_ptr_array_new (); + + dialog->objectclasses_modify_func = modify_func; + + dialog->objectclasses_server_table = glade_xml_get_widget (dialog->gui, "objectclasses-server-table"); + dialog->objectclasses_server_model = gtk_object_get_data (GTK_OBJECT (dialog->objectclasses_server_table), "model"); + + dialog->objectclasses_evolution_table = glade_xml_get_widget (dialog->gui, "objectclasses-evolution-table"); + dialog->objectclasses_evolution_model = gtk_object_get_data (GTK_OBJECT (dialog->objectclasses_evolution_table), "model"); + + table = e_table_scrolled_get_table (E_TABLE_SCROLLED(dialog->objectclasses_server_table)); + gtk_signal_connect (GTK_OBJECT (table), "double_click", + GTK_SIGNAL_FUNC (objectclasses_server_double_click), dialog); + esm = e_table_get_selection_model (table); + gtk_signal_connect (GTK_OBJECT (esm), "selection_changed", + server_selection_model_changed, dialog); + + table = e_table_scrolled_get_table (E_TABLE_SCROLLED(dialog->objectclasses_evolution_table)); + gtk_signal_connect (GTK_OBJECT (table), "double_click", + GTK_SIGNAL_FUNC (objectclasses_evolution_double_click), dialog); + esm = e_table_get_selection_model (table); + gtk_signal_connect (GTK_OBJECT (esm), "selection_changed", + evolution_selection_model_changed, dialog); + + dialog->objectclasses_add_button = glade_xml_get_widget (dialog->gui, "objectclasses-add-button"); + gtk_signal_connect (GTK_OBJECT (dialog->objectclasses_add_button), "clicked", + GTK_SIGNAL_FUNC(objectclasses_add), dialog); + + dialog->objectclasses_remove_button = glade_xml_get_widget (dialog->gui, "objectclasses-remove-button"); + gtk_signal_connect (GTK_OBJECT (dialog->objectclasses_remove_button), "clicked", + GTK_SIGNAL_FUNC(objectclasses_remove), dialog); + + restore_default = glade_xml_get_widget (dialog->gui, "objectclasses-default-button"); + gtk_signal_connect (GTK_OBJECT (restore_default), "clicked", + GTK_SIGNAL_FUNC(objectclasses_restore_default), dialog); +} +#endif + + +static AddressbookSourceDialog * +addressbook_add_server_druid (AddressbookDialog *dialog) +{ + AddressbookSourceDialog *sdialog = g_new0 (AddressbookSourceDialog, 1); + GtkWidget *page; + + sdialog->addressbook_dialog = dialog; + + sdialog->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL); + + sdialog->window = glade_xml_get_widget (sdialog->gui, "account-druid-window"); + sdialog->druid = glade_xml_get_widget (sdialog->gui, "account-druid"); + + /* info page */ + page = glade_xml_get_widget (sdialog->gui, "add-server-druid-info-page"); + reparent_to_vbox (sdialog, "account-druid-general-vbox", "general-tab"); + setup_general_tab (sdialog, GTK_SIGNAL_FUNC (druid_info_page_modify_cb)); + gtk_signal_connect (GTK_OBJECT(page), "prepare", + GTK_SIGNAL_FUNC(druid_info_page_prepare), sdialog); + + /* connecting page */ + page = glade_xml_get_widget (sdialog->gui, "add-server-druid-connecting-page"); + reparent_to_vbox (sdialog, "account-druid-connecting-vbox", "connecting-tab"); + setup_connecting_tab (sdialog, druid_connecting_page_modify_cb); + gtk_signal_connect (GTK_OBJECT(page), "prepare", + GTK_SIGNAL_FUNC(druid_connecting_page_prepare), sdialog); + + /* searching page */ + page = glade_xml_get_widget (sdialog->gui, "add-server-druid-searching-page"); + reparent_to_vbox (sdialog, "account-druid-searching-vbox", "searching-tab"); + setup_searching_tab (sdialog, NULL); + gtk_signal_connect (GTK_OBJECT(page), "prepare", + GTK_SIGNAL_FUNC(druid_searching_page_prepare), sdialog); + + /* display name page */ + page = glade_xml_get_widget (sdialog->gui, "add-server-druid-display-name-page"); + sdialog->display_name = glade_xml_get_widget (sdialog->gui, "druid-display-name-entry"); + gtk_signal_connect (GTK_OBJECT (sdialog->display_name), "changed", + druid_display_name_page_modify_cb, sdialog); + gtk_signal_connect (GTK_OBJECT(page), "prepare", + GTK_SIGNAL_FUNC(display_name_page_prepare), sdialog); + + page = glade_xml_get_widget (sdialog->gui, "add-server-druid-finish-page"); + gtk_signal_connect (GTK_OBJECT(page), "finish", + GTK_SIGNAL_FUNC(addressbook_add_server_druid_finish), sdialog); + gtk_signal_connect (GTK_OBJECT(sdialog->druid), "cancel", + GTK_SIGNAL_FUNC(addressbook_add_server_druid_cancel), sdialog); + gtk_signal_connect (GTK_OBJECT(sdialog->window), "destroy", + GTK_SIGNAL_FUNC(addressbook_add_server_druid_destroy), sdialog); + + gtk_window_set_modal (GTK_WINDOW (sdialog->window), TRUE); + + gtk_widget_show (sdialog->window); + + return sdialog; +} + +static void +editor_modify_cb (GtkWidget *item, AddressbookSourceDialog *dialog) +{ + gboolean valid = TRUE; + + valid = display_name_check (dialog); + if (valid) + valid = general_tab_check (dialog); +#if 0 + if (valid) + valid = connecting_tab_check (dialog); + if (valid) + valid = searching_tab_check (dialog); +#endif + + gtk_widget_set_sensitive (dialog->ok_button, valid); + gtk_widget_set_sensitive (dialog->apply_button, valid); +} + +static void +set_advanced_button_state (AddressbookSourceDialog *dialog) +{ + if (dialog->advanced) { + gtk_notebook_set_page (GTK_NOTEBOOK(dialog->advanced_button_notebook), 0); +#ifdef NEW_ADVANCED_UI + gtk_notebook_append_page (GTK_NOTEBOOK(dialog->notebook), dialog->objectclasses_tab, dialog->objectclasses_label); + gtk_notebook_append_page (GTK_NOTEBOOK(dialog->notebook), dialog->mappings_tab, dialog->mappings_label); + gtk_notebook_append_page (GTK_NOTEBOOK(dialog->notebook), dialog->dn_customization_tab, dialog->dn_customization_label); +#endif + } + else { + gtk_notebook_set_page (GTK_NOTEBOOK(dialog->advanced_button_notebook), 1); + + /* hide the advanced tabs of the main notebook */ + gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 5); + gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 4); + gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 3); + } +} + +#ifdef NEW_ADVANCED_UI +static void +advanced_button_clicked (GtkWidget *button, AddressbookSourceDialog *dialog) +{ + dialog->advanced = !dialog->advanced; + set_advanced_button_state (dialog); +} + +static gboolean +do_schema_query (AddressbookSourceDialog *sdialog) +{ + LDAP *ldap; + int ldap_error; + char *schema_dn; + char *attrs[3]; + char **values; + int i; + AddressbookSource *source = addressbook_dialog_get_source (sdialog); + LDAPMessage *resp; + + ldap = addressbook_ldap_init (source); + if (!ldap) + goto fail; + + if (LDAP_SUCCESS != addressbook_ldap_auth (source, ldap)) + goto fail; + + attrs[0] = "subschemaSubentry"; + attrs[1] = NULL; + + ldap_error = addressbook_root_dse_query (source, ldap, attrs, &resp); + + if (ldap_error != LDAP_SUCCESS) + goto fail; + + values = ldap_get_values (ldap, resp, "subschemaSubentry"); + if (!values || values[0] == NULL) { + gnome_ok_dialog (_("The server did not respond with a schema entry")); + goto fail; + } + + schema_dn = g_strdup (values[0]); + + ldap_value_free (values); + ldap_msgfree (resp); + + attrs[0] = "objectClasses"; + attrs[1] = NULL; + + ldap_error = ldap_search_ext_s (ldap, schema_dn, LDAP_SCOPE_BASE, + "(objectClass=subschema)", attrs, 0, + NULL, NULL, NULL, 0, &resp); + if (LDAP_SUCCESS != ldap_error) { + gnome_error_dialog (_("Could not query for schema information")); + goto fail; + } + + values = ldap_get_values (ldap, resp, "objectClasses"); + if (!values) { + gnome_error_dialog (_("Server did not respond with valid schema information")); + goto fail; + } + + for (i = 0; values[i]; i ++) { + int j; + int code; + const char *err; + LDAPObjectClass *oc = ldap_str2objectclass (values[i], &code, &err, 0); + + if (!oc) + continue; + + /* we fill in the default list of classes here */ + for (j = 0; oc->oc_names[j]; j ++) { + if (!g_strcasecmp (oc->oc_names[j], EVOLUTIONPERSON) || + !g_strcasecmp (oc->oc_names[j], INETORGPERSON) || + !g_strcasecmp (oc->oc_names[j], ORGANIZATIONALPERSON) || + !g_strcasecmp (oc->oc_names[j], PERSON) || + !g_strcasecmp (oc->oc_names[j], CALENTRY) || + !g_strcasecmp (oc->oc_names[j], TOP)) + g_ptr_array_add (sdialog->default_objectclasses, oc); + } + + g_ptr_array_add (sdialog->server_objectclasses, oc); + } + + addressbook_source_free (source); + ldap_unbind_s (ldap); + return TRUE; + + fail: + addressbook_source_free (source); + if (ldap) + ldap_unbind_s (ldap); + return FALSE; +} + +static void +edit_dialog_switch_page (GtkNotebook *notebook, + GtkNotebookPage *page, guint page_num, + AddressbookSourceDialog *sdialog) +{ + if (page_num >= 3 && !sdialog->schema_query_successful) { + int i; + + gtk_widget_set_sensitive (GTK_WIDGET (notebook), FALSE); + + sdialog->schema_query_successful = do_schema_query (sdialog); + + if (sdialog->schema_query_successful) { + /* fill in the objectclasses model */ + for (i = 0; i < sdialog->server_objectclasses->len; i ++) { + LDAPObjectClass *oc = g_ptr_array_index (sdialog->server_objectclasses, i); + e_table_memory_store_insert (E_TABLE_MEMORY_STORE (sdialog->objectclasses_server_model), + -1, (void**)&oc->oc_names[0], oc); + } + gtk_widget_set_sensitive (page->child, TRUE); + } + else { + gtk_widget_set_sensitive (page->child, FALSE); + } + + gtk_widget_set_sensitive (GTK_WIDGET (notebook), TRUE); + } +} +#endif + +static gboolean +edit_dialog_store_change (AddressbookSourceDialog *sdialog) +{ + AddressbookSource *source = addressbook_dialog_get_source (sdialog); + AddressbookDialog *dialog = sdialog->addressbook_dialog; + AddressbookSource *old_source; + void *source_data[2]; + + /* check the display name for uniqueness */ + if (FALSE /* XXX */) { + return FALSE; + } + + /* store the new source in the addressbook dialog */ + old_source = e_table_memory_get_data (E_TABLE_MEMORY (dialog->sourcesModel), sdialog->source_model_row); + addressbook_source_free (old_source); + e_table_memory_store_remove (E_TABLE_MEMORY_STORE (dialog->sourcesModel), + sdialog->source_model_row); + + source_data[0] = source->name; + source_data[1] = source->host; + + e_table_memory_store_insert (E_TABLE_MEMORY_STORE (dialog->sourcesModel), + sdialog->source_model_row, source_data, source); + + /* and let the config control know about the change */ + evolution_config_control_changed (dialog->config_control); + + return TRUE; +} + +static void +edit_dialog_apply_clicked (GtkWidget *item, AddressbookSourceDialog *sdialog) +{ + if (!edit_dialog_store_change (sdialog)) + return; + + /* resensitize the buttons */ + gtk_widget_set_sensitive (sdialog->ok_button, FALSE); + gtk_widget_set_sensitive (sdialog->apply_button, FALSE); +} + +static void +edit_dialog_close_clicked (GtkWidget *item, AddressbookSourceDialog *sdialog) +{ + gtk_widget_destroy (sdialog->window); +} + +static void +edit_dialog_ok_clicked (GtkWidget *item, AddressbookSourceDialog *sdialog) +{ + if (edit_dialog_store_change (sdialog)) + edit_dialog_close_clicked (item, sdialog); +} + +static AddressbookSourceDialog* +addressbook_edit_server_dialog (AddressbookDialog *dialog, AddressbookSource *source, int model_row) +{ + AddressbookSourceDialog *sdialog = g_new0 (AddressbookSourceDialog, 1); + GtkWidget *general_tab_help; + GtkWidget *fewer_options_button, *more_options_button; + + sdialog->addressbook_dialog = dialog; + sdialog->source_model_row = model_row; + + sdialog->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL); + + sdialog->window = glade_xml_get_widget (sdialog->gui, "account-editor-window"); + + /* general tab */ + general_tab_help = glade_xml_get_widget (dialog->gui, "general-tab-help"); + reparent_to_vbox (sdialog, "account-editor-general-vbox", "general-tab"); + setup_general_tab (sdialog, GTK_SIGNAL_FUNC (editor_modify_cb)); + sdialog->display_name = glade_xml_get_widget (sdialog->gui, "account-editor-display-name-entry"); + gtk_signal_connect (GTK_OBJECT (sdialog->display_name), "changed", + editor_modify_cb, sdialog); + add_focus_handler (sdialog->display_name, general_tab_help, 4); + + /* connecting tab */ + reparent_to_vbox (sdialog, "account-editor-connecting-vbox", "connecting-tab"); + setup_connecting_tab (sdialog, GTK_SIGNAL_FUNC (editor_modify_cb)); + + /* searching tab */ + reparent_to_vbox (sdialog, "account-editor-searching-vbox", "searching-tab"); + setup_searching_tab (sdialog, GTK_SIGNAL_FUNC (editor_modify_cb)); + +#ifdef NEW_ADVANCED_UI + /* objectclasses tab */ + reparent_to_vbox (sdialog, "account-editor-objectclasses-vbox", "objectclasses-tab"); + setup_objectclasses_tab (sdialog, GTK_SIGNAL_FUNC (editor_modify_cb)); + + /* mappings tab */ + reparent_to_vbox (sdialog, "account-editor-mappings-vbox", "mappings-tab"); + /* XXX setup_mappings_tab */ + + /* dn customization tab */ + reparent_to_vbox (sdialog, "account-editor-dn-customization-vbox", "dn-customization-tab"); + /* XXX setup_dn_customization_tab */ +#endif + + sdialog->ok_button = glade_xml_get_widget (sdialog->gui, "account-editor-ok-button"); + /* XXX signal */ + sdialog->apply_button = glade_xml_get_widget (sdialog->gui, "account-editor-apply-button"); + /* XXX signal */ + sdialog->close_button = glade_xml_get_widget (sdialog->gui, "account-editor-close-button"); + /* XXX signal */ + + sdialog->advanced_button_notebook = glade_xml_get_widget (sdialog->gui, "account-editor-advanced-button-notebook"); + fewer_options_button = glade_xml_get_widget (sdialog->gui, "account-editor-fewer-options-button"); + more_options_button = glade_xml_get_widget (sdialog->gui, "account-editor-more-options-button"); + + sdialog->notebook = glade_xml_get_widget (sdialog->gui, "account-editor-notebook"); +#ifdef NEW_ADVANCED_UI + sdialog->objectclasses_label = glade_xml_get_widget (sdialog->gui, "account-editor-objectclasses-label"); + gtk_object_ref (GTK_OBJECT (sdialog->objectclasses_label)); + sdialog->objectclasses_tab = glade_xml_get_widget (sdialog->gui, "account-editor-objectclasses-vbox"); + gtk_object_ref (GTK_OBJECT (sdialog->objectclasses_tab)); + sdialog->mappings_label = glade_xml_get_widget (sdialog->gui, "account-editor-mappings-label"); + gtk_object_ref (GTK_OBJECT (sdialog->mappings_label)); + sdialog->mappings_tab = glade_xml_get_widget (sdialog->gui, "account-editor-mappings-vbox"); + gtk_object_ref (GTK_OBJECT (sdialog->mappings_tab)); + sdialog->dn_customization_label = glade_xml_get_widget (sdialog->gui, "account-editor-dn-customization-label"); + gtk_object_ref (GTK_OBJECT (sdialog->dn_customization_label)); + sdialog->dn_customization_tab = glade_xml_get_widget (sdialog->gui, "account-editor-dn-customization-vbox"); + gtk_object_ref (GTK_OBJECT (sdialog->dn_customization_tab)); +#endif + + addressbook_source_dialog_set_source (sdialog, source); + + set_advanced_button_state (sdialog); + +#ifdef NEW_ADVANCED_UI + gtk_signal_connect (GTK_OBJECT (fewer_options_button), + "clicked", advanced_button_clicked, sdialog); + gtk_signal_connect (GTK_OBJECT (more_options_button), + "clicked", advanced_button_clicked, sdialog); + +#else + gtk_widget_hide (sdialog->advanced_button_notebook); +#endif + +#ifdef NEW_ADVANCED_UI + /* set up a signal handler to query for schema info if the user switches to the advanced tabs */ + gtk_signal_connect (GTK_OBJECT (sdialog->notebook), "switch_page", + GTK_SIGNAL_FUNC (edit_dialog_switch_page), sdialog); +#endif + + gtk_signal_connect (GTK_OBJECT (sdialog->ok_button), + "clicked", GTK_SIGNAL_FUNC(edit_dialog_ok_clicked), sdialog); + gtk_signal_connect (GTK_OBJECT (sdialog->apply_button), + "clicked", GTK_SIGNAL_FUNC(edit_dialog_apply_clicked), sdialog); + gtk_signal_connect (GTK_OBJECT (sdialog->close_button), + "clicked", GTK_SIGNAL_FUNC(edit_dialog_close_clicked), sdialog); + + gtk_widget_set_sensitive (sdialog->ok_button, FALSE); + gtk_widget_set_sensitive (sdialog->apply_button, FALSE); + + gtk_window_set_modal (GTK_WINDOW (sdialog->window), TRUE); + + gtk_widget_show (sdialog->window); + + return sdialog; +} + +static void +add_source_clicked (GtkWidget *widget, AddressbookDialog *dialog) +{ + addressbook_add_server_druid (dialog); +} + +static void +edit_source_clicked (GtkWidget *widget, AddressbookDialog *dialog) +{ + int i; + ESelectionModel *selection_model; + int row_count; + + selection_model = e_table_get_selection_model (e_table_scrolled_get_table (E_TABLE_SCROLLED(dialog->sourcesTable))); + row_count = e_selection_model_row_count (selection_model); + + for (i = 0; i < row_count; i ++) { + if (e_selection_model_is_row_selected (selection_model, i)) { + AddressbookSource *source = e_table_memory_get_data (E_TABLE_MEMORY(dialog->sourcesModel), i); + AddressbookSourceDialog *sdialog; + sdialog = addressbook_edit_server_dialog (dialog, source, i); + break; /* single select so we're done now */ + } + } + +#if 0 + AddressbookSource *source; + AddressbookSourceDialog *sdialog; + + source = gtk_clist_get_row_data (GTK_CLIST (dialog->clistSources), dialog->source_row); + + sdialog = addressbook_config_source_with_gui (dialog->gui, source, dialog->page); + if (sdialog->id == 0) { + /* Ok was clicked */ + source = addressbook_source_copy(sdialog->source); + + e_utf8_gtk_clist_set_text (GTK_CLIST (dialog->clistSources), dialog->source_row, 0, source->name); + e_utf8_gtk_clist_set_text (GTK_CLIST (dialog->clistSources), dialog->source_row, 1, source->host); + gtk_clist_set_row_data (GTK_CLIST (dialog->clistSources), dialog->source_row, source); + + evolution_config_control_changed (dialog->config_control); + + update_sensitivity (dialog); + } +#endif +} + +static void +delete_source_clicked (GtkWidget *widget, AddressbookDialog *dialog) +{ + int i; + ESelectionModel *selection_model; + int row_count; + + selection_model = e_table_get_selection_model (e_table_scrolled_get_table (E_TABLE_SCROLLED(dialog->sourcesTable))); + row_count = e_selection_model_row_count (selection_model); + + for (i = 0; i < row_count; i ++) { + if (e_selection_model_is_row_selected (selection_model, i)) { + AddressbookSource *source = e_table_memory_get_data (E_TABLE_MEMORY(dialog->sourcesModel), i); + e_table_memory_store_remove (E_TABLE_MEMORY_STORE (dialog->sourcesModel), i); + addressbook_source_free (source); + + break; /* single select so we're done now */ + } + } + + evolution_config_control_changed (dialog->config_control); +} + +static void +config_control_destroy_callback (EvolutionConfigControl *config_control, + void *data) +{ + AddressbookDialog *dialog; + + dialog = (AddressbookDialog *) data; + + gtk_object_unref (GTK_OBJECT (dialog->gui)); + g_free (dialog); +} + +static void +config_control_apply_callback (EvolutionConfigControl *config_control, + void *data) +{ + AddressbookDialog *dialog; + int i; + int count; + + dialog = (AddressbookDialog *) data; + + addressbook_storage_clear_sources(); + + count = e_table_model_row_count (E_TABLE_MODEL (dialog->sourcesModel)); + + for (i = 0; i < count; i ++) { + AddressbookSource *source = e_table_memory_get_data (E_TABLE_MEMORY (dialog->sourcesModel), i); + addressbook_storage_add_source (addressbook_source_copy (source)); + } + + addressbook_storage_write_sources(); +} + +static void +sources_selection_changed (ESelectionModel *esm, AddressbookDialog *dialog) +{ + gboolean sensitive = e_selection_model_selected_count (esm) == 1; + + gtk_widget_set_sensitive (dialog->editSource, sensitive); + gtk_widget_set_sensitive (dialog->deleteSource, sensitive); +} + +static AddressbookDialog * +ldap_dialog_new (GNOME_Evolution_Shell shell) +{ + AddressbookDialog *dialog; + GList *l; + ESelectionModel *esm; + + dialog = g_new0 (AddressbookDialog, 1); + + dialog->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL); + dialog->shell = shell; + + dialog->sourcesTable = glade_xml_get_widget (dialog->gui, "sourcesTable"); + dialog->sourcesModel = gtk_object_get_data (GTK_OBJECT (dialog->sourcesTable), "model"); + + dialog->addSource = glade_xml_get_widget (dialog->gui, "addSource"); + gtk_signal_connect (GTK_OBJECT(dialog->addSource), "clicked", + GTK_SIGNAL_FUNC (add_source_clicked), + dialog); + + dialog->editSource = glade_xml_get_widget (dialog->gui, "editSource"); + gtk_signal_connect (GTK_OBJECT(dialog->editSource), "clicked", + GTK_SIGNAL_FUNC (edit_source_clicked), + dialog); + + dialog->deleteSource = glade_xml_get_widget (dialog->gui, "deleteSource"); + gtk_signal_connect (GTK_OBJECT(dialog->deleteSource), "clicked", + GTK_SIGNAL_FUNC (delete_source_clicked), + dialog); + + l = addressbook_storage_get_sources (); + for (; l != NULL; l = l->next) { + AddressbookSource *source; + void *source_data[2]; + + source = addressbook_source_copy ((AddressbookSource*)l->data); + + source_data[0] = source->name; + source_data[1] = source->host; + + e_table_memory_store_insert (E_TABLE_MEMORY_STORE (dialog->sourcesModel), + -1, source_data, source); + } + + esm = e_table_get_selection_model (e_table_scrolled_get_table (E_TABLE_SCROLLED(dialog->sourcesTable))); + gtk_signal_connect (GTK_OBJECT (esm), "selection_changed", + GTK_SIGNAL_FUNC (sources_selection_changed), dialog); + + sources_selection_changed (esm, dialog); + + dialog->page = glade_xml_get_widget (dialog->gui, "addressbook-sources"); + + return dialog; +} + +static ETableMemoryStoreColumnInfo sources_table_columns[] = { + E_TABLE_MEMORY_STORE_STRING, + E_TABLE_MEMORY_STORE_STRING, + E_TABLE_MEMORY_STORE_TERMINATOR +}; + +#define SOURCES_TABLE_SPEC \ +" \ + \ + \ + \ + \ + \ + \ + \ +" + +GtkWidget* +addressbook_dialog_create_sources_table (char *name, char *string1, char *string2, int num1, int num2) +{ + GtkWidget *table; + ETableModel *model; + + + model = e_table_memory_store_new (sources_table_columns); + + table = e_table_scrolled_new (model, NULL, SOURCES_TABLE_SPEC, NULL); + + gtk_object_set_data (GTK_OBJECT (table), "model", model); + + return table; +} + +static EvolutionConfigControl * +config_control_new (GNOME_Evolution_Shell shell) +{ + AddressbookDialog *dialog; + + dialog = ldap_dialog_new (shell); + + gtk_widget_ref (dialog->page); + + gtk_container_remove (GTK_CONTAINER (dialog->page->parent), dialog->page); + + dialog->config_control = evolution_config_control_new (dialog->page); + gtk_signal_connect (GTK_OBJECT (dialog->config_control), "apply", + GTK_SIGNAL_FUNC (config_control_apply_callback), dialog); + gtk_signal_connect (GTK_OBJECT (dialog->config_control), "destroy", + GTK_SIGNAL_FUNC (config_control_destroy_callback), dialog); + + gtk_widget_unref (dialog->page); + + return dialog->config_control; +} + + +/* Implementation of the factory for the configuration control. */ + +static BonoboGenericFactory *factory = NULL; + +static BonoboObject * +config_control_factory_fn (BonoboGenericFactory *factory, + void *data) +{ + GNOME_Evolution_Shell shell; + EvolutionConfigControl *control; + + shell = (GNOME_Evolution_Shell) data; + + control = config_control_new (shell); + return BONOBO_OBJECT (control); +} + +gboolean +ldap_config_register_factory (GNOME_Evolution_Shell shell) +{ + g_return_val_if_fail (shell != CORBA_OBJECT_NIL, FALSE); + + factory = bonobo_generic_factory_new (CONFIG_CONTROL_FACTORY_ID, + config_control_factory_fn, + shell); + + if (factory != NULL) { + return TRUE; + } else { + g_warning ("Cannot register factory %s", CONFIG_CONTROL_FACTORY_ID); + return FALSE; + } +} + +void +ldap_config_create_new_source (const char *new_source, GtkWidget *parent) +{ +#if 0 + AddressbookSourceDialog *dialog; + GladeXML *gui; + + gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL); + + dialog = addressbook_source_dialog (gui, NULL, parent); + + e_utf8_gtk_entry_set_text (GTK_ENTRY (dialog->name), new_source); + + gnome_dialog_close_hides (GNOME_DIALOG(dialog->dialog), TRUE); + + dialog->id = gnome_dialog_run_and_close (GNOME_DIALOG (dialog->dialog)); + + gtk_object_unref (GTK_OBJECT (dialog->gui)); + + if (dialog->id == 0) { + /* Ok was clicked */ + addressbook_storage_add_source (addressbook_source_copy(dialog->source)); + addressbook_storage_write_sources(); + } +#endif +} + +#ifdef STANDALONE +int +main(int argc, char **argv) +{ + AddressbookDialog *dialog; + + gnome_init_with_popt_table ("evolution-addressbook", "0.0", + argc, argv, oaf_popt_options, 0, NULL); + + glade_gnome_init (); + + bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR); + textdomain (PACKAGE); + +#if 0 + g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); +#endif + + gtk_widget_push_visual (gdk_rgb_get_visual ()); + gtk_widget_push_colormap (gdk_rgb_get_cmap ()); + + dialog = ldap_dialog_new (NULL); + + gtk_widget_show (glade_xml_get_widget (dialog->gui, "addressbook-sources-window")); + + gtk_main(); + + return 0; +} +#endif diff --git a/addressbook/gui/component/ldap-config.glade b/addressbook/gui/component/ldap-config.glade new file mode 100644 index 0000000000..fd9ebfad8c --- /dev/null +++ b/addressbook/gui/component/ldap-config.glade @@ -0,0 +1,5819 @@ + + + + + addressbook-config-mockup + addressbook-config-mockup + + src + ../../../art + C + True + True + + + + GnomeDialog + Add/Edit Attribute Mappings--Simple Version + False + Add (or Edit) Attribute Mappings + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + True + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox4 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area4 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button37 + True + True + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button39 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + + + GtkVBox + vbox30 + False + 0 + + 0 + True + True + + + + GtkHBox + hbox66 + 3 + False + 3 + + 0 + True + True + + + + GnomePixmap + pixmap35 + ldap.png + + 0 + False + False + + + + + GtkLabel + label283 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkHSeparator + hseparator8 + + 0 + True + True + + + + + GtkTable + table18 + 3 + 2 + 2 + False + 3 + 3 + + 0 + True + True + + + + GtkLabel + label284 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + combo-entry2 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label285 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + combo-entry3 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkCombo + combo4 + False + True + False + True + False + + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + GtkEntry + GtkCombo:entry + combo-entry2 + True + True + True + 0 + + + + + + GtkCombo + combo5 + False + True + False + True + False + + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + GtkEntry + GtkCombo:entry + combo-entry3 + True + True + True + 0 + + + + + + + + + + GnomeDialog + Add/Edit Attribute Mappings-- Multiple Selection Version + False + Add (or Edit) Attribute Mappings + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 393 + 324 + False + True + False + False + False + + + GtkVBox + GnomeDialog:vbox + vbox31 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + hbuttonbox9 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button40 + True + True + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button41 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + + + GtkVBox + vbox32 + False + 0 + + 0 + True + True + + + + GtkHBox + hbox67 + 3 + False + 3 + + 0 + False + False + + + + GnomePixmap + pixmap36 + ldap.png + + 0 + False + False + + + + + GtkLabel + label286 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkHSeparator + hseparator9 + + 0 + False + False + + + + + GtkTable + table19 + 3 + 2 + 2 + False + 3 + 3 + + 0 + True + True + + + + GtkLabel + label287 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + entry32 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkCombo + combo6 + False + True + False + True + False + + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + GtkEntry + GtkCombo:entry + entry32 + True + True + True + 0 + + + + + + GtkLabel + label288 + + GTK_JUSTIFY_CENTER + False + 0 + 7.45058e-09 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + True + False + False + True + True + + + + + GtkScrolledWindow + scrolledwindow6 + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + + GtkCList + clist4 + True + 2 + 163,80 + GTK_SELECTION_SINGLE + True + GTK_SHADOW_IN + + + GtkLabel + CList:title + label289 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label290 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + GtkWindow + account-editor-window + False + account-editor + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GtkVBox + vbox37 + False + 0 + + + GtkNotebook + account-editor-notebook + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + + 0 + True + True + + + + GtkVBox + account-editor-general-vbox + 6 + False + 3 + + + GtkHBox + hbox100 + 3 + False + 4 + + 0 + False + False + + + + GtkLabel + label431 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkAlignment + alignment45 + 1 + 0.5 + 0.9 + 1 + + 0 + True + True + + + + GtkEntry + account-editor-display-name-entry + True + True + True + 0 + + + + + + + GtkHSeparator + hseparator12 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label331 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + account-editor-connecting-vbox + False + 0 + + + Placeholder + + + + + GtkLabel + Notebook:tab + label334 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + account-editor-searching-vbox + False + 0 + + + Placeholder + + + + + GtkLabel + Notebook:tab + label344 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + account-editor-objectclasses-vbox + False + 0 + + + Placeholder + + + + + GtkLabel + Notebook:tab + account-editor-objectclasses-label + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + account-editor-mappings-vbox + False + 0 + + + Placeholder + + + + + GtkLabel + Notebook:tab + account-editor-mappings-label + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + account-editor-dn-customization-vbox + False + 0 + + + Placeholder + + + + + GtkLabel + Notebook:tab + account-editor-dn-customization-label + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + GtkHSeparator + hseparator10 + + 0 + True + True + + + + + GtkHBox + hbox120 + False + 0 + + 0 + False + False + + + + GtkNotebook + account-editor-advanced-button-notebook + False + False + GTK_POS_TOP + False + 2 + 2 + False + + 0 + True + True + + + + GtkHButtonBox + hbuttonbox21 + GTK_BUTTONBOX_START + 0 + 85 + 27 + 7 + 0 + + + GtkButton + account-editor-fewer-options-button + True + True + + GTK_RELIEF_NORMAL + + + + + GtkLabel + Notebook:tab + label554 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHButtonBox + hbuttonbox28 + GTK_BUTTONBOX_START + 0 + 85 + 27 + 7 + 0 + + + GtkButton + account-editor-more-options-button + True + True + + GTK_RELIEF_NORMAL + + + + + GtkLabel + Notebook:tab + label555 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + GtkHButtonBox + hbuttonbox20 + GTK_BUTTONBOX_END + 0 + 85 + 27 + 7 + 0 + + 0 + True + True + + + + GtkButton + account-editor-ok-button + False + True + True + GNOME_STOCK_BUTTON_OK + GTK_RELIEF_NORMAL + + + + GtkButton + account-editor-apply-button + False + True + True + GNOME_STOCK_BUTTON_APPLY + GTK_RELIEF_NORMAL + + + + GtkButton + account-editor-close-button + True + True + GNOME_STOCK_BUTTON_CLOSE + GTK_RELIEF_NORMAL + + + + + + + + GtkWindow + account-druid-window + False + account-druid + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GnomeDruid + account-druid + + + GnomeDruidPageStart + druidpagestart1 + LDAP Configuration Assistant + This assistant will help you to access online directory services +using LDAP (Lightweight Directory Access Protocol) servers. + +Adding a new LDAP server requires some specialized information +about the server. Please contact your system administrator if you +need help finding this information. + 255,255,255 + 0,0,0 + 0,0,0 + 0,0,0 + 255,255,255 + ldap.png + xstdruidbg-3.png + + + + GnomeDruidPageStandard + add-server-druid-info-page + Step 1: Server Information + 255,255,255 + 0,0,0 + 0,0,0 + + + GtkVBox + GnomeDruidPageStandard:vbox + druid-vbox1 + 3 + False + 3 + + 0 + True + True + + + + GtkVBox + account-druid-general-vbox + 3 + False + 3 + + 0 + True + True + + + + GtkLabel + label158 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 3 + 0 + + 0 + False + False + + + + + GtkHSeparator + hseparator2 + + 0 + False + False + + + + + + + + GnomeDruidPageStandard + add-server-druid-connecting-page + Step 2: Connecting to Server + 255,255,255 + 0,0,0 + 0,0,0 + + + GtkVBox + GnomeDruidPageStandard:vbox + druid-vbox2 + 3 + False + 3 + + 0 + True + True + + + + GtkVBox + account-druid-connecting-vbox + 3 + False + 3 + + 0 + True + True + + + + GtkLabel + label174 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 3 + 0 + + 0 + False + False + + + + + GtkHSeparator + hseparator3 + + 0 + False + False + + + + + + + + GnomeDruidPageStandard + add-server-druid-searching-page + Step 3: Searching the Directory + 255,255,255 + 0,0,0 + 0,0,0 + + + GtkVBox + GnomeDruidPageStandard:vbox + vbox23 + 3 + False + 3 + + 0 + True + True + + + + GtkVBox + account-druid-searching-vbox + 3 + False + 3 + + 0 + True + True + + + + GtkLabel + label254 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkHSeparator + hseparator7 + + 0 + False + False + + + + + + + + GnomeDruidPageStandard + add-server-druid-display-name-page + Step 4: Display Name + 255,255,255 + 0,0,0 + 0,0,0 + + + GtkVBox + GnomeDruidPageStandard:vbox + druid-vbox5 + 3 + False + 3 + + 0 + True + True + + + + GtkVBox + vbox21 + 3 + False + 3 + + 0 + True + True + + + + GtkLabel + label198 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 3 + 0 + + 0 + False + False + + + + + GtkHSeparator + hseparator5 + + 0 + False + False + + + + + GtkTable + table15 + 3 + 1 + 2 + False + 3 + 3 + + 0 + False + False + + + + GtkEntry + druid-display-name-entry + True + True + True + True + 0 + + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + GtkLabel + label199 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + druid-display-name-entry + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + + GtkNotebook + notebook15 + False + False + GTK_POS_TOP + False + 2 + 2 + False + + 0 + False + False + GTK_PACK_END + + + + GtkHBox + hbox41 + 3 + False + 2 + + + GnomePixmap + pixmap21 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label207 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label208 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox42 + 3 + False + 3 + + + GnomePixmap + pixmap22 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label215 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label210 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + + GnomeDruidPageFinish + add-server-druid-finish-page + Finished + Congratulations, you are finished setting up this LDAP server. You +are now ready to access this directory. + +Please click the "Finish" button to save the settings you have entered here. + 0,0,0 + 0,0,0 + 255,255,255 + 0,0,0 + 255,255,255 + xstdruidbg-3.png + + + + + + GtkWindow + edit_server_window_simple + False + edit_server_window_simple + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GtkVBox + vbox67 + False + 0 + + + GtkNotebook + notebook25 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + + 0 + True + True + + + + GtkVBox + vbox68 + 6 + False + 3 + + + GtkHBox + hbox121 + 3 + False + 4 + + 0 + False + False + + + + GtkLabel + label484 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkAlignment + alignment52 + 1 + 0.5 + 0.9 + 1 + + 0 + True + True + + + + GtkEntry + entry54 + True + True + True + 0 + + + + + + + GtkHSeparator + hseparator13 + + 0 + False + False + + + + + GtkTable + table32 + 3 + 3 + 2 + False + 3 + 3 + + 0 + False + False + + + + GtkLabel + label485 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + entry55 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label486 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label487 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + entry56 + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + + + + GtkEntry + entry55 + True + True + True + True + 0 + + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + GtkAlignment + alignment53 + 7.45058e-09 + 0.5 + 0 + 1 + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + GtkOptionMenu + optionmenu18 + True + Anonymously +Using email address +Using distinguished name (DN) + + 2 + + + + + GtkEntry + entry56 + True + True + True + 0 + + + 1 + 2 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + + + + + + GtkNotebook + notebook26 + False + False + GTK_POS_TOP + False + 2 + 2 + False + + 0 + False + False + GTK_PACK_END + + + + GtkHBox + hbox122 + 3 + False + 2 + + + GnomePixmap + pixmap66 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label488 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label489 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox123 + 3 + False + 2 + + + GnomePixmap + pixmap67 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label490 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label491 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox124 + 3 + False + 2 + + + GnomePixmap + pixmap68 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label492 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label493 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + Placeholder + + + + GtkLabel + Notebook:tab + label494 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox125 + 3 + False + 2 + + + GnomePixmap + pixmap69 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label495 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label496 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GtkLabel + Notebook:tab + label497 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + vbox69 + 6 + False + 3 + + + GtkTable + table33 + 3 + 2 + 2 + False + 3 + 3 + + 0 + False + False + + + + GtkLabel + label498 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkAlignment + alignment54 + 7.45058e-09 + 0.5 + 0 + 1 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + GtkVBox + vbox70 + False + 0 + + + GtkRadioButton + radiobutton9 + True + + False + True + + 0 + False + False + + + + + GtkRadioButton + radiobutton10 + True + + False + True + + 0 + False + False + + + + + GtkRadioButton + radiobutton11 + True + + False + True + + 0 + False + False + + + + + + + GtkAlignment + alignment55 + 7.45058e-09 + 0.5 + 0 + 1 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + GtkPixmap + pixmap70 + gnome-hint.png + 0.5 + 0.5 + 0 + 0 + True + + + + + GtkAlignment + alignment56 + 7.45058e-09 + 0.5 + 0 + 1 + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + GtkCombo + combo8 + False + True + False + True + False + 380 +666 +1234 + + + + GtkEntry + GtkCombo:entry + entry57 + True + True + True + True + 0 + 380 + + + + + + GtkLabel + label499 + + GTK_JUSTIFY_CENTER + False + 0 + 7.45058e-09 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + True + False + False + True + True + + + + + + GtkNotebook + notebook27 + False + False + GTK_POS_TOP + False + 2 + 2 + False + + 0 + False + False + GTK_PACK_END + + + + GtkHBox + hbox126 + 3 + False + 3 + + + GnomePixmap + pixmap71 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label500 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label501 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox127 + 3 + False + 2 + + + GnomePixmap + pixmap72 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label502 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label503 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox128 + 3 + False + 2 + + + GnomePixmap + pixmap73 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label504 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label505 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox129 + 3 + False + 2 + + + GnomePixmap + pixmap74 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label506 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label507 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GtkLabel + Notebook:tab + label508 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + vbox71 + 6 + False + 3 + + + GtkTable + table34 + 3 + 4 + 2 + False + 3 + 3 + + 0 + True + True + + + + GtkLabel + label509 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label510 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkAlignment + alignment57 + 7.45058e-09 + 7.45058e-09 + 0 + 1 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + GtkOptionMenu + optionmenu19 + True + Sub +One + + 0 + + + + + GtkHBox + hbox130 + 3 + False + 3 + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + True + + + + GtkEntry + entry58 + True + True + True + True + 0 + + + 0 + True + True + + + + + GtkButton + button90 + True + + GTK_RELIEF_NORMAL + + 0 + False + False + + + + + + GtkLabel + label511 + + GTK_JUSTIFY_LEFT + False + 0 + 1 + 0 + 0 + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + + + + GtkAlignment + alignment58 + 7.45058e-09 + 0.5 + 1 + 1 + + 1 + 2 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + + + + GtkHBox + hbox131 + 3 + False + 3 + + + GtkLabel + label512 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkHScale + hscale5 + True + False + GTK_POS_LEFT + 0 + GTK_UPDATE_DELAYED + 3 + 1 + 5 + 0.5 + 1 + 0 + + 0 + True + True + + + + + GtkLabel + label513 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 3 + 0 + + 0 + False + False + + + + + GtkLabel + label514 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + label515 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + + GtkLabel + label516 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 3 + 4 + 0 + 0 + False + False + False + False + True + False + + + + + GtkAlignment + alignment59 + 0 + 0.5 + 0 + 1 + + 1 + 2 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + + + + GtkHBox + hbox132 + 3 + False + 3 + + + GtkSpinButton + spinbutton5 + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 100 + 0 + 10000 + 1 + 10 + 10 + + 0 + True + True + + + + + GtkLabel + label517 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + + + GtkNotebook + notebook28 + False + False + GTK_POS_TOP + False + 2 + 2 + False + + 0 + False + False + GTK_PACK_END + + + + GtkHBox + hbox133 + 3 + False + 3 + + + GnomePixmap + pixmap75 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label518 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label519 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox134 + 3 + False + 2 + + + GnomePixmap + pixmap76 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label520 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label521 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox135 + 3 + False + 2 + + + GnomePixmap + pixmap77 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label522 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label523 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox136 + 3 + False + 2 + + + GnomePixmap + pixmap78 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label524 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label525 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GtkLabel + Notebook:tab + label526 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + GtkHSeparator + hseparator14 + + 0 + True + True + + + + + GtkHBox + hbox142 + False + 0 + + 0 + False + False + + + + GtkHButtonBox + hbuttonbox25 + GTK_BUTTONBOX_START + 0 + 85 + 27 + 7 + 0 + + 0 + True + True + + + + GtkButton + button100 + True + True + + GTK_RELIEF_NORMAL + + + + + GtkHButtonBox + hbuttonbox26 + GTK_BUTTONBOX_END + 0 + 85 + 27 + 7 + 0 + + 0 + True + True + + + + GtkButton + button101 + True + True + GNOME_STOCK_BUTTON_OK + GTK_RELIEF_NORMAL + + + + GtkButton + button102 + True + True + GNOME_STOCK_BUTTON_APPLY + GTK_RELIEF_NORMAL + + + + GtkButton + button103 + True + True + GNOME_STOCK_BUTTON_CLOSE + GTK_RELIEF_NORMAL + + + + + + + + GnomeDialog + addressbook-sources-window + False + Addressbook Sources + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 355 + 285 + True + True + False + False + False + + + GtkVBox + GnomeDialog:vbox + addressbook-sources-vbox + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + hbuttonbox27 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button104 + True + True + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button105 + True + True + GNOME_STOCK_BUTTON_APPLY + + + + GtkButton + button106 + True + True + GNOME_STOCK_BUTTON_CLOSE + + + + + GtkHBox + addressbook-sources + False + 0 + + 0 + True + True + + + + Custom + sourcesTable + addressbook_dialog_create_sources_table + 0 + 0 + Thu, 11 Apr 2002 00:31:02 GMT + + 0 + True + True + + + + + GtkVBox + vbox73 + False + 0 + + 0 + False + False + + + + GtkLabel + label529 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkVButtonBox + vbuttonbox18 + GTK_BUTTONBOX_START + 0 + 85 + 27 + 7 + 0 + + 0 + True + True + + + + GtkButton + addSource + True + True + + GTK_RELIEF_NORMAL + + + + GtkButton + editSource + True + True + + GTK_RELIEF_NORMAL + + + + GtkButton + deleteSource + True + True + + GTK_RELIEF_NORMAL + + + + + + + + + GtkWindow + general-tab-window + False + general-tab + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GtkVBox + general-tab + 6 + False + 3 + + + GtkTable + table36 + 3 + 3 + 2 + False + 3 + 3 + + 0 + False + False + + + + GtkLabel + label534 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + server-name-entry + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label535 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkEntry + server-name-entry + True + True + True + True + 0 + + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + GtkAlignment + alignment63 + 7.45058e-09 + 0.5 + 0 + 1 + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + GtkOptionMenu + auth-optionmenu + True + Anonymously +Using email address +Using distinguished name (DN) + + 0 + + + + + GtkNotebook + auth-label-notebook + False + False + False + GTK_POS_TOP + False + 2 + 2 + False + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + + + + GtkLabel + label553 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + Notebook:tab + label546 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + label536 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + + + GtkLabel + Notebook:tab + label547 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + GtkNotebook + auth-entry-notebook + False + False + False + GTK_POS_TOP + False + 2 + 2 + False + + 1 + 2 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + + + + GtkEntry + email-entry + True + True + True + 0 + + + + + GtkLabel + Notebook:tab + label549 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkEntry + dn-entry + True + True + True + 0 + + + + + GtkLabel + Notebook:tab + label550 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GtkNotebook + general-tab-help + False + False + GTK_POS_TOP + False + 2 + 2 + False + + 0 + False + False + GTK_PACK_END + + + + GtkHBox + hbox145 + 3 + False + 2 + + + GnomePixmap + pixmap79 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label537 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label538 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox146 + 3 + False + 2 + + + GnomePixmap + pixmap80 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label539 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label540 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox147 + 3 + False + 2 + + + GnomePixmap + pixmap81 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label541 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label542 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + label552 + + GTK_JUSTIFY_CENTER + True + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + Notebook:tab + label551 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox148 + 3 + False + 2 + + + GnomePixmap + pixmap82 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label544 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label545 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + GtkWindow + connecting-tab-window + False + connecting-tab + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GtkVBox + connecting-tab + False + 0 + + + GtkTable + table14 + 3 + 2 + 2 + False + 3 + 3 + + 0 + False + True + + + + GtkLabel + label175 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkAlignment + alignment23 + 7.45058e-09 + 0.5 + 0 + 1 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + GtkPixmap + pixmap11 + gnome-hint.png + 0.5 + 0.5 + 0 + 0 + True + + + + + GtkAlignment + alignment21 + 7.45058e-09 + 0.5 + 0 + 1 + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + GtkCombo + port-combo + False + True + False + True + False + 389 +636 +3268 + + + + GtkEntry + GtkCombo:entry + entry27 + True + True + True + True + 0 + 389 + + + + + + GtkLabel + label176 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + True + False + False + True + True + + + + + GtkAlignment + alignment60 + 7.45058e-09 + 0.5 + 0 + 1 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + + GtkOptionMenu + ssl-optionmenu + True + Always +Whenever Possible +Never + + 1 + + + + + + GtkNotebook + connecting-tab-help + False + False + GTK_POS_TOP + False + 2 + 2 + False + + 0 + True + True + + + + GtkHBox + hbox30 + 3 + False + 3 + + + GnomePixmap + pixmap7 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label178 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label179 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox31 + 3 + False + 2 + + + GnomePixmap + pixmap8 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label395 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label398 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox91 + 3 + False + 2 + + + GnomePixmap + pixmap43 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label399 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label396 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox92 + 3 + False + 2 + + + GnomePixmap + pixmap44 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label400 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label397 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + GtkWindow + searching-tab-window + False + searching-tab + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GtkVBox + searching-tab + 6 + False + 3 + + + GtkTable + table30 + 3 + 4 + 2 + False + 3 + 3 + + 0 + True + True + + + + GtkLabel + label455 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label456 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkAlignment + alignment49 + 7.45058e-09 + 7.45058e-09 + 0 + 1 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + GtkOptionMenu + scope-optionmenu + True + Sub +One + + 0 + + + + + GtkHBox + hbox109 + 3 + False + 3 + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + True + + + + GtkEntry + rootdn-entry + True + True + True + True + 0 + + + 0 + True + True + + + + + GtkButton + rootdn-button + True + + GTK_RELIEF_NORMAL + + 0 + False + False + + + + + + GtkLabel + label457 + + GTK_JUSTIFY_LEFT + False + 0 + 1 + 0 + 0 + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + + + + GtkAlignment + alignment50 + 7.45058e-09 + 0.5 + 1 + 1 + + 1 + 2 + 2 + 3 + 0 + 0 + True + False + False + False + True + False + + + + GtkHBox + hbox110 + 3 + False + 3 + + + GtkLabel + label458 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkHScale + timeout-scale + True + False + GTK_POS_LEFT + 0 + GTK_UPDATE_DELAYED + 3 + 1 + 5 + 0.5 + 1 + 0 + + 0 + True + True + + + + + GtkLabel + label459 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 3 + 0 + + 0 + False + False + + + + + GtkLabel + label460 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + label461 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + + GtkLabel + label462 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 3 + 4 + 0 + 0 + False + False + False + False + True + False + + + + + GtkAlignment + alignment51 + 0 + 0.5 + 0 + 1 + + 1 + 2 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + + + + GtkHBox + hbox111 + 3 + False + 3 + + + GtkSpinButton + download-limit-spinbutton + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 100 + 0 + 10000 + 1 + 10 + 10 + + 0 + True + True + + + + + GtkLabel + label463 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + + + GtkNotebook + searching-tab-help + False + False + GTK_POS_TOP + False + 2 + 2 + False + + 0 + False + False + GTK_PACK_END + + + + GtkHBox + hbox112 + 3 + False + 3 + + + GnomePixmap + pixmap60 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label464 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label465 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox113 + 3 + False + 2 + + + GnomePixmap + pixmap61 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label466 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label467 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox114 + 3 + False + 2 + + + GnomePixmap + pixmap62 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label468 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label469 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox115 + 3 + False + 2 + + + GnomePixmap + pixmap63 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label470 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label471 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + GtkWindow + objectclasses-tab-window + False + objectclasses-tab + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GtkVBox + objectclasses-tab + 3 + False + 3 + + + GtkHBox + hbox93 + 3 + False + 3 + + 0 + True + True + + + + GtkVBox + vbox51 + 3 + False + 3 + + 0 + True + True + + + + GtkLabel + label405 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + Custom + objectclasses-server-table + objectclasses_create_server_table + 0 + 0 + Tue, 16 Apr 2002 17:09:21 GMT + + 0 + True + True + + + + + + GtkVBox + vbox52 + 3 + False + 3 + + 0 + False + True + + + + GtkLabel + label407 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkVButtonBox + vbuttonbox15 + GTK_BUTTONBOX_START + 1 + 47 + 27 + 7 + 0 + + 0 + True + True + + + + GtkButton + objectclasses-add-button + True + True + + GTK_RELIEF_NORMAL + + + + GtkButton + objectclasses-remove-button + True + True + + GTK_RELIEF_NORMAL + + + + + + GtkVBox + vbox53 + 3 + False + 3 + + 0 + True + True + + + + GtkLabel + label408 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + Custom + objectclasses-evolution-table + objectclasses_create_evolution_table + 0 + 0 + Tue, 16 Apr 2002 17:09:43 GMT + + 0 + True + True + + + + + + + GtkHButtonBox + hbuttonbox16 + 6 + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + 87 + 27 + 7 + 0 + + 0 + False + False + GTK_PACK_END + + + + GtkButton + objectclasses-default-button + True + True + + GTK_RELIEF_NORMAL + + + + + + + GtkWindow + mappings-tab-window + False + mappings-tab + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GtkVBox + mappings-tab + 3 + False + 3 + + + GtkHBox + hbox94 + 3 + False + 3 + + 0 + True + True + + + + GtkVBox + vbox55 + 3 + False + 3 + + 0 + True + True + + + + GtkScrolledWindow + scrolledwindow21 + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkCList + clist18 + True + 2 + 146,80 + GTK_SELECTION_SINGLE + True + GTK_SHADOW_IN + + + GtkLabel + CList:title + label411 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label412 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + GtkVBox + vbox56 + 3 + False + 3 + + 0 + False + False + + + + GtkLabel + label413 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkVButtonBox + vbuttonbox16 + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + 85 + 27 + 7 + 0 + + 0 + False + False + + + + GtkButton + button71 + True + True + + GTK_RELIEF_NORMAL + + + + GtkButton + button72 + True + True + + GTK_RELIEF_NORMAL + + + + GtkButton + button73 + True + True + + GTK_RELIEF_NORMAL + + + + + + + GtkHButtonBox + hbuttonbox17 + GTK_BUTTONBOX_DEFAULT_STYLE + 30 + 85 + 27 + 7 + 0 + + 0 + False + False + GTK_PACK_END + + + + GtkButton + button74 + True + True + + GTK_RELIEF_NORMAL + + + + + + + GtkWindow + dn-customization-tab-window + False + dn-customization-tab + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GtkVBox + dn-customization-tab + 3 + False + 3 + + + GtkNotebook + notebook24 + False + False + GTK_POS_TOP + False + 2 + 2 + False + + 0 + False + False + GTK_PACK_END + + + + GtkHBox + hbox116 + 3 + False + 2 + + + GnomePixmap + pixmap64 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label473 + + GTK_JUSTIFY_LEFT + False + 7.45058e-09 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label474 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox117 + 3 + False + 3 + + + GnomePixmap + pixmap65 + gnome-hint.png + + 0 + False + False + + + + + GtkLabel + label475 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label476 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + GtkTable + table31 + 3 + 2 + 2 + False + 3 + 3 + + 0 + True + True + + + + GtkVBox + vbox64 + False + 0 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + False + True + + + + GtkLabel + label477 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkVButtonBox + vbuttonbox17 + GTK_BUTTONBOX_START + 10 + 85 + 27 + 7 + 0 + + 0 + False + False + + + + GtkButton + button78 + True + True + + GTK_RELIEF_NORMAL + + + + + + GtkScrolledWindow + scrolledwindow22 + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + 1 + 1 + 2 + 0 + 0 + True + True + False + False + True + True + + + + GtkCList + clist19 + True + 2 + 152,80 + GTK_SELECTION_SINGLE + True + GTK_SHADOW_IN + + + GtkLabel + CList:title + label478 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label479 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GtkHBox + hbox118 + 3 + False + 3 + + 0 + 1 + 0 + 1 + 0 + 0 + True + False + False + False + True + True + + + + GtkLabel + label480 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + entry53 + + 0 + False + False + + + + + GtkEntry + entry53 + True + True + True + 0 + + + 0 + True + True + + + + + + GtkHButtonBox + hbuttonbox18 + GTK_BUTTONBOX_DEFAULT_STYLE + 0 + 85 + 27 + 7 + 0 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + False + True + + + + GtkButton + button79 + True + True + + GTK_RELIEF_NORMAL + + + + + + + + GnomeDialog + supported-bases-dialog + False + Supported Search Bases + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 300 + 200 + True + True + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox5 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area5 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button107 + True + True + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button109 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + + + Custom + supported-bases-table + supported_bases_create_table + 0 + 0 + Fri, 12 Apr 2002 20:06:45 GMT + + 0 + True + True + + + + + + diff --git a/addressbook/gui/component/ldap-config.h b/addressbook/gui/component/ldap-config.h new file mode 100644 index 0000000000..45f538a55d --- /dev/null +++ b/addressbook/gui/component/ldap-config.h @@ -0,0 +1,33 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* addressbook-storage.h + * + * Copyright (C) 2000 Ximian, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Chris Toshok + */ + +#ifndef __LDAP_CONFIG_H__ +#define __LDAP_CONFIG_H__ + +#include "addressbook-storage.h" + +void ldap_config_create_new_source (const char *new_source, + GtkWidget *parent); + +gboolean ldap_config_register_factory (GNOME_Evolution_Shell shell); + +#endif /* __LDAP_CONFIG_H__ */ -- cgit v1.2.3