aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-view.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-view.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-view.c')
-rw-r--r--shell/e-shell-view.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 696c4e5643..00087db30d 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -1213,7 +1213,7 @@ e_shell_view_construct (EShellView *shell_view,
GTK_OBJECT (view));
e_shell_user_creatable_items_handler_setup_menus (e_shell_get_user_creatable_items_handler (priv->shell),
- priv->ui_component);
+ shell_view);
return view;
}
@@ -1648,7 +1648,8 @@ get_type_for_folder (EShellView *shell_view,
if (!folder)
return NULL;
- *physical_uri_return = e_folder_get_physical_uri (folder);
+ if (physical_uri_return != NULL)
+ *physical_uri_return = e_folder_get_physical_uri (folder);
return e_folder_get_type_string (folder);
}
@@ -2107,6 +2108,40 @@ e_shell_view_get_current_path (EShellView *shell_view)
return current_path;
}
+const char *
+e_shell_view_get_current_physical_uri (EShellView *shell_view)
+{
+ const char *current_path;
+ const char *physical_uri;
+
+ g_return_val_if_fail (shell_view != NULL, NULL);
+ g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
+
+ current_path = e_shell_view_get_current_path (shell_view);
+ if (current_path == NULL)
+ return NULL;
+
+ if (get_type_for_folder (shell_view, current_path, &physical_uri) == NULL)
+ return NULL;
+ else
+ return physical_uri;
+}
+
+const char *
+e_shell_view_get_current_folder_type (EShellView *shell_view)
+{
+ const char *current_path;
+
+ g_return_val_if_fail (shell_view != NULL, NULL);
+ g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
+
+ current_path = e_shell_view_get_current_path (shell_view);
+ if (current_path == NULL)
+ return NULL;
+
+ return get_type_for_folder (shell_view, current_path, NULL);
+}
+
/**
* e_shell_view_save_settings: