diff options
author | John Sullivan <sullivan@src.gnome.org> | 2000-08-22 21:53:09 +0000 |
---|---|---|
committer | John Sullivan <sullivan@src.gnome.org> | 2000-08-22 21:53:09 +0000 |
commit | c23deec6488db98bb786195881c85bcb9ada841a (patch) | |
tree | a45e952a3775cf558b389afa74cdc32c77bf8c96 /src/nautilus-navigation-window-menus.c | |
parent | 9d34987c72864b32c09358f92dd61d5d87879a16 (diff) | |
download | nautilus-c23deec6488db98bb786195881c85bcb9ada841a.tar.gz |
More work on bug 1653 (new menu layout)
Fixed bug 1995 (No way to enter/leave search mode from keyboard)
Fixed bug 1999 (No way to reload from keyboard)
* libnautilus/nautilus-bonobo-ui.h: Added more placeholders.
* src/file-manager/fm-directory-view.c:
(fm_directory_view_real_merge_menus): Position "Empty Trash"
menu item and separator using placeholder.
* src/file-manager/fm-icon-view.c: (compute_menu_item_info):
Fixed bug where "Restore Icon's Original Size" was using the
wrong plurality.
(insert_bonobo_menu_item): Renamed this from append_ and gave
it a position parameter.
(fm_icon_view_merge_menus): Used placeholders to put the menu
items in the order specified by bug 1653.
* src/nautilus-switchable-navigation-bar.h:
* src/nautilus-switchable-navigation-bar.c:
(nautilus_switchable_navigation_bar_get_mode): New function;
formerly there was a public setter but no public getter.
* src/nautilus-window-menus.c:
(file_menu_close_window_callback): Removed redundant assert.
(file_menu_toggle_find_mode_callback): New function, toggles
whether we're in search mode.
(go_menu_reload_callback): New function, reloads.
(nautilus_window_initialize_menus): Tweaked hint for "Close All Windows",
added Find/Browse menu item; Changed "Up" to "Up a Level" to
match bug 1653; added "Reload" to Go menu.
(nautilus_window_update_find_menu_item): New function, sets the
label of the Find/Browse menu item based on search mode's state.
* src/nautilus-window-private.h: added #define for
NAUTILUS_MENU_PATH_RELOAD_ITEM; added prototype for
nautilus_window_update_find_menu_item.
* src/nautilus-window-toolbars.c: Changed "Search" to "Find"
to match menu item (and Arlo's design).
* src/nautilus-window.h,
* src/nautilus-window.c:
(navigation_bar_mode_changed_callback): Update Find menu item.
(nautilus_window_get_search_mode): New function; formerly there
was a public setter but no public getter.
(nautilus_window_allow_reload): Update menu item sensitivity.
Diffstat (limited to 'src/nautilus-navigation-window-menus.c')
-rw-r--r-- | src/nautilus-navigation-window-menus.c | 82 |
1 files changed, 78 insertions, 4 deletions
diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c index fd2002b2e..13aeb5358 100644 --- a/src/nautilus-navigation-window-menus.c +++ b/src/nautilus-navigation-window-menus.c @@ -63,6 +63,8 @@ #define NAUTILUS_MENU_PATH_NEW_WINDOW_ITEM "/File/New Window" #define NAUTILUS_MENU_PATH_CLOSE_ITEM "/File/Close" #define NAUTILUS_MENU_PATH_CLOSE_ALL_WINDOWS_ITEM "/File/Close All Windows" +#define NAUTILUS_MENU_PATH_SEPARATOR_BEFORE_FIND "/File/Separator before Find" +#define NAUTILUS_MENU_PATH_TOGGLE_FIND_MODE "/File/Toggle Find Mode" #define NAUTILUS_MENU_PATH_UNDO_ITEM "/Edit/Undo" #define NAUTILUS_MENU_PATH_SEPARATOR_AFTER_UNDO "/Edit/Separator after Undo" @@ -156,7 +158,9 @@ bookmark_holder_free (BookmarkHolder *bookmark_holder) */ #define NAUTILUS_MENU_PATH_CUSTOMIZE_ITEM "/Edit/Customize" -#define NAUTILUS_MENU_PATH_CHANGE_APPEARANCE_ITEM "/Edit/Change_Appearance" +#define NAUTILUS_MENU_PATH_CHANGE_APPEARANCE_ITEM "/Edit/Change_Appearance" + +#define NAUTILUS_MENU_PATH_SEPARATOR_BEFORE_RELOAD "/Go/Separator before Reload" #define NAUTILUS_MENU_PATH_USER_LEVEL "/UserLevel" #define NAUTILUS_MENU_PATH_NOVICE_ITEM "/UserLevel/Novice" @@ -195,7 +199,6 @@ file_menu_close_window_callback (BonoboUIHandler *ui_handler, gpointer user_data, const char *path) { - g_assert (NAUTILUS_IS_WINDOW (user_data)); nautilus_window_close (NAUTILUS_WINDOW (user_data)); } @@ -208,6 +211,19 @@ file_menu_close_all_windows_callback (BonoboUIHandler *ui_handler, } static void +file_menu_toggle_find_mode_callback (BonoboUIHandler *ui_handler, + gpointer user_data, + const char *path) +{ + NautilusWindow *window; + + window = NAUTILUS_WINDOW (user_data); + + nautilus_window_set_search_mode + (window, !nautilus_window_get_search_mode (window)); +} + +static void edit_menu_undo_callback (BonoboUIHandler *ui_handler, gpointer user_data, const char *path) @@ -306,6 +322,14 @@ go_menu_home_callback (BonoboUIHandler *ui_handler, } static void +go_menu_reload_callback (BonoboUIHandler *ui_handler, + gpointer user_data, + const char *path) +{ + nautilus_window_reload (NAUTILUS_WINDOW (user_data)); +} + +static void bookmarks_menu_add_bookmark_callback (BonoboUIHandler *ui_handler, gpointer user_data, const char *path) @@ -1082,7 +1106,7 @@ nautilus_window_initialize_menus (NautilusWindow *window) bonobo_ui_handler_menu_new_item (ui_handler, NAUTILUS_MENU_PATH_CLOSE_ALL_WINDOWS_ITEM, _("Close All Windows"), - _("Close all windows"), + _("Close all Nautilus windows"), -1, BONOBO_UI_HANDLER_PIXMAP_NONE, NULL, @@ -1092,7 +1116,24 @@ nautilus_window_initialize_menus (NautilusWindow *window) NULL); append_placeholder (window, NAUTILUS_MENU_PATH_FILE_ITEMS_PLACEHOLDER); + + append_separator (window, NAUTILUS_MENU_PATH_SEPARATOR_BEFORE_FIND); + + bonobo_ui_handler_menu_new_item (ui_handler, + NAUTILUS_MENU_PATH_TOGGLE_FIND_MODE, + "", /* No initial text; set in update_find_menu_item */ + _("Show the searching controls instead of the location"), + -1, + BONOBO_UI_HANDLER_PIXMAP_NONE, + NULL, + 0, + GDK_CONTROL_MASK, + file_menu_toggle_find_mode_callback, + window); + nautilus_window_update_find_menu_item (window); + append_placeholder (window, NAUTILUS_MENU_PATH_GLOBAL_FILE_ITEMS_PLACEHOLDER); + /* Edit menu */ new_top_level_menu (window, NAUTILUS_MENU_PATH_EDIT_MENU, _("_Edit")); @@ -1201,6 +1242,8 @@ nautilus_window_initialize_menus (NautilusWindow *window) change_appearance_callback, NULL); + append_placeholder (window, NAUTILUS_MENU_PATH_GLOBAL_EDIT_ITEMS_PLACEHOLDER); + append_placeholder (window, NAUTILUS_MENU_PATH_EDIT_ITEMS_PLACEHOLDER); /* Go menu */ new_top_level_menu (window, NAUTILUS_MENU_PATH_GO_MENU, _("_Go")); @@ -1231,7 +1274,7 @@ nautilus_window_initialize_menus (NautilusWindow *window) bonobo_ui_handler_menu_new_item (ui_handler, NAUTILUS_MENU_PATH_UP_ITEM, - _("_Up"), + _("_Up a Level"), _("Go to the location that contains this one"), -1, BONOBO_UI_HANDLER_PIXMAP_NONE, @@ -1253,6 +1296,20 @@ nautilus_window_initialize_menus (NautilusWindow *window) go_menu_home_callback, window); + append_separator (window, NAUTILUS_MENU_PATH_SEPARATOR_BEFORE_RELOAD); + + bonobo_ui_handler_menu_new_item (ui_handler, + NAUTILUS_MENU_PATH_RELOAD_ITEM, + _("_Reload"), + _("Display the latest contents of the current location"), + -1, + BONOBO_UI_HANDLER_PIXMAP_NONE, + NULL, + 'R', + GDK_CONTROL_MASK, + go_menu_reload_callback, + window); + append_placeholder (window, NAUTILUS_MENU_PATH_HISTORY_ITEMS_PLACEHOLDER); @@ -1499,6 +1556,23 @@ nautilus_window_remove_go_menu_items (NautilusWindow *window) NAUTILUS_MENU_PATH_HISTORY_ITEMS_PLACEHOLDER); } +void +nautilus_window_update_find_menu_item (NautilusWindow *window) +{ + char *label_string; + + g_return_if_fail (NAUTILUS_IS_WINDOW (window)); + + label_string = g_strdup + (nautilus_window_get_search_mode (window) + ? _("_Browse") + : _("_Find")); + bonobo_ui_handler_menu_set_label (window->ui_handler, + NAUTILUS_MENU_PATH_TOGGLE_FIND_MODE, + label_string); + g_free (label_string); +} + static void append_dynamic_bookmarks (NautilusWindow *window) { |