From ecc57b7556cc3a9ec9137520f981384f26eb6ba7 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Mon, 13 Aug 2001 21:59:50 +0000 Subject: New function, handle "user creatable items". (component_fn): Tell the 2001-08-13 Peter Williams * component-factory.c (user_create_new_item_cb): New function, handle "user creatable items". (component_fn): Tell the shell that we're capable of creating mail messages. svn path=/trunk/; revision=11965 --- mail/component-factory.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mail/component-factory.c') diff --git a/mail/component-factory.c b/mail/component-factory.c index c11706e628..73147a1dab 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -697,6 +697,21 @@ handle_external_uri_cb (EvolutionShellComponent *shell_component, send_to_url (uri); } +static void +user_create_new_item_cb (EvolutionShellComponent *shell_component, + const char *id, + const char *parent_folder_physical_uri, + const char *parent_folder_type, + gpointer data) +{ + if (!strcmp (id, "message")) { + send_to_url (NULL); + return; + } + + g_warning ("Don't know how to create item of type \"%s\"", id); +} + static BonoboObject * component_fn (BonoboGenericFactory *factory, void *closure) { @@ -720,6 +735,8 @@ component_fn (BonoboGenericFactory *factory, void *closure) bonobo_object_add_interface (BONOBO_OBJECT (shell_component), BONOBO_OBJECT (destination_interface)); + evolution_shell_component_add_user_creatable_item (shell_component, "message", _("New Mail Message"), _("New _Mail Message"), 'm'); + gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set", GTK_SIGNAL_FUNC (owner_set_cb), NULL); gtk_signal_connect (GTK_OBJECT (shell_component), "owner_unset", @@ -730,6 +747,8 @@ component_fn (BonoboGenericFactory *factory, void *closure) GTK_SIGNAL_FUNC (owner_unset_cb), NULL); gtk_signal_connect (GTK_OBJECT (shell_component), "handle_external_uri", GTK_SIGNAL_FUNC (handle_external_uri_cb), NULL); + gtk_signal_connect (GTK_OBJECT (shell_component), "user_create_new_item", + GTK_SIGNAL_FUNC (user_create_new_item_cb), NULL); offline_handler = mail_offline_handler_new (); bonobo_object_add_interface (BONOBO_OBJECT (shell_component), BONOBO_OBJECT (offline_handler)); -- cgit v1.2.3