aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-minicard-widget.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-03-23 17:39:37 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-03-23 17:39:37 +0800
commit4f26eac120fd30b1f8199a6aec29c436bfb558a4 (patch)
tree71ee7b80b87d7e47e5ead203ad7a8b63c2d33826 /addressbook/gui/widgets/e-minicard-widget.c
parente4affa9382419295eb9911d5528c1b9e38cb6283 (diff)
downloadgsoc2013-evolution-4f26eac120fd30b1f8199a6aec29c436bfb558a4.tar.gz
gsoc2013-evolution-4f26eac120fd30b1f8199a6aec29c436bfb558a4.tar.zst
gsoc2013-evolution-4f26eac120fd30b1f8199a6aec29c436bfb558a4.zip
Added. Call me old-fashioned, but I just prefer to have a real API rather
2001-03-23 Jon Trowbridge <trow@ximian.com> * gui/widgets/e-minicard-widget.c (e_minicard_widget_set_card): Added. Call me old-fashioned, but I just prefer to have a real API rather than doing everything via gtk_object_get/set-type calls. (e_minicard_widget_set_arg): Changed to call e_minicard_widget_set_card. * backend/ebook/e-book-util.c: Small changes to get rid of compiler warnings. (Casting out const, removed unused variables, etc.) Removed some debugging messages. * gui/component/addressbook-factory.c (main): Added call to e_address_popup_factory_init. * gui/component/e-address-popup.c: Added. A popup gadget that is invoked (as a bonobo control) when an address is left-clicked in the mailer. The addressbook is queries, and the address is either displayed as a minicard (if it already exists) or in a "generic format". A button is provided for editting/adding the contact. Some of the semantics of this widget are a bit... non-standard, because of bonobo issues. I can't really seem to replicate popup-menu behavior because of how bonobo propogates events, etc. so I've tried to produce something that I think is non-annoying. YMMV. 2001-03-23 Jon Trowbridge <trow@ximian.com> * mail-display.c (handle_embedded_address_object): #ifdef away some code I don't quite want to delete yet. (html_button_press_event): Remove some of Radek's placeholder code, replace it with code to create my AddressPopup bonobo control. * mail-format.c: Remove some obsolete code that if #ifdef-ed out a while ago. * mail-ops.c (send_queue_send): Strip out the X-Evolution-Identity header when sending. 2001-03-23 Jon Trowbridge <trow@ximian.com> * camel-filter-driver.c (camel_filter_driver_filter_message): Don't call camel_mime_message_set_identity. (The call is commented out, left over from some earlier experimentation that I want to be able to remember later...) * camel-mime-message.c (camel_mime_message_set_identity): Added. A function to set the X-Evolution-Identity header. svn path=/trunk/; revision=8916
Diffstat (limited to 'addressbook/gui/widgets/e-minicard-widget.c')
-rw-r--r--addressbook/gui/widgets/e-minicard-widget.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/addressbook/gui/widgets/e-minicard-widget.c b/addressbook/gui/widgets/e-minicard-widget.c
index 3f765425e4..3712d5e306 100644
--- a/addressbook/gui/widgets/e-minicard-widget.c
+++ b/addressbook/gui/widgets/e-minicard-widget.c
@@ -196,21 +196,12 @@ static void
e_minicard_widget_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
{
EMinicardWidget *emw = E_MINICARD_WIDGET(object);
+ gpointer ptr;
switch (arg_id){
case ARG_CARD:
- if (emw->card)
- gtk_object_unref(GTK_OBJECT(emw->card));
- if (GTK_VALUE_OBJECT(*arg)) {
- emw->card = E_CARD(GTK_VALUE_OBJECT(*arg));
- gtk_object_ref(GTK_OBJECT(emw->card));
- }
- else
- emw->card = NULL;
- if (emw->item)
- gtk_object_set(GTK_OBJECT(emw->item),
- "card", emw->card,
- NULL);
+ ptr = GTK_VALUE_POINTER (*arg);
+ e_minicard_widget_set_card (emw, ptr ? E_CARD (ptr) : NULL);
break;
default:
break;
@@ -234,3 +225,26 @@ e_minicard_widget_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
break;
}
}
+
+void
+e_minicard_widget_set_card (EMinicardWidget *emw, ECard *card)
+{
+ g_return_if_fail (emw && E_IS_MINICARD_WIDGET (emw));
+ g_return_if_fail (card == NULL || E_IS_CARD (card));
+
+ if (card != emw->card) {
+
+ if (emw->card)
+ gtk_object_unref (GTK_OBJECT (emw->card));
+
+ emw->card = card;
+
+ if (emw->card)
+ gtk_object_ref (GTK_OBJECT (emw->card));
+
+ if (emw->item)
+ gtk_object_set (GTK_OBJECT (emw->item),
+ "card", emw->card,
+ NULL);
+ }
+}