From a6e1e46e4a3fe25796bdd7ebcbe5ed26cf7e7721 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Mon, 1 Jul 2002 18:51:08 +0000 Subject: Remove debugging message. * e-shell.c (e_shell_prepare_for_quit): Remove debugging message. * e-shell-view.c (setup_verb_sensitivity_for_folder): Set sensitivity of /commands/AddFolderToShortcutBar, /commands/OpenFolder and /commands/OpenFolderInNewWindow too, depending on whether the node that was right-clicked can be opened as a folder. * e-storage-set-view.c (popup_folder_menu): Pop up the right-click menu even if we are not clicking on a folder with a proper handler. svn path=/trunk/; revision=17337 --- shell/e-shell-view.c | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'shell/e-shell-view.c') diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 07ef3d2aa4..2b706028c1 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -293,31 +293,42 @@ setup_verb_sensitivity_for_folder (EShellView *shell_view, { EShellViewPrivate *priv; BonoboUIComponent *ui_component; + EFolder *folder; const char *prop; priv = shell_view->priv; - /* Adjust sensitivity for menu options depending on whether the folder - selected is a stock folder. */ - - if (path == NULL) { - prop = "0"; - } else { - EFolder *folder; + ui_component = e_shell_view_get_bonobo_ui_component (shell_view); + if (path == NULL) + folder = NULL; + else folder = e_storage_set_get_folder (e_shell_get_storage_set (priv->shell), path); - if (folder != NULL && ! e_folder_get_is_stock (folder)) - prop = "1"; - else - prop = "0"; - } - ui_component = e_shell_view_get_bonobo_ui_component (shell_view); + /* Adjust sensitivity for menu options depending on whether the folder + selected is a stock folder. */ + if (folder != NULL && ! e_folder_get_is_stock (folder)) + prop = "1"; + else + prop = "0"; bonobo_ui_component_set_prop (ui_component, "/commands/MoveFolder", "sensitive", prop, NULL); bonobo_ui_component_set_prop (ui_component, "/commands/CopyFolder", "sensitive", prop, NULL); bonobo_ui_component_set_prop (ui_component, "/commands/DeleteFolder", "sensitive", prop, NULL); bonobo_ui_component_set_prop (ui_component, "/commands/RenameFolder", "sensitive", prop, NULL); + + /* Adjust sensitivity for menu options depending on whether the user + right-clicked a folder whose contents can be viewed. */ + + if (folder != NULL + && e_folder_type_registry_get_handler_for_type (e_shell_get_folder_type_registry (e_shell_view_get_shell (shell_view)), + e_folder_get_type_string (folder)) != NULL) + prop = "1"; + else + prop = "0"; + bonobo_ui_component_set_prop (ui_component, "/commands/ActivateView", "sensitive", prop, NULL); + bonobo_ui_component_set_prop (ui_component, "/commands/OpenFolderInNewWindow", "sensitive", prop, NULL); + bonobo_ui_component_set_prop (ui_component, "/commands/AddFolderToShortcutBar", "sensitive", prop, NULL); } -- cgit