summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Sullivan <sullivan@src.gnome.org>2000-10-10 01:12:04 +0000
committerJohn Sullivan <sullivan@src.gnome.org>2000-10-10 01:12:04 +0000
commit83f25517b663b9f698a277424c346fb1bf765377 (patch)
tree5432181f070de5c74a2b9bb35b6c7a86d625059b /src
parent1660631a73d3d0a12d1fe9980b7fc71478d2eb1a (diff)
downloadnautilus-83f25517b663b9f698a277424c346fb1bf765377.tar.gz
Bunches o' Bonobo conversion & cleanup. Most of this is
about the new "command/widget separation" in Bonobo. Essentially, changes to sensitivity, state, and hiddenness should be made to the command (verb), whereas other changes should be made to the widget. This should fix the "cmd/widget" warnings at launch, and make the tool bar buttons desensitize appropriately again. * components/loser/sidebar/nautilus-sidebar-loser-ui.xml: * components/mozilla/nautilus-mozilla-ui.xml: * components/sample/nautilus-sample-content-view-ui.xml: * src/nautilus-shell-ui.xml: * src/file-manager/nautilus-directory-view-ui.xml: * src/file-manager/nautilus-icon-view-ui.xml: * src/file-manager/nautilus-search-list-view-ui.xml: Filled in the names of all verbs; we don't want to use the default if-verb-name-is-blank-use-item-name feature because it causes vast confusion; also, change _descr to _tip everywhere (updated name from Bonobo); also explicitly defined <cmd>s for the items that have pre-set insensitivity, or that share tips between tool bar buttons and menu items. * libnautilus/nautilus-bonobo-ui.h: Add #defines for command paths as well as menu paths. * src/file-manager/fm-desktop-icon-view.c: (fm_desktop_icon_view_create_background_context_menu_items): Use command paths instead of menu paths. * src/file-manager/fm-directory-view.h: Publicize command paths, not menu paths (for use in context menu index-finding. Some day we will convert the context menus to use Bonobo and then this will get cleaned up further.) * src/file-manager/fm-directory-view.c: Moved menu path #defines inside here. (append_gtk_menu_item), (update_one_menu_item): Take both a menu path and a verb path; use the verb path for sensitivity. (fm_directory_view_insert_context_menu_item): Updated comment. (fm_directory_view_real_create_background_context_menu_items), (create_open_with_gtk_menu), (fm_directory_view_real_create_selection_context_menu_items), (reset_bonobo_trash_delete_menu), (fm_directory_view_real_update_menus): Pass verb paths as well as menu paths. (fm_directory_view_get_context_menu_index): Changed variable names for clarity. * src/file-manager/fm-icon-view.c: New #defines for command paths. (update_one_menu_item): Take both a menu path and a verb path; use the verb path for sensitivity. (fm_icon_view_create_selection_context_menu_items), (fm_icon_view_create_background_context_menu_items), (fm_icon_view_update_menus), (update_layout_menus): Pass both a menu path and a verb path. * src/file-manager/fm-search-list-view.c: #define for COMMAND_REVEAL_IN_NEW_WINDOW (real_create_selection_context_menu_items): Use verb path not menu path for context menu positioning. (update_reveal_item): Use verb path not menu path for sensitivity. * src/nautilus-window-private.h: #defines for command paths. * src/nautilus-window-manage-views.c: (load_content_view): * src/nautilus-window.c: (nautilus_window_allow_back), (nautilus_window_allow_forward), (nautilus_window_allow_up), (nautilus_window_allow_stop), (nautilus_window_zoom_level_changed_callback): Use verb paths instead of menu paths for changing sensitivity.
Diffstat (limited to 'src')
-rw-r--r--src/file-manager/fm-desktop-icon-view.c4
-rw-r--r--src/file-manager/fm-directory-view.c93
-rw-r--r--src/file-manager/fm-directory-view.h33
-rw-r--r--src/file-manager/fm-icon-view.c34
-rw-r--r--src/file-manager/fm-search-list-view.c8
-rw-r--r--src/file-manager/nautilus-directory-view-ui.xml50
-rw-r--r--src/file-manager/nautilus-icon-view-ui.xml43
-rw-r--r--src/file-manager/nautilus-search-list-view-ui.xml8
-rw-r--r--src/nautilus-navigation-window.c16
-rw-r--r--src/nautilus-object-window.c16
-rw-r--r--src/nautilus-shell-ui.xml130
-rw-r--r--src/nautilus-spatial-window.c16
-rw-r--r--src/nautilus-window-manage-views.c13
-rw-r--r--src/nautilus-window-private.h10
-rw-r--r--src/nautilus-window.c16
15 files changed, 282 insertions, 208 deletions
diff --git a/src/file-manager/fm-desktop-icon-view.c b/src/file-manager/fm-desktop-icon-view.c
index 4ef284a9a..c98171f87 100644
--- a/src/file-manager/fm-desktop-icon-view.c
+++ b/src/file-manager/fm-desktop-icon-view.c
@@ -446,7 +446,7 @@ fm_desktop_icon_view_create_background_context_menu_items (FMDirectoryView *view
(view, menu));
position = fm_directory_view_get_context_menu_index
- (menu, FM_DIRECTORY_VIEW_MENU_PATH_NEW_FOLDER) + 1;
+ (menu, FM_DIRECTORY_VIEW_COMMAND_NEW_FOLDER) + 1;
fm_directory_view_insert_context_menu_item
(view, menu,
_("New Terminal"),
@@ -511,7 +511,7 @@ fm_desktop_icon_view_create_background_context_menu_items (FMDirectoryView *view
}
position = fm_directory_view_get_context_menu_index
- (menu, FM_DIRECTORY_VIEW_MENU_PATH_RESET_BACKGROUND);
+ (menu, FM_DIRECTORY_VIEW_COMMAND_RESET_BACKGROUND);
/* Hide the old Reset Background item so we can replace it with one of our own */
nautilus_gtk_menu_set_item_visibility (menu, position, FALSE);
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 77b3cb6fd..7216f521f 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -74,6 +74,24 @@
#define DISPLAY_TIMEOUT_INTERVAL_MSECS 500
#define SILENT_WINDOW_OPEN_LIMIT 10
+/* Paths to use when referring to bonobo menu items. */
+#define FM_DIRECTORY_VIEW_MENU_PATH_OPEN "/menu/File/Open Placeholder/Open"
+#define FM_DIRECTORY_VIEW_MENU_PATH_OPEN_IN_NEW_WINDOW "/menu/File/Open Placeholder/OpenNew"
+#define FM_DIRECTORY_VIEW_MENU_PATH_OPEN_WITH "/menu/File/Open Placeholder/Open With"
+#define FM_DIRECTORY_VIEW_MENU_PATH_NEW_FOLDER "/menu/File/New Items Placeholder/New Folder"
+#define FM_DIRECTORY_VIEW_MENU_PATH_DELETE "/menu/File/File Items Placeholder/Delete"
+#define FM_DIRECTORY_VIEW_MENU_PATH_TRASH "/menu/File/File Items Placeholder/Trash"
+#define FM_DIRECTORY_VIEW_MENU_PATH_EMPTY_TRASH "/menu/File/Global File Items Placeholder/Empty Trash"
+#define FM_DIRECTORY_VIEW_MENU_PATH_DUPLICATE "/menu/File/File Items Placeholder/Duplicate"
+#define FM_DIRECTORY_VIEW_MENU_PATH_CREATE_LINK "/menu/File/File Items Placeholder/Create Link"
+#define FM_DIRECTORY_VIEW_MENU_PATH_SHOW_PROPERTIES "/menu/File/File Items Placeholder/Show Properties"
+#define FM_DIRECTORY_VIEW_MENU_PATH_RESET_BACKGROUND "/menu/Edit/Global Edit Items Placeholder/Reset Background"
+#define FM_DIRECTORY_VIEW_MENU_PATH_REMOVE_CUSTOM_ICONS "/menu/Edit/Edit Items Placeholder/Remove Custom Icons"
+#define FM_DIRECTORY_VIEW_MENU_PATH_APPLICATIONS_PLACEHOLDER "/menu/File/Open Placeholder/Open With/Applications Placeholder"
+#define FM_DIRECTORY_VIEW_MENU_PATH_OTHER_APPLICATION "/menu/File/Open Placeholder/Open With/OtherApplication"
+#define FM_DIRECTORY_VIEW_MENU_PATH_VIEWERS_PLACEHOLDER "/menu/File/Open Placeholder/Open With/Viewers Placeholder"
+#define FM_DIRECTORY_VIEW_MENU_PATH_OTHER_VIEWER "/menu/File/Open Placeholder/Open With/OtherViewer"
+
enum {
ADD_FILE,
CREATE_BACKGROUND_CONTEXT_MENU_ITEMS,
@@ -2654,18 +2672,19 @@ static void
append_gtk_menu_item (FMDirectoryView *view,
GtkMenu *menu,
GList *files,
- const char *path,
+ const char *menu_path,
+ const char *verb_path,
GtkSignalFunc callback)
{
GtkWidget *menu_item;
char *label_string;
gboolean sensitive;
- compute_menu_item_info (view, path, files, FALSE, &label_string, &sensitive);
+ compute_menu_item_info (view, menu_path, files, FALSE, &label_string, &sensitive);
menu_item = gtk_menu_item_new_with_label (label_string);
g_free (label_string);
- set_menu_item_path (GTK_MENU_ITEM (menu_item), path);
+ set_menu_item_path (GTK_MENU_ITEM (menu_item), verb_path);
gtk_signal_connect (GTK_OBJECT (menu_item),
"activate",
@@ -2735,7 +2754,7 @@ fm_directory_view_insert_context_menu_item (FMDirectoryView *view,
accel_key, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
}
- /* Store menu path in item, so we can find this item by path later */
+ /* Store command path in item, so we can find this item by command path later */
set_menu_item_path (GTK_MENU_ITEM (menu_item), identifier);
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
@@ -2788,7 +2807,7 @@ fm_directory_view_real_create_background_context_menu_items (FMDirectoryView *vi
fm_directory_view_append_context_menu_item
(view, menu,
_("_New Folder"),
- FM_DIRECTORY_VIEW_MENU_PATH_NEW_FOLDER,
+ FM_DIRECTORY_VIEW_COMMAND_NEW_FOLDER,
GTK_SIGNAL_FUNC (new_folder_callback),
fm_directory_view_supports_creating_files (view));
@@ -2802,6 +2821,7 @@ fm_directory_view_real_create_background_context_menu_items (FMDirectoryView *vi
menu,
NULL,
FM_DIRECTORY_VIEW_MENU_PATH_RESET_BACKGROUND,
+ FM_DIRECTORY_VIEW_COMMAND_RESET_BACKGROUND,
reset_background_callback);
}
@@ -2926,6 +2946,7 @@ create_open_with_gtk_menu (FMDirectoryView *view, GList *files)
open_with_menu,
files,
FM_DIRECTORY_VIEW_MENU_PATH_OTHER_APPLICATION,
+ FM_DIRECTORY_VIEW_COMMAND_OTHER_APPLICATION,
other_application_callback);
nautilus_gtk_menu_append_separator (open_with_menu);
@@ -2944,6 +2965,7 @@ create_open_with_gtk_menu (FMDirectoryView *view, GList *files)
open_with_menu,
files,
FM_DIRECTORY_VIEW_MENU_PATH_OTHER_VIEWER,
+ FM_DIRECTORY_VIEW_COMMAND_OTHER_VIEWER,
other_viewer_callback);
}
@@ -2962,9 +2984,11 @@ fm_directory_view_real_create_selection_context_menu_items (FMDirectoryView *vie
append_gtk_menu_item (view, menu, files,
FM_DIRECTORY_VIEW_MENU_PATH_OPEN,
+ FM_DIRECTORY_VIEW_COMMAND_OPEN,
open_callback);
append_gtk_menu_item (view, menu, files,
FM_DIRECTORY_VIEW_MENU_PATH_OPEN_IN_NEW_WINDOW,
+ FM_DIRECTORY_VIEW_COMMAND_OPEN_IN_NEW_WINDOW,
open_in_new_window_callback);
append_selection_menu_subtree (view, menu,
create_open_with_gtk_menu (view, files), files,
@@ -2976,22 +3000,27 @@ fm_directory_view_real_create_selection_context_menu_items (FMDirectoryView *vie
if (!link_in_selection) {
append_gtk_menu_item (view, menu, files,
FM_DIRECTORY_VIEW_MENU_PATH_TRASH,
+ FM_DIRECTORY_VIEW_COMMAND_TRASH,
trash_callback);
}
if (!link_in_selection) {
append_gtk_menu_item (view, menu, files,
FM_DIRECTORY_VIEW_MENU_PATH_DUPLICATE,
+ FM_DIRECTORY_VIEW_COMMAND_DUPLICATE,
duplicate_callback);
append_gtk_menu_item (view, menu, files,
FM_DIRECTORY_VIEW_MENU_PATH_CREATE_LINK,
+ FM_DIRECTORY_VIEW_COMMAND_CREATE_LINK,
create_link_callback);
}
append_gtk_menu_item (view, menu, files,
FM_DIRECTORY_VIEW_MENU_PATH_SHOW_PROPERTIES,
+ FM_DIRECTORY_VIEW_COMMAND_SHOW_PROPERTIES,
open_properties_window_callback);
append_gtk_menu_item (view, menu, files,
FM_DIRECTORY_VIEW_MENU_PATH_REMOVE_CUSTOM_ICONS,
+ FM_DIRECTORY_VIEW_COMMAND_REMOVE_CUSTOM_ICONS,
remove_custom_icons_callback);
}
@@ -3001,7 +3030,6 @@ bonobo_launch_application_callback (BonoboUIComponent *component, gpointer callb
ApplicationLaunchParameters *launch_parameters;
launch_parameters = (ApplicationLaunchParameters *) callback_data;
-
fm_directory_view_launch_application
(launch_parameters->application,
launch_parameters->uri,
@@ -3031,7 +3059,7 @@ add_open_with_app_bonobo_menu_item (BonoboUIComponent *ui,
escaped_label = nautilus_str_double_underscores (label);
- nautilus_bonobo_add_menu_item (ui, FM_DIRECTORY_VIEW_MENU_PATH_OTHER_APPLICATION_PLACEHOLDER,
+ nautilus_bonobo_add_menu_item (ui, FM_DIRECTORY_VIEW_MENU_PATH_APPLICATIONS_PLACEHOLDER,
label, escaped_label);
verb_name = g_strdup_printf ("verb:%s", label);
@@ -3052,7 +3080,7 @@ add_open_with_viewer_bonobo_menu_item (BonoboUIComponent *ui,
escaped_label = nautilus_str_double_underscores (label);
- nautilus_bonobo_add_menu_item (ui, FM_DIRECTORY_VIEW_MENU_PATH_OTHER_VIEWER_PLACEHOLDER,
+ nautilus_bonobo_add_menu_item (ui, FM_DIRECTORY_VIEW_MENU_PATH_VIEWERS_PLACEHOLDER,
escaped_label, escaped_label);
verb_name = g_strdup_printf ("verb:%s", label);
@@ -3107,13 +3135,15 @@ add_component_to_bonobo_menu (FMDirectoryView *directory_view,
static void
update_one_menu_item (FMDirectoryView *view,
GList *selection,
- const char *menu_path)
+ const char *menu_path,
+ const char *verb_path)
{
char *label_string;
gboolean sensitive;
compute_menu_item_info (view, menu_path, selection, TRUE, &label_string, &sensitive);
- nautilus_bonobo_set_sensitive (view->details->ui, menu_path, sensitive);
+ nautilus_bonobo_set_sensitive (view->details->ui, verb_path, sensitive);
+
nautilus_bonobo_set_label (view->details->ui, menu_path, label_string);
g_free (label_string);
}
@@ -3137,7 +3167,9 @@ reset_bonobo_trash_delete_menu (FMDirectoryView *view, GList *selection)
"*Control*t");
}
- update_one_menu_item (view, selection, FM_DIRECTORY_VIEW_MENU_PATH_TRASH);
+ update_one_menu_item (view, selection,
+ FM_DIRECTORY_VIEW_MENU_PATH_TRASH,
+ FM_DIRECTORY_VIEW_COMMAND_TRASH);
}
static void
@@ -3150,8 +3182,8 @@ reset_bonobo_open_with_menu (FMDirectoryView *view, GList *selection)
/* Clear any previous inserted items in the applications and viewers placeholders */
/* FIXME bugzilla.eazel.com 3568: We are leaking here. We need to remove the verbs also */
- nautilus_bonobo_remove_menu_items (view->details->ui, FM_DIRECTORY_VIEW_MENU_PATH_OTHER_APPLICATION_PLACEHOLDER);
- nautilus_bonobo_remove_menu_items (view->details->ui, FM_DIRECTORY_VIEW_MENU_PATH_OTHER_VIEWER_PLACEHOLDER);
+ nautilus_bonobo_remove_menu_items (view->details->ui, FM_DIRECTORY_VIEW_MENU_PATH_APPLICATIONS_PLACEHOLDER);
+ nautilus_bonobo_remove_menu_items (view->details->ui, FM_DIRECTORY_VIEW_MENU_PATH_VIEWERS_PLACEHOLDER);
/* This menu is only displayed when there's one selected item. */
if (nautilus_g_list_exactly_one_item (selection)) {
@@ -3225,29 +3257,38 @@ fm_directory_view_real_update_menus (FMDirectoryView *view)
selection = fm_directory_view_get_selection (view);
update_one_menu_item (view, selection,
- FM_DIRECTORY_VIEW_MENU_PATH_NEW_FOLDER);
+ FM_DIRECTORY_VIEW_MENU_PATH_NEW_FOLDER,
+ FM_DIRECTORY_VIEW_COMMAND_NEW_FOLDER);
update_one_menu_item (view, selection,
- FM_DIRECTORY_VIEW_MENU_PATH_OPEN);
+ FM_DIRECTORY_VIEW_MENU_PATH_OPEN,
+ FM_DIRECTORY_VIEW_COMMAND_OPEN);
update_one_menu_item (view, selection,
- FM_DIRECTORY_VIEW_MENU_PATH_OPEN_IN_NEW_WINDOW);
+ FM_DIRECTORY_VIEW_MENU_PATH_OPEN_IN_NEW_WINDOW,
+ FM_DIRECTORY_VIEW_COMMAND_OPEN_IN_NEW_WINDOW);
reset_bonobo_open_with_menu (view, selection);
reset_bonobo_trash_delete_menu (view, selection);
update_one_menu_item (view, selection,
- FM_DIRECTORY_VIEW_MENU_PATH_DUPLICATE);
+ FM_DIRECTORY_VIEW_MENU_PATH_DUPLICATE,
+ FM_DIRECTORY_VIEW_COMMAND_DUPLICATE);
update_one_menu_item (view, selection,
- FM_DIRECTORY_VIEW_MENU_PATH_CREATE_LINK);
+ FM_DIRECTORY_VIEW_MENU_PATH_CREATE_LINK,
+ FM_DIRECTORY_VIEW_COMMAND_CREATE_LINK);
update_one_menu_item (view, selection,
- FM_DIRECTORY_VIEW_MENU_PATH_SHOW_PROPERTIES);
+ FM_DIRECTORY_VIEW_MENU_PATH_SHOW_PROPERTIES,
+ FM_DIRECTORY_VIEW_COMMAND_SHOW_PROPERTIES);
update_one_menu_item (view, selection,
- FM_DIRECTORY_VIEW_MENU_PATH_EMPTY_TRASH);
+ FM_DIRECTORY_VIEW_MENU_PATH_EMPTY_TRASH,
+ FM_DIRECTORY_VIEW_COMMAND_EMPTY_TRASH);
update_one_menu_item (view, selection,
- FM_DIRECTORY_VIEW_MENU_PATH_REMOVE_CUSTOM_ICONS);
+ FM_DIRECTORY_VIEW_MENU_PATH_REMOVE_CUSTOM_ICONS,
+ FM_DIRECTORY_VIEW_COMMAND_REMOVE_CUSTOM_ICONS);
update_one_menu_item (view, selection,
- NAUTILUS_MENU_PATH_SELECT_ALL_ITEM);
+ NAUTILUS_MENU_PATH_SELECT_ALL_ITEM,
+ NAUTILUS_COMMAND_SELECT_ALL);
nautilus_file_list_free (selection);
}
@@ -4137,10 +4178,10 @@ menu_item_matches_path (GtkMenuItem *item, const char *path)
* @menu: A GtkMenu, either the item-specific or background context menu
* as passed to _create_selection_context_menu_items or
* _create_background_context_menu_items.
- * @menu_path: Item whose index in @menu should be returned.
+ * @verb_path: command name (e.g. "/commands/Open") whose index in @menu should be returned.
*/
int
-fm_directory_view_get_context_menu_index (GtkMenu *menu, const char *menu_path)
+fm_directory_view_get_context_menu_index (GtkMenu *menu, const char *verb_path)
{
GList *children, *node;
GtkMenuItem *menu_item;
@@ -4148,14 +4189,14 @@ fm_directory_view_get_context_menu_index (GtkMenu *menu, const char *menu_path)
int result;
g_return_val_if_fail (GTK_IS_MENU (menu), -1);
- g_return_val_if_fail (menu_path != NULL, -1);
+ g_return_val_if_fail (verb_path != NULL, -1);
children = gtk_container_children (GTK_CONTAINER (menu));
result = -1;
for (node = children, index = 0; node != NULL; node = node->next, ++index) {
menu_item = GTK_MENU_ITEM (node->data);
- if (menu_item_matches_path (menu_item, menu_path)) {
+ if (menu_item_matches_path (menu_item, verb_path)) {
result = index;
break;
}
diff --git a/src/file-manager/fm-directory-view.h b/src/file-manager/fm-directory-view.h
index aebaae8ea..43760d2d1 100644
--- a/src/file-manager/fm-directory-view.h
+++ b/src/file-manager/fm-directory-view.h
@@ -45,23 +45,20 @@ typedef struct FMDirectoryViewClass FMDirectoryViewClass;
* Note that this may change as we complete the switchover to the
* new Bonobo UI code.
*/
-#define FM_DIRECTORY_VIEW_MENU_PATH_OPEN "/menu/File/Open Placeholder/Open"
-#define FM_DIRECTORY_VIEW_MENU_PATH_OPEN_IN_NEW_WINDOW "/menu/File/Open Placeholder/OpenNew"
-#define FM_DIRECTORY_VIEW_MENU_PATH_OPEN_WITH "/menu/File/Open Placeholder/Open With"
-#define FM_DIRECTORY_VIEW_MENU_PATH_NEW_FOLDER "/menu/File/New Items Placeholder/New Folder"
-#define FM_DIRECTORY_VIEW_MENU_PATH_DELETE "/menu/File/File Items Placeholder/Delete"
-#define FM_DIRECTORY_VIEW_MENU_PATH_TRASH "/menu/File/File Items Placeholder/Trash"
-#define FM_DIRECTORY_VIEW_MENU_PATH_EMPTY_TRASH "/menu/File/Global File Items Placeholder/Empty Trash"
-#define FM_DIRECTORY_VIEW_MENU_PATH_DUPLICATE "/menu/File/File Items Placeholder/Duplicate"
-#define FM_DIRECTORY_VIEW_MENU_PATH_CREATE_LINK "/menu/File/File Items Placeholder/Create Link"
-#define FM_DIRECTORY_VIEW_MENU_PATH_SHOW_PROPERTIES "/menu/File/File Items Placeholder/Show Properties"
-#define FM_DIRECTORY_VIEW_MENU_PATH_RESET_BACKGROUND "/menu/Edit/Global Edit Items Placeholder/Reset Background"
-#define FM_DIRECTORY_VIEW_MENU_PATH_REMOVE_CUSTOM_ICONS "/menu/Edit/Edit Items Placeholder/Remove Custom Icons"
-#define FM_DIRECTORY_VIEW_MENU_PATH_OTHER_APPLICATION "/menu/File/Open Placeholder/Open With/OtherApplication"
-#define FM_DIRECTORY_VIEW_MENU_PATH_OTHER_APPLICATION_PLACEHOLDER "/menu/File/Open Placeholder/Open With/Open With Applications Placeholder"
-#define FM_DIRECTORY_VIEW_MENU_PATH_SEPARATOR_BEFORE_VIEWERS "/menu/File/Open Placeholder/Open With/SeparatorBeforeViewers"
-#define FM_DIRECTORY_VIEW_MENU_PATH_OTHER_VIEWER "/menu/File/Open Placeholder/Open With/OtherViewer"
-#define FM_DIRECTORY_VIEW_MENU_PATH_OTHER_VIEWER_PLACEHOLDER "/menu/File/Open Placeholder/Open With/Open With Viewers Placeholder"
+#define FM_DIRECTORY_VIEW_COMMAND_OPEN "/commands/Open"
+#define FM_DIRECTORY_VIEW_COMMAND_OPEN_IN_NEW_WINDOW "/commands/OpenNew"
+#define FM_DIRECTORY_VIEW_COMMAND_OPEN_WITH "/commands/Open With"
+#define FM_DIRECTORY_VIEW_COMMAND_NEW_FOLDER "/commands/New Folder"
+#define FM_DIRECTORY_VIEW_COMMAND_DELETE "/commands/Delete"
+#define FM_DIRECTORY_VIEW_COMMAND_TRASH "/commands/Trash"
+#define FM_DIRECTORY_VIEW_COMMAND_EMPTY_TRASH "/commands/Empty Trash"
+#define FM_DIRECTORY_VIEW_COMMAND_DUPLICATE "/commands/Duplicate"
+#define FM_DIRECTORY_VIEW_COMMAND_CREATE_LINK "/commands/Create Link"
+#define FM_DIRECTORY_VIEW_COMMAND_SHOW_PROPERTIES "/commands/Show Properties"
+#define FM_DIRECTORY_VIEW_COMMAND_RESET_BACKGROUND "/commands/Reset Background"
+#define FM_DIRECTORY_VIEW_COMMAND_REMOVE_CUSTOM_ICONS "/commands/Remove Custom Icons"
+#define FM_DIRECTORY_VIEW_COMMAND_OTHER_APPLICATION "/commands/OtherApplication"
+#define FM_DIRECTORY_VIEW_COMMAND_OTHER_VIEWER "/commands/OtherViewer"
#define FM_TYPE_DIRECTORY_VIEW (fm_directory_view_get_type ())
@@ -321,7 +318,7 @@ void fm_directory_view_move_copy_items (const GList
int y,
FMDirectoryView *view);
gint fm_directory_view_get_context_menu_index (GtkMenu *menu,
- const char *menu_name);
+ const char *verb_path);
gboolean fm_directory_link_type_in_selection (FMDirectoryView *view,
NautilusLinkType link_type);
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c
index 2c41f69c3..c311f4abe 100644
--- a/src/file-manager/fm-icon-view.c
+++ b/src/file-manager/fm-icon-view.c
@@ -78,6 +78,15 @@
#define MENU_PATH_SORT_REVERSED "/menu/View/View Items Placeholder/Lay Out/Reversed Order"
#define MENU_PATH_CLEAN_UP "/menu/View/View Items Placeholder/Clean Up"
+#define COMMAND_RENAME "/commands/Rename"
+#define COMMAND_STRETCH_ICON "/commands/Stretch"
+#define COMMAND_UNSTRETCH_ICONS "/commands/Unstretch"
+#define COMMAND_MANUAL_LAYOUT "/commands/Manual Layout"
+#define COMMAND_TIGHTER_LAYOUT "/commands/Tighter Layout"
+#define COMMAND_SORT_REVERSED "/commands/Reversed Order"
+#define COMMAND_CLEAN_UP "/commands/Clean Up"
+
+
/* forward declarations */
static void create_icon_container (FMIconView *icon_view);
static void fm_icon_view_initialize (FMIconView *icon_view);
@@ -659,7 +668,7 @@ fm_icon_view_create_selection_context_menu_items (FMDirectoryView *view,
*/
if (!special_link_in_selection (view)) {
position = fm_directory_view_get_context_menu_index
- (menu, FM_DIRECTORY_VIEW_MENU_PATH_DUPLICATE) + 1;
+ (menu, FM_DIRECTORY_VIEW_COMMAND_DUPLICATE) + 1;
insert_one_context_menu_item
(FM_ICON_VIEW (view), menu, selection,
MENU_PATH_RENAME, position,
@@ -700,7 +709,7 @@ fm_icon_view_create_background_context_menu_items (FMDirectoryView *view,
(view, menu));
position = fm_directory_view_get_context_menu_index
- (menu, FM_DIRECTORY_VIEW_MENU_PATH_NEW_FOLDER) + 1;
+ (menu, FM_DIRECTORY_VIEW_COMMAND_NEW_FOLDER) + 1;
nautilus_gtk_menu_insert_separator (menu, position++);
@@ -866,18 +875,18 @@ update_layout_menus (FMIconView *view)
/* Sort order isn't relevant for manual layout. */
nautilus_bonobo_set_sensitive
- (view->details->ui, MENU_PATH_SORT_REVERSED, is_auto_layout);
+ (view->details->ui, COMMAND_SORT_REVERSED, is_auto_layout);
/* Tighter Layout is only relevant for auto layout */
nautilus_bonobo_set_sensitive
- (view->details->ui, MENU_PATH_TIGHTER_LAYOUT, is_auto_layout);
+ (view->details->ui, COMMAND_TIGHTER_LAYOUT, is_auto_layout);
view->details->updating_toggle_menu_item = FALSE;
}
/* Clean Up is only relevant for manual layout */
nautilus_bonobo_set_sensitive
- (view->details->ui, MENU_PATH_CLEAN_UP, !is_auto_layout);
+ (view->details->ui, COMMAND_CLEAN_UP, !is_auto_layout);
}
@@ -1612,13 +1621,15 @@ fm_icon_view_merge_menus (FMDirectoryView *view)
static void
update_one_menu_item (FMIconView *view,
GList *selection,
- const char *menu_path)
+ const char *menu_path,
+ const char *verb_path)
{
char *label;
gboolean sensitive;
compute_menu_item_info (view, selection, menu_path, TRUE, &label, &sensitive, NULL);
- nautilus_bonobo_set_sensitive (view->details->ui, menu_path, sensitive);
+
+ nautilus_bonobo_set_sensitive (view->details->ui, verb_path, sensitive);
nautilus_bonobo_set_label (view->details->ui, menu_path, label);
g_free (label);
}
@@ -1633,11 +1644,14 @@ fm_icon_view_update_menus (FMDirectoryView *view)
selection = fm_directory_view_get_selection (view);
update_one_menu_item (FM_ICON_VIEW (view), selection,
- MENU_PATH_STRETCH_ICON);
+ MENU_PATH_STRETCH_ICON,
+ COMMAND_STRETCH_ICON);
update_one_menu_item (FM_ICON_VIEW (view), selection,
- MENU_PATH_UNSTRETCH_ICONS);
+ MENU_PATH_UNSTRETCH_ICONS,
+ COMMAND_UNSTRETCH_ICONS);
update_one_menu_item (FM_ICON_VIEW (view), selection,
- MENU_PATH_RENAME);
+ MENU_PATH_RENAME,
+ COMMAND_RENAME);
nautilus_file_list_free (selection);
}
diff --git a/src/file-manager/fm-search-list-view.c b/src/file-manager/fm-search-list-view.c
index 274f754ab..bf5af22fc 100644
--- a/src/file-manager/fm-search-list-view.c
+++ b/src/file-manager/fm-search-list-view.c
@@ -54,6 +54,8 @@
#define MENU_PATH_INDEXING_INFO "/menu/File/General Status Placeholder/Indexing Info"
#define MENU_PATH_REVEAL_IN_NEW_WINDOW "/menu/File/Open Placeholder/Reveal"
+#define COMMAND_REVEAL_IN_NEW_WINDOW "/command/Reveal"
+
struct FMSearchListViewDetails {
BonoboUIComponent *ui;
};
@@ -397,7 +399,7 @@ real_create_selection_context_menu_items (FMDirectoryView *view,
* existing Open With item.
*/
position = fm_directory_view_get_context_menu_index
- (menu, FM_DIRECTORY_VIEW_MENU_PATH_OPEN_WITH) + 1;
+ (menu, FM_DIRECTORY_VIEW_COMMAND_OPEN_WITH) + 1;
compute_reveal_item_name_and_sensitivity (selection, FALSE, &name, &sensitive);
menu_item = gtk_menu_item_new_with_label (name);
g_free (name);
@@ -467,9 +469,11 @@ update_reveal_item (FMSearchListView *view)
compute_reveal_item_name_and_sensitivity
(selected_files, TRUE, &name, &sensitive);
+
nautilus_bonobo_set_sensitive (view->details->ui,
- MENU_PATH_REVEAL_IN_NEW_WINDOW,
+ COMMAND_REVEAL_IN_NEW_WINDOW,
sensitive);
+
nautilus_bonobo_set_label (view->details->ui, MENU_PATH_REVEAL_IN_NEW_WINDOW, name);
g_free (name);
diff --git a/src/file-manager/nautilus-directory-view-ui.xml b/src/file-manager/nautilus-directory-view-ui.xml
index b4c39cbc1..2a6df7fdd 100644
--- a/src/file-manager/nautilus-directory-view-ui.xml
+++ b/src/file-manager/nautilus-directory-view-ui.xml
@@ -6,76 +6,76 @@
<menuitem name="New Folder"
_label="New Folder"
accel="*Control*n"
- verb=""/>
+ verb="New Folder"/>
</placeholder>
<placeholder name="Open Placeholder">
<menuitem name="Open"
_label="_Open"
- _descr="Open the selected item in this window"
+ _tip="Open the selected item in this window"
accel="*Control*o"
- verb=""/>
+ verb="Open"/>
<menuitem name="OpenNew"
_label="_Open in New Window"
- _descr="Open each selected item in a new window"
- verb=""/>
+ _tip="Open each selected item in a new window"
+ verb="OpenNew"/>
<submenu name="Open With" _label="Open With">
- <placeholder name="Open With Applications Placeholder"/>
+ <placeholder name="Applications Placeholder"/>
<menuitem name="OtherApplication"
_label="Other _Application..."
- _descr="Choose another application with which to open the selected item"
- verb=""/>
+ _tip="Choose another application with which to open the selected item"
+ verb="OtherApplication"/>
<menuitem/>
- <placeholder name="Open With Viewers Placeholder"/>
+ <placeholder name="Viewers Placeholder"/>
<menuitem name="OtherViewer"
_label="Other _Viewer..."
- _descr="Choose another viewer with which to view the selected item"
- verb=""/>
+ _tip="Choose another viewer with which to view the selected item"
+ verb="OtherViewer"/>
</submenu>
</placeholder>
<placeholder name="File Items Placeholder">
<menuitem name="Show Properties"
_label="Show _Properties"
- _descr="View or modify the properties of each selected item"
+ _tip="View or modify the properties of each selected item"
accel="*Control*i"
- verb=""/>
+ verb="Show Properties"/>
<menuitem name="Trash"
_label="Move to _Trash"
- _descr="Move each selected item to the Trash"
+ _tip="Move each selected item to the Trash"
accel="*Control*t"
- verb=""/>
+ verb="Trash"/>
<menuitem name="Duplicate"
_label="_Duplicate"
- _descr="Duplicate each selected item"
+ _tip="Duplicate each selected item"
accel="*Control*d"
- verb=""/>
+ verb="Duplicate"/>
<menuitem name="Create Link"
_label="Create _Link"
- _descr="Create a symbolic link for each selected item"
+ _tip="Create a symbolic link for each selected item"
accel="*Control*l"
- verb=""/>
+ verb="Create Link"/>
</placeholder>
<placeholder name="Global File Items Placeholder">
<menuitem name="Empty Trash"
_label="_Empty Trash"
- _descr="Delete all items in the trash"
- verb=""/>
+ _tip="Delete all items in the trash"
+ verb="Empty Trash"/>
</placeholder>
</submenu>
<submenu name="Edit" _label="_Edit">
<menuitem name="Select All"
_label="_Select All Files"
- _descr="Select all items in this window"
+ _tip="Select all items in this window"
accel="*Control*a"
- verb=""/>
+ verb="Select All"/>
<placeholder name="Edit Items Placeholder">
<menuitem name="Remove Custom Icons"
_label="R_emove Custom Images"
- _descr="Remove any custom images from selected icons"
- verb=""/>
+ _tip="Remove any custom images from selected icons"
+ verb="Remove Custom Icons"/>
</placeholder>
</submenu>
diff --git a/src/file-manager/nautilus-icon-view-ui.xml b/src/file-manager/nautilus-icon-view-ui.xml
index 1f6502dc4..d211b3833 100644
--- a/src/file-manager/nautilus-icon-view-ui.xml
+++ b/src/file-manager/nautilus-icon-view-ui.xml
@@ -4,8 +4,8 @@
<placeholder name="File Items Placeholder">
<menuitem name="Rename"
_label="_Rename"
- _descr="Rename selected icon"
- verb=""/>
+ _tip="Rename selected icon"
+ verb="Rename"/>
</placeholder>
</submenu>
@@ -13,19 +13,19 @@
<placeholder name="Global Edit Items Placeholder">
<menuitem name="Icon Text"
_label="_Icon Captions..."
- _descr="Choose which information appears beneath each icon's name"
- verb=""/>
+ _tip="Choose which information appears beneath each icon's name"
+ verb="Icon Text"/>
</placeholder>
<placeholder name="Edit Items Placeholder">
<menuitem name="Stretch"
_label="_Stretch Icon"
- _descr="Make the selected icon stretchable"
- verb=""/>
+ _tip="Make the selected icon stretchable"
+ verb="Stretch"/>
<menuitem name="Unstretch"
_label="_Restore Icons' Original Sizes"
- _descr="Restore each selected icon to its original size"
- verb=""/>
+ _tip="Restore each selected icon to its original size"
+ verb="Unstretch"/>
</placeholder>
</submenu>
@@ -35,43 +35,44 @@
<submenu name="Lay Out" _label="_Lay out items">
<menuitem name="Manual Layout"
_label="_manually"
- _descr="Leave icons wherever they are dropped"
+ _tip="Leave icons wherever they are dropped"
type="radio" group="layout group"/>
- <placeholder name="Auto Layout" delimit="both">
+ <placeholder name="Auto Layout" delimit="top">
<menuitem name="Sort by Name"
_label="by _Name"
- _descr="Keep icons sorted by name in rows"
+ _tip="Keep icons sorted by name in rows"
type="radio" group="layout group"/>
<menuitem name="Sort by Size"
_label="by _Size"
- _descr="Keep icons sorted by size in rows"
+ _tip="Keep icons sorted by size in rows"
type="radio" group="layout group"/>
<menuitem name="Sort by Type"
_label="by _Type"
- _descr="Keep icons sorted by type in rows"
+ _tip="Keep icons sorted by type in rows"
type="radio" group="layout group"/>
<menuitem name="Sort by Modification Date"
_label="by Modification _Date"
- _descr="Keep icons sorted by modification date in rows"
+ _tip="Keep icons sorted by modification date in rows"
type="radio" group="layout group"/>
<menuitem name="Sort by Emblems"
_label="by _Emblems"
- _descr="Keep icons sorted by emblems in rows"
+ _tip="Keep icons sorted by emblems in rows"
type="radio" group="layout group"/>
</placeholder>
+ <separator/>
<menuitem name="Tighter Layout"
_label="_Tighter Layout"
- _descr="Toggle using a tighter layout scheme"
- verb=""/>
+ _tip="Toggle using a tighter layout scheme"
+ verb="Tighter Layout"/>
<menuitem name="Reversed Order"
_label="Re_versed Order"
- _descr="Display icons in the opposite order"
- verb=""/>
+ _tip="Display icons in the opposite order"
+ verb="Reversed Order"/>
</submenu>
<menuitem name="Clean Up"
_label="_Clean Up by Name"
- _descr="Reposition icons to better fit in the window and avoid overlapping"
- verb=""/>
+ _tip="Reposition icons to better fit in the window and avoid overlapping"
+ verb="Clean Up"/>
</placeholder>
</submenu>
diff --git a/src/file-manager/nautilus-search-list-view-ui.xml b/src/file-manager/nautilus-search-list-view-ui.xml
index abb4b5362..f4ecc4fc9 100644
--- a/src/file-manager/nautilus-search-list-view-ui.xml
+++ b/src/file-manager/nautilus-search-list-view-ui.xml
@@ -4,14 +4,14 @@
<placeholder name="Open Placeholder">
<menuitem name="Reveal"
_label="_Reveal in New Window"
- _descr="Reveal each selected item in its original folder"
- verb=""/>
+ _tip="Reveal each selected item in its original folder"
+ verb="Reveal"/>
</placeholder>
<placeholder name="General Status Placeholder">
<menuitem name="Indexing Info"
_label="Show _Indexing Status"
- _descr="Show status of indexing used by searching"
- verb=""/>
+ _tip="Show status of indexing used by searching"
+ verb="Indexing Info"/>
</placeholder>
</submenu>
</menu>
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index 92ac22769..c5de84a05 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -1154,7 +1154,7 @@ nautilus_window_allow_back (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/Go/Back", allow);
+ NAUTILUS_COMMAND_BACK, allow);
}
void
@@ -1164,7 +1164,7 @@ nautilus_window_allow_forward (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/Go/Forward", allow);
+ NAUTILUS_COMMAND_FORWARD, allow);
}
void
@@ -1174,7 +1174,7 @@ nautilus_window_allow_up (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/Go/Up", allow);
+ NAUTILUS_COMMAND_UP, allow);
}
void
@@ -1184,14 +1184,14 @@ nautilus_window_allow_reload (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/View/Reload", allow);
+ NAUTILUS_COMMAND_RELOAD, allow);
}
void
nautilus_window_allow_stop (NautilusWindow *window, gboolean allow)
{
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/Tool Bar/Stop", allow);
+ NAUTILUS_COMMAND_STOP, allow);
if (window->throbber != NULL) {
if (allow) {
nautilus_throbber_start (NAUTILUS_THROBBER (window->throbber));
@@ -1403,13 +1403,13 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
}
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_IN_ITEM,
+ NAUTILUS_COMMAND_ZOOM_IN,
zoom_level < nautilus_view_frame_get_max_zoom_level (view));
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_OUT_ITEM,
+ NAUTILUS_COMMAND_ZOOM_OUT,
zoom_level > nautilus_view_frame_get_min_zoom_level (view));
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM,
+ NAUTILUS_COMMAND_ZOOM_NORMAL,
TRUE);
/* FIXME bugzilla.eazel.com 3442: Desensitize "Zoom Normal"? */
}
diff --git a/src/nautilus-object-window.c b/src/nautilus-object-window.c
index 92ac22769..c5de84a05 100644
--- a/src/nautilus-object-window.c
+++ b/src/nautilus-object-window.c
@@ -1154,7 +1154,7 @@ nautilus_window_allow_back (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/Go/Back", allow);
+ NAUTILUS_COMMAND_BACK, allow);
}
void
@@ -1164,7 +1164,7 @@ nautilus_window_allow_forward (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/Go/Forward", allow);
+ NAUTILUS_COMMAND_FORWARD, allow);
}
void
@@ -1174,7 +1174,7 @@ nautilus_window_allow_up (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/Go/Up", allow);
+ NAUTILUS_COMMAND_UP, allow);
}
void
@@ -1184,14 +1184,14 @@ nautilus_window_allow_reload (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/View/Reload", allow);
+ NAUTILUS_COMMAND_RELOAD, allow);
}
void
nautilus_window_allow_stop (NautilusWindow *window, gboolean allow)
{
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/Tool Bar/Stop", allow);
+ NAUTILUS_COMMAND_STOP, allow);
if (window->throbber != NULL) {
if (allow) {
nautilus_throbber_start (NAUTILUS_THROBBER (window->throbber));
@@ -1403,13 +1403,13 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
}
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_IN_ITEM,
+ NAUTILUS_COMMAND_ZOOM_IN,
zoom_level < nautilus_view_frame_get_max_zoom_level (view));
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_OUT_ITEM,
+ NAUTILUS_COMMAND_ZOOM_OUT,
zoom_level > nautilus_view_frame_get_min_zoom_level (view));
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM,
+ NAUTILUS_COMMAND_ZOOM_NORMAL,
TRUE);
/* FIXME bugzilla.eazel.com 3442: Desensitize "Zoom Normal"? */
}
diff --git a/src/nautilus-shell-ui.xml b/src/nautilus-shell-ui.xml
index ea2d56616..ea0ee24fe 100644
--- a/src/nautilus-shell-ui.xml
+++ b/src/nautilus-shell-ui.xml
@@ -2,15 +2,38 @@
<!-- A description of each placeholder's purpose is in libnautilus/nautilus-bonobo-ui.h -->
+<commands>
+ <!-- We define commands here for (at least) all the items
+ for which we share tip or sensitivity state between more
+ than one item (usually 1 menuitem and 1 toolitem.
+ -->
+
+ <cmd name="Back" accel="*Control*["
+ _tip="Go to the previous visited location"/>
+ <cmd name="Forward" accel="*Control*]"
+ _tip="Go to the next visited location"/>
+ <cmd name="New Window"
+ _tip="Open another Nautilus window for the displayed location"/>
+ <cmd name="Stop"
+ _tip="Stop loading this location"/>
+ <cmd name="Select All" accel="*Control*a" sensitive="0"/>
+ <cmd name="Up" accel="*Control*U"
+ _tip="Go to the location that contains this one"/>
+ <cmd name="Zoom In" accel="*Control*="
+ _tip="Show the contents in more detail"/>
+ <cmd name="Zoom Out" accel="*Control*-"
+ _tip="Show the contents in less detail"/>
+ <cmd name="Zoom Normal"
+ _tip="Show the contents at the normal size"/>
+</commands>
+
<menu>
<submenu name="File" _label="_File">
<placeholder name="New Items Placeholder">
<menuitem name="New Window"
_label="_New Window"
- _descr="Open another Nautilus window for the displayed location"
- pixtype="stock" pixname="New"
- verb=""/>
+ verb="New Window"/>
</placeholder>
<placeholder name="Open Placeholder" delimit="top"/>
@@ -19,12 +42,12 @@
_descr="Close this window"
pixtype="stock" pixname="Close"
accel="*Control*w"
- verb=""/>
+ verb="Close"/>
<menuitem name="Close All Windows"
_label="Close _All Windows"
_descr="Close all Nautilus windows"
accel="*Control**Shift*w"
- verb=""/>
+ verb="Close All Windows"/>
<placeholder name="General Status Placeholder" delimit="top"/>
<placeholder name="File Items Placeholder" delimit="top"/>
@@ -35,12 +58,12 @@
_label="_Find"
_descr="Search this computer for files"
accel="*Control*f"
- verb=""/>
+ verb="Toggle Find Mode"/>
<menuitem name="Go to Web Search"
_label="_Web Search"
_descr="Search the World Wide Web"
accel="*Control**Shift*f"
- verb=""/>
+ verb="Go to Web Search"/>
<placeholder name="Global File Items Placeholder" delimit="top"/>
</submenu>
@@ -51,7 +74,7 @@
_descr="Undo the last text change"
pixtype="stock" pixname="Undo"
accel="*Control*z"
- verb=""/>
+ verb="Undo"/>
<separator/>
@@ -60,42 +83,40 @@
_descr="Cut the selected text to the clipboard"
pixtype="stock" pixname="Cut"
accel="*Control*x"
- verb=""/>
+ verb="Cut"/>
<menuitem name="Copy"
_label="_Copy Text"
_descr="Copy the selected text to the clipboard"
pixtype="stock" pixname="Copy"
accel="*Control*c"
- verb=""/>
+ verb="Copy"/>
<menuitem name="Paste"
_label="_Paste Text"
_descr="Paste the text stored on the clipboard"
pixtype="stock" pixname="Paste"
accel="*Control*v"
- verb=""/>
+ verb="Paste"/>
<menuitem name="Clear"
_label="C_lear Text"
_descr="Removes the selected text without putting it on the clipboard"
- verb=""/>
+ verb="Clear"/>
<separator/>
<menuitem name="Select All"
_label="_Select All"
- accel="*Control*a"
- verb=""
- sensitive="0"/>
+ verb="Select All"/>
<separator/>
<menuitem name="Customize"
_label="Custo_mization..."
_descr="Display the Property Browser, containing patterns, colors, and emblems"
- verb=""/>
+ verb="Customize"/>
<menuitem name="Change Appearance"
_label="C_hange Appearance..."
_descr="Display the set of available appearance themes"
- verb=""/>
+ verb="Change Appearance"/>
<placeholder name="Global Edit Items Placeholder"/>
<placeholder name="Edit Items Placeholder" delimit="top"/>
@@ -107,74 +128,63 @@
_label="_Refresh"
_descr="Display the latest contents of the current location"
accel="*Control*r"
- verb=""/>
+ verb="Reload"/>
<placeholder name="Show Hide Placeholder" delimit="top">
<menuitem name="Show Hide Sidebar"
_label="Hide Sidebar"
_descr="Change the visibility of this window's sidebar"
- verb=""/>
+ verb="Show Hide Sidebar"/>
<menuitem name="Show Hide Tool Bar"
_label="Hide Tool Bar"
_descr="Change the visibility of this window's tool bar"
- verb=""/>
+ verb="Show Hide Tool Bar"/>
<menuitem name="Show Hide Location Bar"
_label="Hide Location Bar"
_descr="Change the visibility of this window's location bar"
- verb=""/>
+ verb="Show Hide Location Bar"/>
<menuitem name="Show Hide Status Bar"
_label="Hide Status Bar"
_descr="Change the visibility of this window's status bar"
- verb=""/>
+ verb="Show Hide Status Bar"/>
</placeholder>
<placeholder name="View Items Placeholder" delimit="top"/>
<placeholder name="Zoom Items Placeholder" delimit="top">
<menuitem name="Zoom In"
_label="Zoom _In"
- _descr="Show the contents in more detail"
- accel="*Control*="
- verb=""/>
+ verb="Zoom In"/>
<menuitem name="Zoom Out"
_label="Zoom _Out"
- _descr="Show the contents in less detail"
- accel="*Control*-"
- verb=""/>
+ verb="Zoom Out"/>
<menuitem name="Zoom Normal"
_label="_Normal Size"
- _descr="Show the contents at the normal size"
- verb=""/>
+ verb="Zoom Normal"/>
</placeholder>
</submenu>
<submenu name="Go" _label="_Go">
<menuitem name="Back"
_label="_Back"
- _descr="Go to the previous visited location"
- accel="*Control*["
- verb=""/>
+ verb="Back"/>
<menuitem name="Forward"
_label="_Forward"
- _descr="Go to the next visited location"
- accel="*Control*]"
- verb=""/>
+ verb="Forward"/>
<menuitem name="Up"
_label="_Up a Level"
- _descr="Go to the location that contains this one"
- accel="*Control*u"
- verb=""/>
+ verb="Up"/>
<menuitem name="Home"
_label="_Home"
_descr="Go to the home location"
accel="*Control*h"
- verb=""/>
+ verb="Home"/>
<separator/>
<menuitem name="Forget History"
_label="For_get History"
_descr="Clear contents of Go menu and Back/Forward lists"
- verb=""/>
+ verb="Forget History"/>
<placeholder name="History Placeholder" delimit="top"/>
</submenu>
@@ -184,11 +194,11 @@
_label="_Add Bookmark"
_descr="Add a bookmark for the current location to this menu"
accel="*Control*B"
- verb=""/>
+ verb="Add Bookmark"/>
<menuitem name="Edit Bookmarks"
_label="_Edit Bookmarks..."
_descr="Display a window that allows editing the bookmarks in this menu"
- verb=""/>
+ verb="Edit Bookmarks"/>
<placeholder name="Bookmarks Placeholder" delimit="top"/>
</submenu>
@@ -197,11 +207,11 @@
<menuitem name="About Nautilus"
_label="_About Nautilus..."
_descr="Display credits for the creators of Nautilus"
- verb=""/>
+ verb="Help"/>
<menuitem name="Nautilus Feedback"
_label="_Nautilus Feedback..."
_descr="Show a page from which you can send feedback about Nautilus to its creators"
- verb=""/>
+ verb="Nautilus Feedback"/>
</submenu>
@@ -225,7 +235,7 @@
<menuitem name="User Level Customization"
_label="Edit Settings..."
_descr="Edit settings for the current user level"
- verb=""/>
+ verb="User Level Customization"/>
</submenu>
</menu>
@@ -233,28 +243,25 @@
<toolitem name="Back"
_label="Back"
- _descr="Go to the previous visited location"
min_width="48"
- pixtype="stock" pixname="Back"
- verb=""/>
+ pixtype="stock" pixname="Back"
+ verb="Back"/>
<toolitem name="Forward"
_label="Forward"
- _descr="Go to the next visited location"
min_width="48"
pixtype="stock" pixname="Forward"
- verb=""/>
+ verb="Forward"/>
<toolitem name="Up"
_label="Up"
- _descr="Go to the location that contains this one"
min_width="48"
pixtype="stock" pixname="Up"
- verb=""/>
+ verb="Up"/>
<toolitem name="Reload"
_label="Refresh"
_descr="Display the latest contents of the current location"
min_width="48"
pixtype="stock" pixname="Refresh"
- verb=""/>
+ verb="Reload"/>
<separator/>
@@ -263,28 +270,27 @@
_descr="Go to the home location"
min_width="48"
pixtype="stock" pixname="Home"
- verb=""/>
+ verb="Home"/>
<toolitem name="Toggle Find Mode"
_label="Find"
_descr="Search this computer for files"
min_width="48"
type="toggle"
pixtype="stock" pixname="Search"
- verb=""/>
+ verb="Toggle Find Mode"/>
<toolitem name="Go to Web Search"
_label="Web Search"
_descr="Search the World Wide Web"
pixtype="stock" pixname="Search"
- verb=""/>
+ verb="Go to Web Search"/>
<separator/>
- <toolitem name="Stop"
- _label="Stop"
- _descr="Stop loading this location"
+ <toolitem name="Stop" _label="Stop"
+ verb="Stop"/>
min_width="48"
pixtype="stock" pixname="Stop"
- verb=""/>
+ verb="Stop"/>
<placeholder name="Extra Buttons Placeholder" delimit="top">
<toolitem name="Services"
@@ -292,7 +298,7 @@
_descr="Go to Eazel Services"
min_width="48"
pixtype="stock" pixname="Services"
- verb=""/>
+ verb="Services"/>
</placeholder>
<control name="ThrobberWrapper"/>
diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c
index 92ac22769..c5de84a05 100644
--- a/src/nautilus-spatial-window.c
+++ b/src/nautilus-spatial-window.c
@@ -1154,7 +1154,7 @@ nautilus_window_allow_back (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/Go/Back", allow);
+ NAUTILUS_COMMAND_BACK, allow);
}
void
@@ -1164,7 +1164,7 @@ nautilus_window_allow_forward (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/Go/Forward", allow);
+ NAUTILUS_COMMAND_FORWARD, allow);
}
void
@@ -1174,7 +1174,7 @@ nautilus_window_allow_up (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/Go/Up", allow);
+ NAUTILUS_COMMAND_UP, allow);
}
void
@@ -1184,14 +1184,14 @@ nautilus_window_allow_reload (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/View/Reload", allow);
+ NAUTILUS_COMMAND_RELOAD, allow);
}
void
nautilus_window_allow_stop (NautilusWindow *window, gboolean allow)
{
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/Tool Bar/Stop", allow);
+ NAUTILUS_COMMAND_STOP, allow);
if (window->throbber != NULL) {
if (allow) {
nautilus_throbber_start (NAUTILUS_THROBBER (window->throbber));
@@ -1403,13 +1403,13 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
}
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_IN_ITEM,
+ NAUTILUS_COMMAND_ZOOM_IN,
zoom_level < nautilus_view_frame_get_max_zoom_level (view));
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_OUT_ITEM,
+ NAUTILUS_COMMAND_ZOOM_OUT,
zoom_level > nautilus_view_frame_get_min_zoom_level (view));
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM,
+ NAUTILUS_COMMAND_ZOOM_NORMAL,
TRUE);
/* FIXME bugzilla.eazel.com 3442: Desensitize "Zoom Normal"? */
}
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index 664ef7e1d..1d352362c 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -751,14 +751,15 @@ load_content_view (NautilusWindow *window,
bonobo_ui_component_freeze (window->details->shell_ui, NULL);
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_IN_ITEM,
- FALSE);
+ NAUTILUS_COMMAND_ZOOM_IN,
+ FALSE);
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_OUT_ITEM,
- FALSE);
+ NAUTILUS_COMMAND_ZOOM_OUT,
+ FALSE);
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM,
- FALSE);
+ NAUTILUS_COMMAND_ZOOM_NORMAL,
+ FALSE);
+
bonobo_ui_component_thaw (window->details->shell_ui, NULL);
content_view = window->content_view;
diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h
index 1c01e12d0..9ebe3d489 100644
--- a/src/nautilus-window-private.h
+++ b/src/nautilus-window-private.h
@@ -70,6 +70,16 @@ struct NautilusWindowDetails
#define NAUTILUS_MENU_PATH_ZOOM_OUT_ITEM "/menu/View/Zoom Items Placeholder/Zoom Out"
#define NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM "/menu/View/Zoom Items Placeholder/Zoom Normal"
+#define NAUTILUS_COMMAND_BACK "/commands/Back"
+#define NAUTILUS_COMMAND_FORWARD "/commands/Forward"
+#define NAUTILUS_COMMAND_UP "/commands/Up"
+
+#define NAUTILUS_COMMAND_RELOAD "/commands/Reload"
+#define NAUTILUS_COMMAND_STOP "/commands/Stop"
+#define NAUTILUS_COMMAND_ZOOM_IN "/commands/Zoom In"
+#define NAUTILUS_COMMAND_ZOOM_OUT "/commands/Zoom Out"
+#define NAUTILUS_COMMAND_ZOOM_NORMAL "/commands/Zoom Normal"
+
/* window geometry */
#define NAUTILUS_WINDOW_MIN_WIDTH 450
#define NAUTILUS_WINDOW_MIN_HEIGHT 350
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 92ac22769..c5de84a05 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1154,7 +1154,7 @@ nautilus_window_allow_back (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/Go/Back", allow);
+ NAUTILUS_COMMAND_BACK, allow);
}
void
@@ -1164,7 +1164,7 @@ nautilus_window_allow_forward (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/Go/Forward", allow);
+ NAUTILUS_COMMAND_FORWARD, allow);
}
void
@@ -1174,7 +1174,7 @@ nautilus_window_allow_up (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/Go/Up", allow);
+ NAUTILUS_COMMAND_UP, allow);
}
void
@@ -1184,14 +1184,14 @@ nautilus_window_allow_reload (NautilusWindow *window, gboolean allow)
* control both the menu and toolbar.
*/
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/menu/View/Reload", allow);
+ NAUTILUS_COMMAND_RELOAD, allow);
}
void
nautilus_window_allow_stop (NautilusWindow *window, gboolean allow)
{
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- "/Tool Bar/Stop", allow);
+ NAUTILUS_COMMAND_STOP, allow);
if (window->throbber != NULL) {
if (allow) {
nautilus_throbber_start (NAUTILUS_THROBBER (window->throbber));
@@ -1403,13 +1403,13 @@ nautilus_window_zoom_level_changed_callback (NautilusViewFrame *view,
}
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_IN_ITEM,
+ NAUTILUS_COMMAND_ZOOM_IN,
zoom_level < nautilus_view_frame_get_max_zoom_level (view));
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_OUT_ITEM,
+ NAUTILUS_COMMAND_ZOOM_OUT,
zoom_level > nautilus_view_frame_get_min_zoom_level (view));
nautilus_bonobo_set_sensitive (window->details->shell_ui,
- NAUTILUS_MENU_PATH_ZOOM_NORMAL_ITEM,
+ NAUTILUS_COMMAND_ZOOM_NORMAL,
TRUE);
/* FIXME bugzilla.eazel.com 3442: Desensitize "Zoom Normal"? */
}