aboutsummaryrefslogtreecommitdiffstats
path: root/shell/evolution-test-component.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-08-10 07:37:56 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-08-10 07:37:56 +0800
commit20801a94aaba0002a8adb7df3829494e4164d5bf (patch)
treea13690465e7f5eeb434f4bb1104ec3e9fc1670ae /shell/evolution-test-component.c
parent3c88c8b755113fb61bf153d6070ed92274fb5d02 (diff)
downloadgsoc2013-evolution-20801a94aaba0002a8adb7df3829494e4164d5bf.tar
gsoc2013-evolution-20801a94aaba0002a8adb7df3829494e4164d5bf.tar.gz
gsoc2013-evolution-20801a94aaba0002a8adb7df3829494e4164d5bf.tar.bz2
gsoc2013-evolution-20801a94aaba0002a8adb7df3829494e4164d5bf.tar.lz
gsoc2013-evolution-20801a94aaba0002a8adb7df3829494e4164d5bf.tar.xz
gsoc2013-evolution-20801a94aaba0002a8adb7df3829494e4164d5bf.tar.zst
gsoc2013-evolution-20801a94aaba0002a8adb7df3829494e4164d5bf.zip
Add the menu items using the EShellUserCreatableItemsHandler.
* e-shell-view.c (e_shell_view_construct): Add the menu items using the EShellUserCreatableItemsHandler. * e-shell-user-creatable-items-handler.c: New. * e-shell-user-creatable-items-handler.h: New. * e-shell.c: New member `user_creatable_items_handler' in `EShellPrivate'. (init): Initialize to NULL. (destroy): Unref. (e_shell_construct): Create here. (e_shell_get_user_creatable_items_handler): New accessor. (setup_components): Add the registered components to the user_creatable_items_handler. * evolution-test-component.c (factory_fn): Add a couple sample user-creatable items. (user_create_new_item_callback): New callback for the "user_create_new_item" signal on the EvolutionShellComponent. (factory_fn): Connect. * e-shell.c (e_shell_get_component_registry): New. * evolution-shell-component.c: New enum value `USER_CREATE_NEW_ITEM'. New member `user_create_item_types' in `_EvolutionShellComponentPrivate'. (init): Init to NULL. (impl_destroy): Free it. (user_creatable_item_type_free): New helper function. (user_creatable_item_type_new): New helper function. (impl_userCreateNewItem): New, implementation for ::userCreateNewItem. (class_init): Install the "user_create_new_item" signal and the userCreateNewItem impl. (impl__get_external_uri_schemas): Renamed from `impl_ShellComponent__get_external_uri_schemas'. (impl___get_supported_types): Renamed from `impl_ShellComponent__get_supported_types'. (impl__get_user_creatable_item_types): New, implementation for the `user_creatable_item_types' attribute. (class_init): Install it. (evolution_shell_component_add_user_creatable_item): New. * evolution-shell-component.h: Added signal `user_create_new_item'. * Evolution-ShellComponent.idl: Added typedefs `UserCreatableItemType', `UserCreatableItemTypeList'. New attribute `user_creatable_item_types'. (userCreateNewItem): New. svn path=/trunk/; revision=11849
Diffstat (limited to 'shell/evolution-test-component.c')
-rw-r--r--shell/evolution-test-component.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/shell/evolution-test-component.c b/shell/evolution-test-component.c
index 4d70525c40..336912cb8c 100644
--- a/shell/evolution-test-component.c
+++ b/shell/evolution-test-component.c
@@ -268,6 +268,13 @@ owner_unset_callback (EvolutionShellComponent *shell_component,
g_idle_add_full (G_PRIORITY_LOW, owner_unset_idle_callback, NULL, NULL);
}
+static void
+user_create_new_item_callback (EvolutionShellComponent *shell_component,
+ const char *id)
+{
+ g_print ("\n*** Should create -- %s\n", id);
+}
+
static BonoboObject *
factory_fn (BonoboGenericFactory *factory,
@@ -285,6 +292,12 @@ factory_fn (BonoboGenericFactory *factory,
gtk_signal_connect (GTK_OBJECT (shell_component), "owner_unset",
GTK_SIGNAL_FUNC (owner_unset_callback), NULL);
+ evolution_shell_component_add_user_creatable_item (shell_component, "Stuff", "New Stuff", "New _Stuff", '\0');
+ evolution_shell_component_add_user_creatable_item (shell_component, "MoreStuff", "New More Stuff", "New _More Stuff", 'n');
+
+ gtk_signal_connect (GTK_OBJECT (shell_component), "user_create_new_item",
+ GTK_SIGNAL_FUNC (user_create_new_item_callback), NULL);
+
return BONOBO_OBJECT (shell_component);
}