diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-02-22 00:30:44 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-02-22 00:30:44 +0800 |
commit | e0ffe55ce596c6319016004dfe3350b0d7cc762d (patch) | |
tree | 21181afe5b5c3393dd462c28d0a3589c0a98ddea /addressbook | |
parent | f2e39cb105bfd76974ef237519db96f472112540 (diff) | |
download | gsoc2013-evolution-e0ffe55ce596c6319016004dfe3350b0d7cc762d.tar gsoc2013-evolution-e0ffe55ce596c6319016004dfe3350b0d7cc762d.tar.gz gsoc2013-evolution-e0ffe55ce596c6319016004dfe3350b0d7cc762d.tar.bz2 gsoc2013-evolution-e0ffe55ce596c6319016004dfe3350b0d7cc762d.tar.lz gsoc2013-evolution-e0ffe55ce596c6319016004dfe3350b0d7cc762d.tar.xz gsoc2013-evolution-e0ffe55ce596c6319016004dfe3350b0d7cc762d.tar.zst gsoc2013-evolution-e0ffe55ce596c6319016004dfe3350b0d7cc762d.zip |
Garbage collect some debonoboized files.
Contacts module is now 100% Bonobo-free.
svn path=/branches/kill-bonobo/; revision=37307
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/gui/component/addressbook-component.c | 97 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-component.h | 64 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-view.c | 229 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-view.h | 65 | ||||
-rw-r--r-- | addressbook/gui/component/component-factory.c | 79 |
5 files changed, 0 insertions, 534 deletions
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c deleted file mode 100644 index b79ff34cea..0000000000 --- a/addressbook/gui/component/addressbook-component.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Ettore Perazzoli <ettore@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -/* EPFIXME: Add autocompletion setting. */ - -#include <config.h> - -#include "addressbook-component.h" -#include "addressbook-config.h" -#include "addressbook-migrate.h" -#include "addressbook-view.h" -#include "addressbook/gui/contact-editor/eab-editor.h" -#include "addressbook/gui/widgets/eab-gui-util.h" -#include "e-util/e-plugin.h" -#include "e-util/e-import.h" -#include "addressbook/gui/widgets/eab-popup.h" -#include "addressbook/gui/widgets/eab-menu.h" -#include "addressbook/gui/widgets/eab-config.h" -#include "addressbook/importers/evolution-addressbook-importers.h" - -#include "misc/e-task-bar.h" -#include "misc/e-info-label.h" - -#include "shell/e-component-view.h" - -#include <string.h> -#include <gtk/gtk.h> -#include <glib/gi18n-lib.h> -#include <gconf/gconf-client.h> -#include <e-util/e-util.h> -#include <libedataserver/e-url.h> - -#ifdef ENABLE_SMIME -#include "smime/gui/component.h" -#endif - -static BonoboObjectClass *parent_class = NULL; - -/* Evolution::Component CORBA methods. */ - -static void -impl_upgradeFromVersion (PortableServer_Servant servant, short major, short minor, short revision, CORBA_Environment *ev) -{ - GError *err = NULL; - - if (!addressbook_migrate (addressbook_component_peek (), major, minor, revision, &err)) { - GNOME_Evolution_Component_UpgradeFailed *failedex; - - failedex = GNOME_Evolution_Component_UpgradeFailed__alloc(); - failedex->what = CORBA_string_dup(_("Failed upgrading Address Book settings or folders.")); - failedex->why = CORBA_string_dup(err->message); - CORBA_exception_set(ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Component_UpgradeFailed, failedex); - } - - if (err) - g_error_free(err); -} - -/* Initialization. */ - -static void -addressbook_component_class_init (AddressbookComponentClass *class) -{ - POA_GNOME_Evolution_Component__epv *epv = &class->epv; - GObjectClass *object_class = G_OBJECT_CLASS (class); - - epv->upgradeFromVersion = impl_upgradeFromVersion; - - parent_class = g_type_class_peek_parent (class); -} - -static void -addressbook_component_init (AddressbookComponent *component) -{ -#ifdef ENABLE_SMIME - smime_component_init (); -#endif -} diff --git a/addressbook/gui/component/addressbook-component.h b/addressbook/gui/component/addressbook-component.h deleted file mode 100644 index 83fbdf87ee..0000000000 --- a/addressbook/gui/component/addressbook-component.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Ettore Perazzoli <ettore@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef _ADDRESSBOOK_COMPONENT_H_ -#define _ADDRESSBOOK_COMPONENT_H_ - -#include <bonobo/bonobo-object.h> - -#include "Evolution.h" -#include "e-activity-handler.h" -#include <libedataserver/e-source-list.h> - -#define ADDRESSBOOK_TYPE_COMPONENT (addressbook_component_get_type ()) -#define ADDRESSBOOK_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ADDRESSBOOK_TYPE_COMPONENT, AddressbookComponent)) -#define ADDRESSBOOK_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ADDRESSBOOK_TYPE_COMPONENT, AddressbookComponentClass)) -#define ADDRESSBOOK_IS_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ADDRESSBOOK_TYPE_COMPONENT)) -#define ADDRESSBOOK_IS_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), ADDRESSBOOK_TYPE_COMPONENT)) - - -typedef struct _AddressbookComponent AddressbookComponent; -typedef struct _AddressbookComponentPrivate AddressbookComponentPrivate; -typedef struct _AddressbookComponentClass AddressbookComponentClass; - -struct _AddressbookComponent { - BonoboObject parent; - - AddressbookComponentPrivate *priv; -}; - -struct _AddressbookComponentClass { - BonoboObjectClass parent_class; - - POA_GNOME_Evolution_Component__epv epv; -}; - - -GType addressbook_component_get_type (void); - -AddressbookComponent *addressbook_component_peek (void); - -GConfClient *addressbook_component_peek_gconf_client (AddressbookComponent *component); -const char *addressbook_component_peek_base_directory (AddressbookComponent *component); - -#endif /* _ADDRESSBOOK_COMPONENT_H_ */ diff --git a/addressbook/gui/component/addressbook-view.c b/addressbook/gui/component/addressbook-view.c deleted file mode 100644 index 23872a3366..0000000000 --- a/addressbook/gui/component/addressbook-view.c +++ /dev/null @@ -1,229 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* addressbook-view.c - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - * 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., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - * Author: Chris Toshok (toshok@ximian.com) - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <string.h> -#include <gtk/gtk.h> -#include <glib/gi18n.h> -#include <gdk/gdkkeysyms.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-ui-util.h> -#include <bonobo/bonobo-exception.h> -#include <e-util/e-util.h> -#include <libedataserverui/e-source-selector.h> -#include <libedataserverui/e-passwords.h> - -#include "e-util/e-error.h" -#include "e-util/e-request.h" -#include "misc/e-task-bar.h" -#include "misc/e-info-label.h" - -#include "e-util/e-icon-factory.h" -#include "e-util/e-util-private.h" -#include "shell/e-user-creatable-items-handler.h" - -#include "evolution-shell-component-utils.h" -#include "e-activity-handler.h" -#include "e-contact-editor.h" -#include "addressbook-config.h" -#include "addressbook.h" -#include "addressbook-view.h" -#include "addressbook-component.h" -#include "addressbook/gui/widgets/e-addressbook-view.h" -#include "addressbook/gui/widgets/eab-gui-util.h" -#include "addressbook/gui/merging/eab-contact-merging.h" -#include "addressbook/printing/e-contact-print.h" -#include "addressbook/util/eab-book-util.h" -#include "addressbook/gui/widgets/eab-popup.h" -#include "addressbook/gui/widgets/eab-menu.h" - -#define PARENT_TYPE G_TYPE_OBJECT -static GObjectClass *parent_class = NULL; - -#define d(x) - -struct _AddressbookViewPrivate { - GtkWidget *notebook; - BonoboControl *folder_view_control; - - GtkWidget *statusbar_widget; - EActivityHandler *activity_handler; - - GtkWidget *info_widget; - GtkWidget *sidebar_widget; - GtkWidget *selector; - - GConfClient *gconf_client; - - GHashTable *uid_to_view; - GHashTable *uid_to_editor; - - EBook *book; - guint activity_id; - ESourceList *source_list; - char *passwd; - EUserCreatableItemsHandler *creatable_items_handler; - - EABMenu *menu; -}; - -static void set_status_message (EABView *eav, const char *message, AddressbookView *view); - -static void activate_source (AddressbookView *view, ESource *source); - -static void addressbook_view_init (AddressbookView *view); -static void addressbook_view_class_init (AddressbookViewClass *klass); - -static void -control_activate (BonoboControl *control, - BonoboUIComponent *uic, - AddressbookView *view) -{ - AddressbookViewPrivate *priv = view->priv; - Bonobo_UIContainer remote_ui_container; - EABView *v = get_current_view (view); - char *xmlfile; - - if (v) - eab_view_setup_menus (v, uic); - - e_user_creatable_items_handler_activate (priv->creatable_items_handler, uic); - - bonobo_ui_component_thaw (uic, NULL); - - if (v) - update_command_state (v, view); -} - -static void -control_activate_cb (BonoboControl *control, - gboolean activate, - AddressbookView *view) -{ - BonoboUIComponent *uic; - EABView *v = get_current_view (view); - - uic = bonobo_control_get_ui_component (control); - g_return_if_fail (uic != NULL); - - if (activate) { - control_activate (control, uic, view); - e_menu_activate((EMenu *)view->priv->menu, uic, activate); - if (activate && v && v->model) - eab_model_force_folder_bar_message (v->model); - } else { - e_menu_activate((EMenu *)view->priv->menu, uic, activate); - bonobo_ui_component_unset_container (uic, NULL); - eab_view_discard_menus (v); - } -} - -static void -load_uri_for_selection (ESourceSelector *selector, - AddressbookView *view, - gboolean force) -{ - ESource *selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (selector)); - ESource *primary = get_primary_source (view); - - if (selected_source != NULL && - ((primary && (!g_str_equal (e_source_peek_uid (primary),e_source_peek_uid (selected_source) )))||force)) - activate_source (view, selected_source); -} - -/* Folder popup menu callbacks */ -typedef struct { - AddressbookView *view; - ESource *selected_source; - GtkWidget *toplevel; -} BookRemovedClosure; - -static void -addressbook_view_init (AddressbookView *view) -{ - AddressbookViewPrivate *priv; - GtkWidget *selector_scrolled_window; - AtkObject *a11y; - - priv->menu = eab_menu_new("org.gnome.evolution.addressbook.view"); - - g_signal_connect (priv->folder_view_control, "activate", - G_CALLBACK (control_activate_cb), view); - - load_uri_for_selection (E_SOURCE_SELECTOR (priv->selector), view, TRUE); -} - -static void -destroy_editor (char *key, - gpointer value, - gpointer nada) -{ - EditorUidClosure *closure = value; - - g_object_weak_unref (G_OBJECT (closure->editor), - editor_weak_notify, closure); - - gtk_widget_destroy (GTK_WIDGET (closure->editor)); -} - -void -addressbook_view_edit_contact (AddressbookView* view, - const char* source_uid, - const char* contact_uid) -{ - AddressbookViewPrivate *priv = view->priv; - - ESource* source = NULL; - EContact* contact = NULL; - EBook* book = NULL; - - if (!source_uid || !contact_uid) - return; - - source = e_source_list_peek_source_by_uid (priv->source_list, source_uid); - if (!source) - return; - - /* FIXME: Can I unref this book? */ - book = e_book_new (source, NULL); - if (!book) - return; - - if (!e_book_open (book, TRUE, NULL)) { - g_object_unref (book); - return; - } - - e_book_get_contact (book, contact_uid, &contact, NULL); - - if (!contact) { - g_object_unref (book); - return; - } - eab_show_contact_editor (book, contact, FALSE, FALSE); - g_object_unref (contact); - g_object_unref (book); -} diff --git a/addressbook/gui/component/addressbook-view.h b/addressbook/gui/component/addressbook-view.h deleted file mode 100644 index f86ce46005..0000000000 --- a/addressbook/gui/component/addressbook-view.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Chris Toshok <toshok@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef _ADDRESSBOOK_VIEW_H_ -#define _ADDRESSBOOK_VIEW_H_ - -#include <bonobo/bonobo-control.h> - -#define ADDRESSBOOK_TYPE_VIEW (addressbook_view_get_type ()) -#define ADDRESSBOOK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ADDRESSBOOK_TYPE_VIEW, AddressbookView)) -#define ADDRESSBOOK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ADDRESSBOOK_TYPE_VIEW, AddressbookViewClass)) -#define ADDRESSBOOK_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ADDRESSBOOK_TYPE_VIEW)) -#define ADDRESSBOOK_IS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), ADDRESSBOOK_TYPE_VIEW)) - - -typedef struct _AddressbookView AddressbookView; -typedef struct _AddressbookViewPrivate AddressbookViewPrivate; -typedef struct _AddressbookViewClass AddressbookViewClass; - -struct _AddressbookView { - GObject parent; - - AddressbookViewPrivate *priv; -}; - -struct _AddressbookViewClass { - GObjectClass parent_class; -}; - - -GType addressbook_view_get_type (void); - -AddressbookView *addressbook_view_new (void); - -EActivityHandler *addressbook_view_peek_activity_handler (AddressbookView *view); -GtkWidget *addressbook_view_peek_info_label (AddressbookView *view); -GtkWidget *addressbook_view_peek_sidebar (AddressbookView *view); -GtkWidget *addressbook_view_peek_statusbar (AddressbookView *view); -BonoboControl *addressbook_view_peek_folder_view (AddressbookView *view); - -void addressbook_view_edit_contact (AddressbookView* view, - const char* source_id, - const char* contact_id); - -#endif /* _ADDRESSBOOK_VIEW_H_ */ diff --git a/addressbook/gui/component/component-factory.c b/addressbook/gui/component/component-factory.c deleted file mode 100644 index feea79d88f..0000000000 --- a/addressbook/gui/component/component-factory.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * component-factory.c - Factory for Evolution's Addressbook component. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see <http://www.gnu.org/licenses/> - * - * - * Authors: - * Ettore Perazzoli <ettore@ximian.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include <config.h> - -#include <string.h> -#include "addressbook.h" -#include "addressbook-component.h" -#include "addressbook-config.h" -#include "addressbook-view.h" -#include "autocompletion-config.h" -#include "eab-popup-control.h" -#include "eab-vcard-control.h" -#ifdef ENABLE_SMIME -#include "smime/gui/certificate-manager.h" -#endif -#include <bonobo/bonobo-shlib-factory.h> - - -#define FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_Factory:" BASE_VERSION - -#define VCARD_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_VCard_Control:" BASE_VERSION -#define COMPONENT_ID "OAFIID:GNOME_Evolution_Addressbook_Component:" BASE_VERSION -#define ADDRESS_POPUP_ID "OAFIID:GNOME_Evolution_Addressbook_AddressPopup:" BASE_VERSION -#define COMPLETION_CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_Autocompletion_ConfigControl:" BASE_VERSION -#define CERTIFICATE_MANAGER_CONFIG_CONTROL_ID "OAFIID:GNOME_Evolution_SMime_CertificateManager_ConfigControl:" BASE_VERSION - -#define d(x) - - -static BonoboObject * -factory (BonoboGenericFactory *factory, - const char *component_id, - void *closure) -{ - d(printf ("asked to activate component_id `%s'\n", component_id)); - - if (strcmp (component_id, VCARD_CONTROL_ID) == 0) - return BONOBO_OBJECT (eab_vcard_control_new ()); - if (strcmp (component_id, COMPONENT_ID) == 0) { - BonoboObject *object = BONOBO_OBJECT (addressbook_component_peek ()); - bonobo_object_ref (object); - return object; - } - if (strcmp (component_id, ADDRESS_POPUP_ID) == 0) - return BONOBO_OBJECT (eab_popup_control_new ()); - if (strcmp (component_id, COMPLETION_CONFIG_CONTROL_ID) == 0) - return BONOBO_OBJECT (autocompletion_config_control_new ()); -#ifdef ENABLE_SMIME - if (strcmp (component_id, CERTIFICATE_MANAGER_CONFIG_CONTROL_ID) == 0) - return BONOBO_OBJECT (certificate_manager_config_control_new ()); -#endif - - g_warning (FACTORY_ID ": Don't know what to do with %s", component_id); - return NULL; -} - -BONOBO_ACTIVATION_SHLIB_FACTORY (FACTORY_ID, "Evolution Addressbook component factory", factory, NULL) |