aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component
diff options
context:
space:
mode:
authorjacob berkman <jacob@ximian.com>2001-08-23 06:12:12 +0800
committerJacob Berkman <jberkman@src.gnome.org>2001-08-23 06:12:12 +0800
commit1b92eea9f43d08e724c831ae6807b39b2ba73f4e (patch)
treecafac7e13ddfb43eec207a590c3470855e3eabca /addressbook/gui/component
parent4f1770b14e5b30ca1808e1fa1c1258afe35abee1 (diff)
downloadgsoc2013-evolution-1b92eea9f43d08e724c831ae6807b39b2ba73f4e.tar.gz
gsoc2013-evolution-1b92eea9f43d08e724c831ae6807b39b2ba73f4e.tar.zst
gsoc2013-evolution-1b92eea9f43d08e724c831ae6807b39b2ba73f4e.zip
emit an event from our event source (contact_editor_cb): emit a destroy
2001-08-22 jacob berkman <jacob@ximian.com> * gui/component/e-address-popup.c (emit_event): emit an event from our event source (contact_editor_cb): emit a destroy event so our control frame can be destroyed. (edit_contact_info_cb): emit a hide event so our control frame can be hidden (e_address_popup_cardify): (add_contacts_cb): emit the destroy event (e_address_popup_factory_new_control): don't unref our object at widget destroy time as that was really really broken (e_address_popup_factory_new_control): create an event source and aggregate ourself with it * gui/contact-editor/e-contact-editor.c (enable_writable_fields): display a nicer warning when we can't find a widget for a given field (e_contact_editor_raise): only raise if there is a window * gui/contact-editor/contact-editor.glade: name some widgets that got unnamed, and set the first entry as defaultable * gui/contact-editor/e-contact-editor.c: envelope printing is disabled in 1.0 2001-08-22 jacob berkman <jacob@ximian.com> * mail-display.c: rework how the e-card-popup thing has its life managed. we now hide the window on the Hide event and destroy it on the Destroy event emitted from its event source svn path=/trunk/; revision=12402
Diffstat (limited to 'addressbook/gui/component')
-rw-r--r--addressbook/gui/component/e-address-popup.c40
-rw-r--r--addressbook/gui/component/e-address-popup.h3
2 files changed, 33 insertions, 10 deletions
diff --git a/addressbook/gui/component/e-address-popup.c b/addressbook/gui/component/e-address-popup.c
index c291e95009..362eee4250 100644
--- a/addressbook/gui/component/e-address-popup.c
+++ b/addressbook/gui/component/e-address-popup.c
@@ -883,18 +883,36 @@ e_address_popup_new (void)
}
static void
+emit_event (EAddressPopup *pop, const char *event)
+{
+ if (pop->es) {
+ BonoboArg *arg;
+
+ arg = bonobo_arg_new (BONOBO_ARG_BOOLEAN);
+ BONOBO_ARG_SET_BOOLEAN (arg, TRUE);
+ bonobo_event_source_notify_listeners_full (pop->es,
+ "GNOME/Evolution/Addressbook/AddressPopup",
+ "Event",
+ event,
+ arg, NULL);
+ bonobo_arg_release (arg);
+ }
+}
+
+static void
contact_editor_cb (EBook *book, gpointer closure)
{
EAddressPopup *pop = E_ADDRESS_POPUP (closure);
EContactEditor *ce = e_addressbook_show_contact_editor (book, pop->card, FALSE, TRUE);
- e_contact_editor_raise (ce);
+ emit_event (pop, "Destroy");
+ e_contact_editor_raise (ce);
}
static void
edit_contact_info_cb (EAddressPopup *pop)
{
+ emit_event (pop, "Hide");
e_book_use_local_address_book (contact_editor_cb, pop);
- gtk_widget_destroy (GTK_WIDGET (pop));
}
static void
@@ -932,8 +950,7 @@ add_contacts_cb (EAddressPopup *pop)
e_contact_quick_add_free_form (pop->email, NULL, NULL);
}
-
- gtk_widget_destroy (GTK_WIDGET (pop));
+ emit_event (pop, "Destroy");
}
static void
@@ -997,7 +1014,8 @@ e_address_popup_ambiguous_email_add (EAddressPopup *pop, const GList *cards)
card_picker_init (wiz, cards, pop->name, pop->email);
- gtk_widget_destroy (GTK_WIDGET (pop));
+ emit_event (pop, "Destroy");
+
gtk_container_add (GTK_CONTAINER (win), wiz->body);
gtk_widget_show_all (win);
}
@@ -1144,17 +1162,15 @@ e_address_popup_factory_new_control (void)
{
BonoboControl *control;
BonoboPropertyBag *bag;
+ EAddressPopup *addy;
GtkWidget *w;
w = e_address_popup_new ();
+ addy = E_ADDRESS_POPUP (w);
+
control = bonobo_control_new (w);
gtk_widget_show (w);
- gtk_signal_connect_object (GTK_OBJECT (w),
- "destroy",
- GTK_SIGNAL_FUNC (bonobo_object_unref),
- GTK_OBJECT (control));
-
bag = bonobo_property_bag_new (get_prop, set_prop, w);
bonobo_property_bag_add (bag, "name", PROPERTY_NAME,
BONOBO_ARG_STRING, NULL, NULL,
@@ -1171,6 +1187,10 @@ e_address_popup_factory_new_control (void)
bonobo_control_set_properties (control, bag);
bonobo_object_unref (BONOBO_OBJECT (bag));
+ addy->es = bonobo_event_source_new ();
+ bonobo_object_add_interface (BONOBO_OBJECT (control),
+ BONOBO_OBJECT (addy->es));
+
return control;
}
diff --git a/addressbook/gui/component/e-address-popup.h b/addressbook/gui/component/e-address-popup.h
index 9cfde6cb28..ef51437551 100644
--- a/addressbook/gui/component/e-address-popup.h
+++ b/addressbook/gui/component/e-address-popup.h
@@ -31,6 +31,7 @@
#include <gtk/gtk.h>
#include <libgnome/gnome-defs.h>
#include <addressbook/backend/ebook/e-card.h>
+#include <bonobo/bonobo-event-source.h>
BEGIN_GNOME_DECLS
@@ -63,6 +64,8 @@ struct _EAddressPopup {
guint query_tag;
gboolean multiple_matches;
ECard *card;
+
+ BonoboEventSource *es;
};
struct _EAddressPopupClass {