diff options
author | Dan Winship <danw@src.gnome.org> | 2004-05-12 03:28:36 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2004-05-12 03:28:36 +0800 |
commit | 7f8c30cebcdfd7f63674be90cab467bd6a7495d7 (patch) | |
tree | 22c5d0273b437e54d652d59bb6f90fb1f15ba868 /addressbook | |
parent | 580bd2fee1afd6c4528cae55249aa2eb72e9cdba (diff) | |
download | gsoc2013-evolution-7f8c30cebcdfd7f63674be90cab467bd6a7495d7.tar.gz gsoc2013-evolution-7f8c30cebcdfd7f63674be90cab467bd6a7495d7.tar.zst gsoc2013-evolution-7f8c30cebcdfd7f63674be90cab467bd6a7495d7.zip |
Remove the addressbook control
* gui/component/GNOME_Evolution_Addressbook.server.in.in: Remove
the addressbook control
* gui/component/component-factory.c (factory): Remove support for
the addressbook control
* gui/component/addressbook-view.c: Remove all the property-bag
stuff.
svn path=/trunk/; revision=25856
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 12 | ||||
-rw-r--r-- | addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in | 14 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-view.c | 157 | ||||
-rw-r--r-- | addressbook/gui/component/component-factory.c | 8 |
4 files changed, 22 insertions, 169 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 48365db5e1..69bd24572a 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,14 @@ +2004-05-11 Dan Winship <danw@ximian.com> + + * gui/component/GNOME_Evolution_Addressbook.server.in.in: Remove + the addressbook control + + * gui/component/component-factory.c (factory): Remove support for + the addressbook control + + * gui/component/addressbook-view.c: Remove all the property-bag + stuff. + 2004-05-11 Sivaiah Nallagatla <snallagatla@novell.com> * gui/component/addressbook-config.c (dialog_to_source) : see if the selected @@ -102,6 +113,7 @@ * gui/component/ldap-config.glade: remove unused colorpicker. +>>>>>>> 1.1697 2004-05-03 JP Rosevear <jpr@ximian.com> * gui/component/GNOME_Evolution_Addressbook.server.in.in: set the diff --git a/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in b/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in index 1af1517cc7..c611e1923a 100644 --- a/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in +++ b/addressbook/gui/component/GNOME_Evolution_Addressbook.server.in.in @@ -32,20 +32,6 @@ </oaf_server> -<oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_Control:@VERSION@" - type="factory" - location="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:BonoboControl/addressbook-control:@VERSION@"/> - <item value="IDL:GNOME/Control:1.0"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Addressbook folder viewer"/> - -</oaf_server> - <oaf_server iid="OAFIID:GNOME_Evolution_Addressbook_Component:@VERSION@" type="factory" location="OAFIID:GNOME_Evolution_Addressbook_Factory:@VERSION@"> diff --git a/addressbook/gui/component/addressbook-view.c b/addressbook/gui/component/addressbook-view.c index 7411e4f850..0af61da6e1 100644 --- a/addressbook/gui/component/addressbook-view.c +++ b/addressbook/gui/component/addressbook-view.c @@ -36,7 +36,6 @@ #include <bonobo/bonobo-generic-factory.h> #include <bonobo/bonobo-ui-util.h> #include <bonobo/bonobo-exception.h> -#include <bonobo/bonobo-property-bag.h> #include <gal/util/e-util.h> #include "widgets/misc/e-task-bar.h" @@ -72,12 +71,6 @@ static GdkPixbuf *progress_icon = NULL; #define d(x) -#define PROPERTY_SOURCE_UID "source_uid" -#define PROPERTY_FOLDER_URI "folder_uri" - -#define PROPERTY_SOURCE_UID_IDX 1 -#define PROPERTY_FOLDER_URI_IDX 2 - struct _AddressbookViewPrivate { GtkWidget *notebook; BonoboControl *folder_view_control; @@ -94,7 +87,6 @@ struct _AddressbookViewPrivate { GHashTable *uid_to_view; EBook *book; guint activity_id; - BonoboPropertyBag *properties; ESourceList *source_list; char *passwd; EUserCreatableItemsHandler *creatable_items_handler; @@ -112,15 +104,12 @@ static gint num_drag_types = sizeof(drag_types) / sizeof(drag_types[0]); static void set_status_message (EABView *eav, const char *message, AddressbookView *view); static void search_result (EABView *eav, EBookViewStatus status, 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 addressbook_view_dispose (GObject *object); -static void set_prop (BonoboPropertyBag *bag, const BonoboArg *arg, guint arg_id, - CORBA_Environment *ev, gpointer user_data); -static void get_prop (BonoboPropertyBag *bag, BonoboArg *arg, guint arg_id, - CORBA_Environment *ev, gpointer user_data); - static EABView * get_current_view (AddressbookView *view) { @@ -551,14 +540,12 @@ source_list_changed_cb (ESourceList *source_list, AddressbookView *view) static void load_uri_for_selection (ESourceSelector *selector, - BonoboControl *view_control) + AddressbookView *view) { ESource *selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (selector)); - if (selected_source != NULL) { - bonobo_control_set_property (view_control, NULL, "source_uid", TC_CORBA_string, - e_source_peek_uid (selected_source), NULL); - } + if (selected_source != NULL) + activate_source (view, selected_source); } static ESource * @@ -753,7 +740,7 @@ static void primary_source_selection_changed_callback (ESourceSelector *selector, AddressbookView *view) { - load_uri_for_selection (selector, view->priv->folder_view_control); + load_uri_for_selection (selector, view); save_primary_selection (view); } @@ -993,22 +980,6 @@ addressbook_view_init (AddressbookView *view) gtk_widget_show (priv->notebook); - priv->properties = bonobo_property_bag_new (get_prop, set_prop, view); - - bonobo_property_bag_add (priv->properties, - PROPERTY_SOURCE_UID, PROPERTY_SOURCE_UID_IDX, - BONOBO_ARG_STRING, NULL, - _("UID of the contacts source that the view will display"), 0); - - bonobo_property_bag_add (priv->properties, - PROPERTY_FOLDER_URI, PROPERTY_FOLDER_URI_IDX, - BONOBO_ARG_STRING, NULL, - _("The URI that the address book will display"), 0); - - bonobo_control_set_properties (priv->folder_view_control, - bonobo_object_corba_objref (BONOBO_OBJECT (priv->properties)), - NULL); - e_book_get_addressbooks (&priv->source_list, NULL); g_signal_connect (priv->source_list, "changed", @@ -1062,7 +1033,7 @@ addressbook_view_init (AddressbookView *view) G_OBJECT (view), 0); load_primary_selection (view); - load_uri_for_selection (E_SOURCE_SELECTOR (priv->selector), priv->folder_view_control); + load_uri_for_selection (E_SOURCE_SELECTOR (priv->selector), view); } static void @@ -1075,9 +1046,6 @@ addressbook_view_dispose (GObject *object) if (priv->book) g_object_unref (priv->book); - if (priv->properties) - bonobo_object_unref (BONOBO_OBJECT(priv->properties)); - g_free(priv->passwd); if (priv->source_list) @@ -1135,14 +1103,15 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure) static void activate_source (AddressbookView *view, - ESource *source, - const char *uid) + ESource *source) { AddressbookViewPrivate *priv = view->priv; + const char *uid; GtkWidget *uid_view; EBook *book; BookOpenData *data; + uid = e_source_peek_uid (source); uid_view = g_hash_table_lookup (priv->uid_to_view, uid); if (uid_view) { @@ -1231,112 +1200,6 @@ activate_source (AddressbookView *view, } } -static void -set_prop (BonoboPropertyBag *bag, - const BonoboArg *arg, - guint arg_id, - CORBA_Environment *ev, - gpointer user_data) -{ - AddressbookView *view = user_data; - AddressbookViewPrivate *priv = view->priv; - ESource *source; - - switch (arg_id) { - - case PROPERTY_FOLDER_URI_IDX: { - const gchar *string = BONOBO_ARG_GET_STRING (arg); - ESourceGroup *group; - - group = e_source_group_new ("", string); - source = e_source_new ("", ""); - e_source_set_group (source, group); - - /* we use the uri as the uid here. */ - activate_source (view, source, string); - - g_object_unref (group); - - break; - } - case PROPERTY_SOURCE_UID_IDX: { - const gchar *uid; - - uid = BONOBO_ARG_GET_STRING (arg); - - source = e_source_list_peek_source_by_uid (priv->source_list, uid); - - if (source) { - activate_source (view, source, uid); - } - else { - g_warning ("Could not find source by UID '%s'!", uid); - } - - break; - } - default: - g_warning ("Unhandled arg %d\n", arg_id); - break; - } -} - -static void -get_prop (BonoboPropertyBag *bag, - BonoboArg *arg, - guint arg_id, - CORBA_Environment *ev, - gpointer user_data) -{ - AddressbookView *view = user_data; - EABView *v = get_current_view (view); - ESource *source = NULL; - - switch (arg_id) { - - case PROPERTY_FOLDER_URI_IDX: - if (v) { - g_object_get (v, - "source", &source, - NULL); - } - - if (source) { - char *uri = e_source_get_uri (source); - - BONOBO_ARG_SET_STRING (arg, uri); - - g_free (uri); - g_object_unref (source); - } - else { - BONOBO_ARG_SET_STRING (arg, ""); - } - break; - - case PROPERTY_SOURCE_UID_IDX: - if (v) { - g_object_get (v, - "source", &source, - NULL); - } - - if (source) { - BONOBO_ARG_SET_STRING (arg, e_source_peek_uid (source)); - - g_object_unref (source); - } - else { - BONOBO_ARG_SET_STRING (arg, ""); - } - - break; - - default: - g_warning ("Unhandled arg %d\n", arg_id); - } -} - AddressbookView * addressbook_view_new (void) { diff --git a/addressbook/gui/component/component-factory.c b/addressbook/gui/component/component-factory.c index dff4164955..5b3cd12396 100644 --- a/addressbook/gui/component/component-factory.c +++ b/addressbook/gui/component/component-factory.c @@ -40,7 +40,6 @@ #define FACTORY_ID "OAFIID:GNOME_Evolution_Addressbook_Factory:" BASE_VERSION #define VCARD_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_VCard_Control:" BASE_VERSION -#define ADDRESSBOOK_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_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 SELECT_NAMES_ID "OAFIID:GNOME_Evolution_Addressbook_SelectNames:" BASE_VERSION @@ -58,13 +57,6 @@ factory (BonoboGenericFactory *factory, if (strcmp (component_id, VCARD_CONTROL_ID) == 0) return BONOBO_OBJECT (eab_vcard_control_new ()); - if (strcmp (component_id, ADDRESSBOOK_CONTROL_ID) == 0) { - AddressbookView *view; - - /* FIXME: temporary hack, leaks a view */ - view = addressbook_view_new (); - return BONOBO_OBJECT (addressbook_view_peek_folder_view (view)); - } if (strcmp (component_id, COMPONENT_ID) == 0) { BonoboObject *object = BONOBO_OBJECT (addressbook_component_peek ()); bonobo_object_ref (object); |