From b9db2f0137dd06111913dd93d97737542dba026d Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Sat, 7 Oct 2000 00:49:12 +0000 Subject: Use gnome-vfs to retrieve the requested files. Allows services to specify 2000-10-06 Iain Holmes * component/e-summary.c (request_cb): Use gnome-vfs to retrieve the requested files. Allows services to specify remote urls. (load_default, e_summary_display_window, e_summary_rebuild_page): Change the html to match TigerT's lovely design. (e_summary_add_html_service, e_summary_add_html_service): Add the client argument so we can destroy it when we've quit. (e_summary_window_update): Only do an update if there isn't one pending. * component/e-summary-factory.c (embed_service): upd. * test-service/main.c: Made the test service be really silly and count the number of seconds since it was started. svn path=/trunk/; revision=5776 --- executive-summary/test-service/main.c | 36 +++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'executive-summary/test-service/main.c') diff --git a/executive-summary/test-service/main.c b/executive-summary/test-service/main.c index 719722a599..626f179289 100644 --- a/executive-summary/test-service/main.c +++ b/executive-summary/test-service/main.c @@ -8,35 +8,40 @@ #include static int running_views = 0; -ExecutiveSummaryComponent *component; #define TEST_SERVICE_ID "OAFIID:evolution-summary-component-factory:test-service:0ea887d5-622b-4b8c-b525-18aa1cbe18a6" static BonoboGenericFactory *factory = NULL; -void -clicked_cb (GtkWidget *widget, - gpointer data) +int +clicked_cb (ExecutiveSummaryComponent *component) { + static int i = 1; + char *html; + +#if 0 executive_summary_component_set_title (component, "Iain's title"); executive_summary_component_flash (component); +#endif + + html = g_strdup_printf ("Since you started this service
%d

seconds have passed.", i); + executive_summary_component_update (component, html); + i++; + + g_free (html); + return TRUE; } void view_destroyed (GtkWidget *widget, gpointer data) { - running_views--; - g_print ("Destroying view: %d\n", running_views); - if (running_views <= 0) { - g_print ("No views left, quitting\n"); - gtk_main_quit (); - } + gtk_main_quit (); } -static BonoboObject * +static BonoboObject* create_view (ExecutiveSummaryComponent *component, char **title, void *closure) @@ -65,8 +70,9 @@ create_html (ExecutiveSummaryComponent *component, char **title, void *closure) { - *title = g_strdup ("This is the test service"); - return g_strdup ("This is

An HTML

Component!!!

"); + *title = g_strdup ("The Magic Counter"); + gtk_timeout_add (1000, clicked_cb, component); + return g_strdup ("Since you started this service
0

seconds have passed."); } static void @@ -87,12 +93,14 @@ static BonoboObject * factory_fn (BonoboGenericFactory *_factory, void *closure) { + ExecutiveSummaryComponent *component; + running_views++; component = executive_summary_component_new (create_view, create_html, configure, NULL); - gtk_signal_connect (GTK_OBJECT (component), "destroy", + gtk_signal_connect (GTK_OBJECT (component), "object_gone", GTK_SIGNAL_FUNC (view_destroyed), NULL); return BONOBO_OBJECT (component); } -- cgit v1.2.3