diff options
-rw-r--r-- | calendar/ChangeLog | 10 | ||||
-rw-r--r-- | calendar/cal-client/client-test.c | 33 |
2 files changed, 38 insertions, 5 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 0073bbd209..3f6b67d465 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,13 @@ +2000-04-24 Federico Mena Quintero <federico@helixcode.com> + + * cal-client/client-test.c (main): The path to the test calendar + changed when we moved stuff around. Users will have to tweak this + for their CVS setup, anyways. + (create_client): Create or load the calendar as appropriate. + (client_destroy_cb): Exit the main loop if both clients are gone. + (main): Connect to the "destroy" signal of the clients so that we + can terminate the test program. + 2000-04-24 Seth Alves <alves@hungry.com> * pcs/icalendar.c (parse_person): allow for null CN diff --git a/calendar/cal-client/client-test.c b/calendar/cal-client/client-test.c index 28acee4802..fa8316707d 100644 --- a/calendar/cal-client/client-test.c +++ b/calendar/cal-client/client-test.c @@ -65,7 +65,7 @@ list_uids (gpointer data) cal_obj_uid_list_free (uids); -/* gtk_object_unref (GTK_OBJECT (client)); */ + gtk_object_unref (GTK_OBJECT (client)); return FALSE; } @@ -118,10 +118,11 @@ create_client (const char *uri, gboolean load) if (load) result = cal_client_load_calendar (client, uri); else - result = cal_client_load_calendar (client, uri); + result = cal_client_create_calendar (client, uri); if (!result) { - g_message ("create_client(): failure when issuing calendar load/create request `%s'", + g_message ("create_client(): failure when issuing calendar %s request `%s'", + load ? "load" : "create", uri); exit (1); } @@ -129,6 +130,21 @@ create_client (const char *uri, gboolean load) return client; } +/* Callback used when a client is destroyed */ +static void +client_destroy_cb (GtkObject *object, gpointer data) +{ + if (CAL_CLIENT (object) == client1) + client1 = NULL; + else if (CAL_CLIENT (object) == client2) + client2 = NULL; + else + g_assert_not_reached (); + + if (!client1 && !client2) + gtk_main_quit (); +} + int main (int argc, char **argv) { @@ -151,8 +167,15 @@ main (int argc, char **argv) exit (1); } - client1 = create_client ("/cvs/evolution/calendar/test2.vcf", TRUE); - client2 = create_client ("/cvs/evolution/calendar/test2.vcf", FALSE); + client1 = create_client ("/cvs/evolution/calendar/gui/test2.vcf", TRUE); + gtk_signal_connect (GTK_OBJECT (client1), "destroy", + client_destroy_cb, + NULL); + + client2 = create_client ("/cvs/evolution/calendar/gui/test2.vcf", FALSE); + gtk_signal_connect (GTK_OBJECT (client2), "destroy", + client_destroy_cb, + NULL); bonobo_main (); |