diff options
-rw-r--r-- | shell/ChangeLog | 14 | ||||
-rw-r--r-- | shell/e-shell-view.c | 37 | ||||
-rw-r--r-- | shell/e-shell.c | 4 | ||||
-rw-r--r-- | shell/e-storage-set-view.c | 7 |
4 files changed, 39 insertions, 23 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index b398182b16..4e5fedf68a 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,19 @@ 2002-07-01 Ettore Perazzoli <ettore@ximian.com> + * 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. + +2002-07-01 Ettore Perazzoli <ettore@ximian.com> + * e-shell.c: New member preparing_to_quit in EShellPrivate. (init): Initialize to FALSE. (e_shell_prepare_for_quit): Set preparing_to_quit to TRUE on 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); } diff --git a/shell/e-shell.c b/shell/e-shell.c index 382af66bb8..38e83234c0 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -2200,10 +2200,8 @@ e_shell_prepare_for_quit (EShell *shell) /* Make all the views insensitive so we have some modal-like behavior. */ - for (p = priv->views; p != NULL; p = p->next) { - g_print ("Insensitive %p\n", p->data); + for (p = priv->views; p != NULL; p = p->next) gtk_widget_set_sensitive (GTK_WIDGET (p->data), FALSE); - } component_ids = e_component_registry_get_id_list (priv->component_registry); diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c index a856ce5c93..05ac236412 100644 --- a/shell/e-storage-set-view.c +++ b/shell/e-storage-set-view.c @@ -576,19 +576,12 @@ popup_folder_menu (EStorageSetView *storage_set_view, priv = storage_set_view->priv; folder = e_storage_set_get_folder (priv->storage_set, priv->right_click_row_path); - if (folder == NULL) { - /* Uh!? */ - return; - } folder_type_registry = e_storage_set_get_folder_type_registry (priv->storage_set); g_assert (folder_type_registry != NULL); handler = e_folder_type_registry_get_handler_for_type (folder_type_registry, e_folder_get_type_string (folder)); - if (handler == NULL) - return; - menu = gtk_menu_new (); bonobo_window_add_popup (bonobo_ui_container_get_win (priv->container), GTK_MENU (menu), "/popups/FolderPopup"); |