diff options
-rw-r--r-- | wombat/ChangeLog | 8 | ||||
-rw-r--r-- | wombat/wombat.c | 14 |
2 files changed, 21 insertions, 1 deletions
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 <federico@helixcode.com> + + * 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 <clahey@helixcode.com> * 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; @@ -60,6 +61,12 @@ queue_termination (void) static void +last_book_gone_cb (PASBookFactory *factory, gpointer data) +{ + queue_termination (); +} + +static void setup_pas (int argc, char **argv) { pas_book_factory = pas_book_factory_new (); @@ -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); } |