aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-user-creatable-items-handler.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-08-10 09:07:46 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-08-10 09:07:46 +0800
commitd471640fe82b68d5430514120dffa69be196f852 (patch)
tree2f6db2e1263b31b7727c941979f21487953e675c /shell/e-shell-user-creatable-items-handler.c
parent518d8af11bdadf0245735ca632e9ec1e0e50a533 (diff)
downloadgsoc2013-evolution-d471640fe82b68d5430514120dffa69be196f852.tar.gz
gsoc2013-evolution-d471640fe82b68d5430514120dffa69be196f852.tar.zst
gsoc2013-evolution-d471640fe82b68d5430514120dffa69be196f852.zip
Updated to display the parent folder's URI and its type as well.
* evolution-test-component.c (user_create_new_item_callback): Updated to display the parent folder's URI and its type as well. * evolution-shell-component.c (impl_userCreateNewItem): Updated to get the @parent_folder_physical_uri and the @parent_folder_type. (class_init): Update the "user_create_new_item" signal to have @parent_folder_physical_uri and @parent_folder_type args. * e-shell-view.c (get_type_for_folder): Don't bork on a NULL @physical_uri_return. (e_shell_view_get_current_physical_uri): New. (e_shell_view_get_current_folder_type): New. * e-shell-user-creatable-items-handler.c (e_shell_user_creatable_items_handler_setup_menus): Replace @ui_component arg with a @shell_view arg. Set it on the UIComponent using gtk_object_set_data(). (verb_fn): Pass the type and physical URI of the current folder; retrieve that from the shell_view got with gtk_object_get_data(). * Evolution-ShellComponent.idl (userCreateNewItem): New args @parent_folder_uri, @parent_folder_type. svn path=/trunk/; revision=11863
Diffstat (limited to 'shell/e-shell-user-creatable-items-handler.c')
-rw-r--r--shell/e-shell-user-creatable-items-handler.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/shell/e-shell-user-creatable-items-handler.c b/shell/e-shell-user-creatable-items-handler.c
index 340f0b50bc..6be8942a5d 100644
--- a/shell/e-shell-user-creatable-items-handler.c
+++ b/shell/e-shell-user-creatable-items-handler.c
@@ -40,6 +40,7 @@ static GtkObjectClass *parent_class = NULL;
#define VERB_PREFIX "ShellUserCreatableItemVerb"
+#define SHELL_VIEW_DATA_KEY "EShellUserCreatableItemsHandler:shell_view"
struct _Component {
EvolutionShellComponentClient *component_client;
@@ -259,6 +260,7 @@ verb_fn (BonoboUIComponent *ui_component,
{
EShellUserCreatableItemsHandler *handler;
EShellUserCreatableItemsHandlerPrivate *priv;
+ EShellView *shell_view;
const Component *component;
int component_number;
const char *p;
@@ -266,6 +268,9 @@ verb_fn (BonoboUIComponent *ui_component,
GSList *component_list_item;
int i;
+ shell_view = gtk_object_get_data (GTK_OBJECT (ui_component), SHELL_VIEW_DATA_KEY);
+ g_assert (E_IS_SHELL_VIEW (shell_view));
+
handler = E_SHELL_USER_CREATABLE_ITEMS_HANDLER (data);
priv = handler->priv;
@@ -289,7 +294,11 @@ verb_fn (BonoboUIComponent *ui_component,
CORBA_exception_init (&ev);
GNOME_Evolution_ShellComponent_userCreateNewItem
- (bonobo_object_corba_objref (BONOBO_OBJECT (component->component_client)), id, &ev);
+ (bonobo_object_corba_objref (BONOBO_OBJECT (component->component_client)),
+ id,
+ e_shell_view_get_current_physical_uri (shell_view),
+ e_shell_view_get_current_folder_type (shell_view),
+ &ev);
if (ev._major != CORBA_NO_EXCEPTION)
g_warning ("Error in userCreateNewItem -- %s", ev._repo_id);
@@ -407,22 +416,28 @@ e_shell_user_creatable_items_handler_add_component (EShellUserCreatableItemsHan
void
e_shell_user_creatable_items_handler_setup_menus (EShellUserCreatableItemsHandler *handler,
- BonoboUIComponent *ui_component)
+ EShellView *shell_view)
{
EShellUserCreatableItemsHandlerPrivate *priv;
+ BonoboUIComponent *ui_component;
g_return_if_fail (handler != NULL);
g_return_if_fail (E_IS_SHELL_USER_CREATABLE_ITEMS_HANDLER (handler));
- g_return_if_fail (ui_component != NULL);
- g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui_component));
+ g_return_if_fail (shell_view != NULL);
+ g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
priv = handler->priv;
if (priv->menu_xml == NULL)
setup_menu_xml (handler);
+ ui_component = e_shell_view_get_bonobo_ui_component (shell_view);
+ g_assert (ui_component);
+
add_verbs_to_ui_component (handler, ui_component);
+ gtk_object_set_data (GTK_OBJECT (ui_component), SHELL_VIEW_DATA_KEY, shell_view); /* Yuck. */
+
bonobo_ui_component_set (ui_component, "/", priv->menu_xml, NULL);
}