From c94793983e7e5b95403a29d3a1fe79955c8e33a2 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Mon, 1 May 2000 04:22:17 +0000 Subject: Connect to the "last_book_gone" signal of the book factory. 2000-04-30 Federico Mena Quintero * wombat.c (setup_pas): Connect to the "last_book_gone" signal of the book factory. (last_book_gone_cb): Handle the "last_book_gone" signal. (termination_handler): Check if the book factory has zero running backends. svn path=/trunk/; revision=2706 --- wombat/ChangeLog | 8 ++++++++ wombat/wombat.c | 14 +++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/wombat/ChangeLog b/wombat/ChangeLog index d54b57bb34..a0dca9964c 100644 --- a/wombat/ChangeLog +++ b/wombat/ChangeLog @@ -1,3 +1,11 @@ +2000-04-30 Federico Mena Quintero + + * wombat.c (setup_pas): Connect to the "last_book_gone" signal of + the book factory. + (last_book_gone_cb): Handle the "last_book_gone" signal. + (termination_handler): Check if the book factory has zero running + backends. + 2000-04-30 Christopher James Lahey * Makefile.am: Added ename libs to LDADD. diff --git a/wombat/wombat.c b/wombat/wombat.c index 43ee72d886..79af7f057f 100644 --- a/wombat/wombat.c +++ b/wombat/wombat.c @@ -40,7 +40,8 @@ termination_handler (gpointer data) { /* FIXME: add the test for the PAS as well */ - if (cal_factory_get_n_backends (cal_factory) == 0) + if (cal_factory_get_n_backends (cal_factory) == 0 + && pas_book_factory_get_n_backends (pas_book_factory) == 0) gtk_main_quit (); termination_handler_id = 0; @@ -59,6 +60,12 @@ queue_termination (void) +static void +last_book_gone_cb (PASBookFactory *factory, gpointer data) +{ + queue_termination (); +} + static void setup_pas (int argc, char **argv) { @@ -72,6 +79,11 @@ setup_pas (int argc, char **argv) pas_book_factory, "ldap", pas_backend_ldap_new); #endif + gtk_signal_connect (GTK_OBJECT (pas_book_factory), + "last_book_gone", + GTK_SIGNAL_FUNC (last_book_gone_cb), + NULL); + pas_book_factory_activate (pas_book_factory); } -- cgit