diff options
author | Christopher James Lahey <clahey@ximian.com> | 2002-05-04 04:49:06 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2002-05-04 04:49:06 +0800 |
commit | 95ba1fd855c0cea8ae18f9963e800f7189adf459 (patch) | |
tree | f0f8d58b9da84e3a14cb06e08a870df75c8af954 /addressbook | |
parent | 905a5cfca0e35d26f6b883b534928d42180594f3 (diff) | |
download | gsoc2013-evolution-95ba1fd855c0cea8ae18f9963e800f7189adf459.tar.gz gsoc2013-evolution-95ba1fd855c0cea8ae18f9963e800f7189adf459.tar.zst gsoc2013-evolution-95ba1fd855c0cea8ae18f9963e800f7189adf459.zip |
Updated this to have the ConfigControlFactory have an addressbookwide
2002-05-03 Christopher James Lahey <clahey@ximian.com>
* gui/component/GNOME_Evolution_Addressbook.oaf.in: Updated this
to have the ConfigControlFactory have an addressbookwide generic
name and added OAFIID:GNOME_Evolution_Addressbook_ConfigControl.
* gui/component/Makefile.am (evolution_addressbook_SOURCES),
gui/component/addressbook-component.c,
gui/component/addressbook-storage.c, gui/component/addressbook.c:
Replaced ldap-config.c and ldap-config.h with addressbook-config.c
andaddressbook-config.h.
* gui/component/addressbook-config.c,
gui/component/addressbook-config.h: Based on ldap-config.c and
ldap-config.h. Added a folder list control. Made this a multi
factory.
* gui/component/ldap-config.c, gui/component/ldap-config.h:
Replaced these with addressbook-config.c and addressbook-config.h.
svn path=/trunk/; revision=16679
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 20 | ||||
-rw-r--r-- | addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in | 35 | ||||
-rw-r--r-- | addressbook/gui/component/Makefile.am | 6 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-component.c | 4 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-config.c (renamed from addressbook/gui/component/ldap-config.c) | 116 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-config.h (renamed from addressbook/gui/component/ldap-config.h) | 18 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-storage.c | 2 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook.c | 2 |
8 files changed, 167 insertions, 36 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 446dc10662..cd491cb429 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,23 @@ +2002-05-03 Christopher James Lahey <clahey@ximian.com> + + * gui/component/GNOME_Evolution_Addressbook.oaf.in: Updated this + to have the ConfigControlFactory have an addressbookwide generic + name and added OAFIID:GNOME_Evolution_Addressbook_ConfigControl. + + * gui/component/Makefile.am (evolution_addressbook_SOURCES), + gui/component/addressbook-component.c, + gui/component/addressbook-storage.c, gui/component/addressbook.c: + Replaced ldap-config.c and ldap-config.h with addressbook-config.c + andaddressbook-config.h. + + * gui/component/addressbook-config.c, + gui/component/addressbook-config.h: Based on ldap-config.c and + ldap-config.h. Added a folder list control. Made this a multi + factory. + + * gui/component/ldap-config.c, gui/component/ldap-config.h: + Replaced these with addressbook-config.c and addressbook-config.h. + 2002-05-02 Christopher James Lahey <clahey@ximian.com> * gui/component/select-names/e-select-names.c (selection_change): diff --git a/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in b/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in index 20f6c0c472..c475ef47f5 100644 --- a/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in +++ b/addressbook/gui/component/GNOME_Evolution_Addressbook.oaf.in @@ -131,22 +131,22 @@ </oaf_server> -<oaf_server iid="OAFIID:GNOME_Evolution_LDAPStorage_ConfigControlFactory" +<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_ConfigControlFactory" type="exe" location="evolution-addressbook"> <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/ObjectFactory:1.0"/> + <item value="IDL:GNOME/GenericFactory:1.0"/> </oaf_attribute> <oaf_attribute name="description" type="string" - _value="Factory for the configuration control for the Evolution Addressbook."/> + _value="Factory for the configuration controls for the Evolution Addressbook."/> </oaf_server> <oaf_server iid="OAFIID:GNOME_Evolution_LDAPStorage_ConfigControl" type="factory" - location="OAFIID:GNOME_Evolution_LDAPStorage_ConfigControlFactory"> + location="OAFIID:GNOME_Evolution_Addressbook_ConfigControlFactory"> <oaf_attribute name="repo_ids" type="stringv"> <item value="IDL:GNOME/Evolution/ConfigControl:1.0"/> @@ -160,10 +160,35 @@ <oaf_attribute name="evolution:config_item:icon_name" type="string" value="evolution-contacts.png"/> - + <oaf_attribute name="evolution:config_item:priority" type="string" value="-6"/> <oaf_attribute name="description" type="string" + _value="Configuration control for the Evolution Addressbook Storages."/> + +</oaf_server> + + <!-- Account Editor --> +<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_ConfigControl" + type="factory" + location="OAFIID:GNOME_Evolution_Addressbook_ConfigControlFactory"> + + <oaf_attribute name="repo_ids" type="stringv"> + <item value="IDL:GNOME/Evolution/ConfigControl:1.0"/> + </oaf_attribute> + + <oaf_attribute name="evolution:config_item:title" type="string" + _value="Addressbook Settings"/> + + <oaf_attribute name="evolution:config_item:description" type="string" + _value="This page can be used to configure Addressbook Settings"/> + + <oaf_attribute name="evolution:config_item:icon_name" type="string" + value="evolution-contacts.png"/> + + <oaf_attribute name="evolution:config_item:priority" type="string" value="-7"/> + + <oaf_attribute name="description" type="string" _value="Configuration control for the Evolution Addressbook."/> </oaf_server> diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am index 18fa1b9d07..bfae4c1198 100644 --- a/addressbook/gui/component/Makefile.am +++ b/addressbook/gui/component/Makefile.am @@ -28,6 +28,8 @@ bin_PROGRAMS = \ evolution_addressbook_SOURCES = \ addressbook-component.c \ addressbook-component.h \ + addressbook-config.c \ + addressbook-config.h \ addressbook-factory.c \ addressbook-storage.c \ addressbook-storage.h \ @@ -38,9 +40,7 @@ evolution_addressbook_SOURCES = \ e-address-widget.h \ e-address-widget.c \ e-address-popup.h \ - e-address-popup.c \ - ldap-config.c \ - ldap-config.h + e-address-popup.c evolution_addressbook_LDADD = \ select-names/libeselectnames.la \ diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index f126368c85..590cdd26bf 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -44,7 +44,7 @@ #include "ebook/e-card.h" #include "ebook/e-book-util.h" -#include "ldap-config.h" +#include "addressbook-config.h" #include "addressbook-storage.h" #include "addressbook-component.h" #include "addressbook.h" @@ -369,7 +369,7 @@ owner_set_cb (EvolutionShellComponent *shell_component, if (global_shell_client == NULL) global_shell_client = shell_client; - ldap_config_register_factory (bonobo_object_corba_objref (BONOBO_OBJECT (shell_client))); + addressbook_config_register_factory (bonobo_object_corba_objref (BONOBO_OBJECT (shell_client))); addressbook_storage_setup (shell_component, evolution_homedir); } diff --git a/addressbook/gui/component/ldap-config.c b/addressbook/gui/component/addressbook-config.c index 097b0c8f3c..ea5a4cf9df 100644 --- a/addressbook/gui/component/ldap-config.c +++ b/addressbook/gui/component/addressbook-config.c @@ -1,15 +1,22 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Authors: + * Chris Toshok <toshok@ximian.com> + * Chris Lahey <clahey@ximian.com> + **/ /*#define STANDALONE*/ /*#define NEW_ADVANCED_UI*/ #include <config.h> -#include "ldap-config.h" +#include "addressbook-config.h" +#include "addressbook.h" #include "addressbook-storage.h" #include "evolution-config-control.h" +#include <shell/e-folder-list.h> #include <gal/widgets/e-unicode.h> #include <gal/e-table/e-table-memory-store.h> @@ -28,6 +35,7 @@ #include <glade/glade.h> #include <stdlib.h> +#include <sys/time.h> #ifdef HAVE_LDAP #include "ldap.h" @@ -38,8 +46,9 @@ #define LDAPS_PORT_STRING "636" #define GLADE_FILE_NAME "ldap-config.glade" - -#define CONFIG_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_LDAPStorage_ConfigControlFactory" +#define CONFIG_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_ConfigControlFactory" +#define LDAP_CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_LDAPStorage_ConfigControl" +#define ADDRESSBOOK_CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_ConfigControl" #ifdef HAVE_LDAP GtkWidget* addressbook_dialog_create_sources_table (char *name, char *string1, char *string2, @@ -1455,8 +1464,8 @@ delete_source_clicked (GtkWidget *widget, AddressbookDialog *dialog) } static void -config_control_destroy_callback (EvolutionConfigControl *config_control, - void *data) +ldap_config_control_destroy_callback (EvolutionConfigControl *config_control, + void *data) { AddressbookDialog *dialog; @@ -1470,8 +1479,8 @@ config_control_destroy_callback (EvolutionConfigControl *config_control, } static void -config_control_apply_callback (EvolutionConfigControl *config_control, - void *data) +ldap_config_control_apply_callback (EvolutionConfigControl *config_control, + void *data) { AddressbookDialog *dialog; int i; @@ -1585,7 +1594,7 @@ addressbook_dialog_create_sources_table (char *name, char *string1, char *string #endif /* HAVE_LDAP */ static EvolutionConfigControl * -config_control_new (GNOME_Evolution_Shell shell) +ldap_config_control_new (GNOME_Evolution_Shell shell) { GtkWidget *control_widget; EvolutionConfigControl *control; @@ -1611,9 +1620,9 @@ config_control_new (GNOME_Evolution_Shell shell) #ifdef HAVE_LDAP dialog->config_control = control; gtk_signal_connect (GTK_OBJECT (dialog->config_control), "apply", - GTK_SIGNAL_FUNC (config_control_apply_callback), dialog); + GTK_SIGNAL_FUNC (ldap_config_control_apply_callback), dialog); gtk_signal_connect (GTK_OBJECT (dialog->config_control), "destroy", - GTK_SIGNAL_FUNC (config_control_destroy_callback), dialog); + GTK_SIGNAL_FUNC (ldap_config_control_destroy_callback), dialog); gtk_widget_unref (dialog->page); #endif @@ -1621,6 +1630,72 @@ config_control_new (GNOME_Evolution_Shell shell) return control; } +static void +addressbook_config_control_destroy_callback (EvolutionConfigControl *config_control, + void *data) +{ +} + +static void +addressbook_config_control_apply_callback (EvolutionConfigControl *config_control, + EFolderList *list) +{ + Bonobo_ConfigDatabase config_db; + char *xml; + CORBA_Environment ev; + + CORBA_exception_init (&ev); + + config_db = addressbook_config_database(&ev); + + xml = e_folder_list_get_xml (list); + bonobo_config_set_string (config_db, "/Addressbook/Completion/uris", xml, &ev); + g_free (xml); + + CORBA_exception_free (&ev); +} + +static EvolutionConfigControl * +addressbook_config_control_new (GNOME_Evolution_Shell shell) +{ + GtkWidget *control_widget; + EvolutionConfigControl *control; + EvolutionShellClient *shell_client; + Bonobo_ConfigDatabase config_db; + char *xml; + CORBA_Environment ev; + static const char *possible_types[] = { "contacts", NULL }; + + CORBA_exception_init (&ev); + + config_db = addressbook_config_database(&ev); + + xml = bonobo_config_get_string (config_db, "/Addressbook/Completion/uris", &ev); + shell_client = evolution_shell_client_new (shell); + control_widget = e_folder_list_new (shell_client, + xml); + bonobo_object_client_unref (BONOBO_OBJECT_CLIENT (shell_client), NULL); + g_free (xml); + + gtk_object_set (GTK_OBJECT (control_widget), + "title", _("Extra Completion folders"), + "possible_types", possible_types, + NULL); + + gtk_widget_show (control_widget); + + control = evolution_config_control_new (control_widget); + + gtk_signal_connect (GTK_OBJECT (control), "apply", + GTK_SIGNAL_FUNC (addressbook_config_control_apply_callback), control_widget); + gtk_signal_connect (GTK_OBJECT (control), "destroy", + GTK_SIGNAL_FUNC (addressbook_config_control_destroy_callback), control_widget); + + CORBA_exception_free (&ev); + + return control; +} + /* Implementation of the factory for the configuration control. */ @@ -1628,6 +1703,7 @@ static BonoboGenericFactory *factory = NULL; static BonoboObject * config_control_factory_fn (BonoboGenericFactory *factory, + const char *component_id, void *data) { GNOME_Evolution_Shell shell; @@ -1635,18 +1711,26 @@ config_control_factory_fn (BonoboGenericFactory *factory, shell = (GNOME_Evolution_Shell) data; - control = config_control_new (shell); + if (!strcmp (component_id, LDAP_CONFIG_CONTROL_ID)) { + control = ldap_config_control_new (shell); + } else if (!strcmp (component_id, ADDRESSBOOK_CONFIG_CONTROL_ID)) { + control = addressbook_config_control_new (shell); + } else { + control = NULL; + g_assert_not_reached (); + } + return BONOBO_OBJECT (control); } gboolean -ldap_config_register_factory (GNOME_Evolution_Shell shell) +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); + factory = bonobo_generic_factory_new_multi (CONFIG_CONTROL_FACTORY_ID, + config_control_factory_fn, + shell); if (factory != NULL) { return TRUE; @@ -1657,7 +1741,7 @@ ldap_config_register_factory (GNOME_Evolution_Shell shell) } void -ldap_config_create_new_source (const char *new_source, GtkWidget *parent) +addressbook_config_create_new_source (const char *new_source, GtkWidget *parent) { #ifdef HAVE_LDAP #if 0 diff --git a/addressbook/gui/component/ldap-config.h b/addressbook/gui/component/addressbook-config.h index 45f538a55d..668c55bbd3 100644 --- a/addressbook/gui/component/ldap-config.h +++ b/addressbook/gui/component/addressbook-config.h @@ -17,17 +17,19 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * - * Author: Chris Toshok - */ + * Authors: + * Chris Toshok <toshok@ximian.com> + * Chris Lahey <clahey@ximian.com> + **/ -#ifndef __LDAP_CONFIG_H__ -#define __LDAP_CONFIG_H__ +#ifndef __ADDRESSBOOK_CONFIG_H__ +#define __ADDRESSBOOK_CONFIG_H__ #include "addressbook-storage.h" -void ldap_config_create_new_source (const char *new_source, - GtkWidget *parent); +void addressbook_config_create_new_source (const char *new_source, + GtkWidget *parent); -gboolean ldap_config_register_factory (GNOME_Evolution_Shell shell); +gboolean addressbook_config_register_factory (GNOME_Evolution_Shell shell); -#endif /* __LDAP_CONFIG_H__ */ +#endif /* __ADDRESSBOOK_CONFIG_H__ */ diff --git a/addressbook/gui/component/addressbook-storage.c b/addressbook/gui/component/addressbook-storage.c index 75a2e2614f..41c9f598b8 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 "ldap-config.h" +#include "addressbook-config.h" #define ADDRESSBOOK_SOURCES_XML "addressbook-sources.xml" diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index 2670451038..332ddf3b56 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 "ldap-config.h" +#include "addressbook-config.h" #include "addressbook.h" #include "addressbook-component.h" #include "addressbook/gui/search/e-addressbook-search-dialog.h" |