aboutsummaryrefslogtreecommitdiffstats
path: root/shell/evolution-test-component.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-03-08 06:23:40 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-03-08 06:23:40 +0800
commit0a7abd8b7fe1e51a1a18b8dfc4c670aae163b0c8 (patch)
treea3ef62262ee8d70c93df905b2ad4ffe0671504ab /shell/evolution-test-component.c
parent4c85b0318ef51e52451657ef0ce6eabc25b08ea8 (diff)
downloadgsoc2013-evolution-0a7abd8b7fe1e51a1a18b8dfc4c670aae163b0c8.tar
gsoc2013-evolution-0a7abd8b7fe1e51a1a18b8dfc4c670aae163b0c8.tar.gz
gsoc2013-evolution-0a7abd8b7fe1e51a1a18b8dfc4c670aae163b0c8.tar.bz2
gsoc2013-evolution-0a7abd8b7fe1e51a1a18b8dfc4c670aae163b0c8.tar.lz
gsoc2013-evolution-0a7abd8b7fe1e51a1a18b8dfc4c670aae163b0c8.tar.xz
gsoc2013-evolution-0a7abd8b7fe1e51a1a18b8dfc4c670aae163b0c8.tar.zst
gsoc2013-evolution-0a7abd8b7fe1e51a1a18b8dfc4c670aae163b0c8.zip
New function to create a test configuration page for the test component.
* evolution-test-component.c (create_configuration_page): New function to create a test configuration page for the test component. (configuration_control_factory_fn): Factory function for the configuration controls. (register_configuration_control_factory): New function to register the factory. (main): Call it. * e-shell-view-menu.c: Add verb "Settings". (command_settings): Implementation for the "Settings" verb. * GNOME_Evolution_TestComponent.oaf: Add a configuration control. * e-shell-settings-dialog.c: New. * e-shell-settings-dialog.h: New. svn path=/trunk/; revision=15977
Diffstat (limited to 'shell/evolution-test-component.c')
-rw-r--r--shell/evolution-test-component.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/shell/evolution-test-component.c b/shell/evolution-test-component.c
index 8cf0856b88..916bf3c8f7 100644
--- a/shell/evolution-test-component.c
+++ b/shell/evolution-test-component.c
@@ -37,17 +37,60 @@
#define COMPONENT_ID "OAFIID:GNOME_Evolution_TestComponent_ShellComponent"
+#define CONFIGURATION_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_TestComponent_ConfigurationControlFactory"
+#define CONFIGURATION_CONTROL_ID "OAFIID:GNOME_Evolution_TestComponent_ConfigurationControl"
+
static const EvolutionShellComponentFolderType folder_types[] = {
{ "test", "/usr/share/pixmaps/gnome-money.png", N_("Test"), N_("Test type"), FALSE, NULL, NULL },
{ NULL }
};
+static BonoboGenericFactory *configuration_control_factory = NULL;
+
static EvolutionShellClient *parent_shell = NULL;
static int timeout_id = 0;
+/* Test the configuration control. */
+
+static BonoboObject *
+create_configuration_page (void)
+{
+ GtkWidget *label;
+
+ label = gtk_label_new ("This is the configuration page for the test component.");
+ gtk_widget_show (label);
+
+ return BONOBO_OBJECT (bonobo_control_new (label));
+}
+
+static BonoboObject *
+configuration_control_factory_fn (BonoboGenericFactory *factory,
+ const char *id,
+ void *closure)
+{
+ if (strcmp (id, CONFIGURATION_CONTROL_ID) == 0) {
+ return create_configuration_page ();
+ } else {
+ g_warning ("Unknown ID in configuration control factory -- %s", id);
+ return NULL;
+ }
+}
+
+static void
+register_configuration_control_factory (void)
+{
+ configuration_control_factory = bonobo_generic_factory_new_multi (CONFIGURATION_CONTROL_FACTORY_ID,
+ configuration_control_factory_fn,
+ NULL);
+
+ if (configuration_control_factory == NULL)
+ g_warning ("Cannot register configuration control factory!");
+}
+
+
/* Test the ::Shortcut interface. */
static void
@@ -344,6 +387,8 @@ main (int argc, char **argv)
if (bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE)
g_error ("Cannot initialize the test component.");
+ register_configuration_control_factory ();
+
register_component ();
bonobo_main ();