aboutsummaryrefslogtreecommitdiffstats
path: root/executive-summary/test-service
diff options
context:
space:
mode:
authorIain Holmes <iain@helixcode.com>2000-10-07 08:49:12 +0800
committerIain Holmes <iain@src.gnome.org>2000-10-07 08:49:12 +0800
commitb9db2f0137dd06111913dd93d97737542dba026d (patch)
tree8fab61b763233e5221675ca23cfa86a076b9d023 /executive-summary/test-service
parentd412d185d593da40b2ff5c8eb913b1152cc13856 (diff)
downloadgsoc2013-evolution-b9db2f0137dd06111913dd93d97737542dba026d.tar.gz
gsoc2013-evolution-b9db2f0137dd06111913dd93d97737542dba026d.tar.zst
gsoc2013-evolution-b9db2f0137dd06111913dd93d97737542dba026d.zip
Use gnome-vfs to retrieve the requested files. Allows services to specify
2000-10-06 Iain Holmes <iain@helixcode.com> * 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
Diffstat (limited to 'executive-summary/test-service')
-rw-r--r--executive-summary/test-service/main.c36
1 files changed, 22 insertions, 14 deletions
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 <liboaf/liboaf.h>
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<br><center>%d</center><br>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 ("<b>This is<p>An <i>HTML</i></b><br><h1>Component!!!</h1>");
+ *title = g_strdup ("The Magic Counter");
+ gtk_timeout_add (1000, clicked_cb, component);
+ return g_strdup ("Since you started this service<br><center>0</center><br>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);
}