From cf4799b253ff79278d73da164aef52389dead454 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Fri, 2 Jun 2000 19:24:57 +0000 Subject: Made evolution-addressbook shut down when the shell is done with it. 2000-06-02 Christopher James Lahey * gui/component/addressbook-component.c: Made evolution-addressbook shut down when the shell is done with it. svn path=/trunk/; revision=3398 --- addressbook/gui/component/addressbook-component.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'addressbook/gui/component') diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index 459a77d510..c3c7a14d60 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -31,6 +31,7 @@ #include "evolution-storage.h" #include "addressbook-component.h" +#include "addressbook.h" #ifdef USING_OAF @@ -62,11 +63,24 @@ create_view (EvolutionShellComponent *shell_component, return control; } +static int owner_count = 0; + static void owner_set_cb (EvolutionShellComponent *shell_component, - Evolution_Shell shell_interface) + Evolution_Shell shell_interface, + gpointer user_data) +{ + owner_count ++; +} + +static void +owner_unset_cb (EvolutionShellComponent *shell_component, + Evolution_Shell shell_interface, + gpointer user_data) { - g_print ("addressbook: Yeeeh! We have an owner!\n"); /* FIXME */ + owner_count --; + if (owner_count == 0) + gtk_main_quit(); } @@ -83,6 +97,9 @@ factory_fn (BonoboGenericFactory *factory, gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set", GTK_SIGNAL_FUNC (owner_set_cb), NULL); + gtk_signal_connect (GTK_OBJECT (shell_component), "owner_unset", + GTK_SIGNAL_FUNC (owner_unset_cb), NULL); + return BONOBO_OBJECT (shell_component); } -- cgit v1.2.3