summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Sullivan <sullivan@src.gnome.org>2000-11-15 22:31:07 +0000
committerJohn Sullivan <sullivan@src.gnome.org>2000-11-15 22:31:07 +0000
commitb1aaa02b863f89f7ffcf4b95080380038a26e72a (patch)
tree8c067efd20b7d368a09cc8a8de5599147fac6db0
parent259c95fa589d3d267c0937afb55cb395979bacf9 (diff)
downloadnautilus-b1aaa02b863f89f7ffcf4b95080380038a26e72a.tar.gz
Fixed a couple of cases where context menus appeared on
the desktop that should have been hidden. This leaves behind a new (Bonobo) bug where there are two adjacent separators in the desktop background context menu, which I will write up. reviewed by: Maciej Stachowiak <mjs@eazel.com> * libnautilus/nautilus-bonobo-ui.h: Add popup zooming commands here that need to be manipulated by directory view. * src/file-manager/fm-directory-view.c: (real_merge_menus): Hide the zooming items in the popup if the directory view does not support zooming (e.g., desktop) * src/file-manager/fm-icon-view.c: (fm_icon_view_merge_menus): Hide the Lay Out submenu in the popup if the icon view does not support auto-layout (e.g., desktop) * src/nautilus-shell-ui.xml: Make zooming items in popup use different commands than zooming items in normal menu, so they can be hidden independently. * src/nautilus-window-menus.c: (nautilus_window_initialize_menus): Attach callbacks to new popup zooming items.
-rw-r--r--ChangeLog29
-rw-r--r--libnautilus/nautilus-bonobo-ui.h5
-rw-r--r--src/file-manager/fm-directory-view.c9
-rw-r--r--src/file-manager/fm-icon-view.c10
-rw-r--r--src/nautilus-navigation-window-menus.c6
-rw-r--r--src/nautilus-shell-ui.xml12
-rw-r--r--src/nautilus-window-menus.c6
7 files changed, 71 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 93e6b0541..1dad1b26e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2000-11-15 John Sullivan <sullivan@eazel.com>
+
+ Fixed a couple of cases where context menus appeared on
+ the desktop that should have been hidden. This leaves
+ behind a new (Bonobo) bug where there are two adjacent
+ separators in the desktop background context menu, which
+ I will write up.
+
+ reviewed by: Maciej Stachowiak <mjs@eazel.com>
+
+ * libnautilus/nautilus-bonobo-ui.h:
+ Add popup zooming commands here that need to be manipulated
+ by directory view.
+ * src/file-manager/fm-directory-view.c: (real_merge_menus):
+ Hide the zooming items in the popup if the directory view
+ does not support zooming (e.g., desktop)
+ * src/file-manager/fm-icon-view.c: (fm_icon_view_merge_menus):
+ Hide the Lay Out submenu in the popup if the icon view
+ does not support auto-layout (e.g., desktop)
+ * src/nautilus-shell-ui.xml: Make zooming items in popup use
+ different commands than zooming items in normal menu, so they
+ can be hidden independently.
+ * src/nautilus-window-menus.c: (nautilus_window_initialize_menus):
+ Attach callbacks to new popup zooming items.
+
2000-11-15 Gene Z. Ragan <gzr@eazel.com>
Fixed bug 4717, Nautilus draw desktop icons overlapping.
@@ -5,8 +30,8 @@
The problem was caused by the icon container responding to
an idle function that lays out icons that had been
newly added. This is a problem if the callback is called
- form an idle after th eicon container has been created, but
- before a size has been allocated. A nely intialized GtkWidget
+ from an idle after the icon container has been created, but
+ before a size has been allocated. A newly intialized GtkWidget
has a default allocation of 0, 0, 1, 1 which is too small
for the layout algorithm to work properly. A flag was added
that is set to TRUE when the size_allocate function is called.
diff --git a/libnautilus/nautilus-bonobo-ui.h b/libnautilus/nautilus-bonobo-ui.h
index 0055c2b10..ec27d17e3 100644
--- a/libnautilus/nautilus-bonobo-ui.h
+++ b/libnautilus/nautilus-bonobo-ui.h
@@ -62,6 +62,10 @@
#define NAUTILUS_COMMAND_CLEAR "/commands/Clear"
#define NAUTILUS_COMMAND_SELECT_ALL "/commands/Select All"
+#define NAUTILUS_COMMAND_ZOOM_IN_FROM_POPUP "/commands/Zoom In Popup"
+#define NAUTILUS_COMMAND_ZOOM_OUT_FROM_POPUP "/commands/Zoom Out Popup"
+#define NAUTILUS_COMMAND_ZOOM_NORMAL_FROM_POPUP "/commands/Zoom Normal Popup"
+
/**
* Components can use these placeholder paths with BonoboUIContainer calls to
* insert new items in well-defined positions.
@@ -115,7 +119,6 @@
/* Use the "extra help items" placeholder to add help-related items */
#define NAUTILUS_MENU_PATH_EXTRA_HELP_ITEMS_PLACEHOLDER "/menu/Help/Extra Help Items"
-
/* Components can use these paths with BonoboUIHandler calls to
* locate toolbars and toolbar items for the purpose of merging.
* Note: Not all Nautilus toolbars or toolbar items are necessarily published
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 6b38d0242..9e7d9d702 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -3538,6 +3538,15 @@ real_merge_menus (FMDirectoryView *view)
schedule_update_menus,
GTK_OBJECT (view));
+ /* Do one-time state changes here; context-dependent ones go in update_menus */
+ if (!fm_directory_view_supports_zooming (view)) {
+ nautilus_bonobo_set_hidden
+ (view->details->ui, NAUTILUS_COMMAND_ZOOM_IN_FROM_POPUP, TRUE);
+ nautilus_bonobo_set_hidden
+ (view->details->ui, NAUTILUS_COMMAND_ZOOM_OUT_FROM_POPUP, TRUE);
+ nautilus_bonobo_set_hidden
+ (view->details->ui, NAUTILUS_COMMAND_ZOOM_NORMAL_FROM_POPUP, TRUE);
+ }
}
static void
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c
index a0f810062..f9f12cf56 100644
--- a/src/file-manager/fm-icon-view.c
+++ b/src/file-manager/fm-icon-view.c
@@ -78,6 +78,8 @@
#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 POPUP_PATH_LAY_OUT "/popups/background/Before Zoom Items/View Items/Lay Out"
+
#define COMMAND_PREFIX "/commands/"
#define COMMAND_RENAME "/commands/Rename"
#define COMMAND_STRETCH_ICON "/commands/Stretch"
@@ -1540,6 +1542,14 @@ fm_icon_view_merge_menus (FMDirectoryView *view)
bonobo_ui_component_add_listener (icon_view->details->ui, ID_SORT_REVERSED, sort_reversed_state_changed_callback, view);
icon_view->details->menus_ready = TRUE;
+ /* Do one-time state-setting here; context-dependent state-setting
+ * is done in update_menus.
+ */
+ if (!fm_icon_view_supports_auto_layout (icon_view)) {
+ nautilus_bonobo_set_hidden
+ (icon_view->details->ui, POPUP_PATH_LAY_OUT, TRUE);
+ }
+
update_layout_menus (icon_view);
}
diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c
index 262e57f62..ae0e04636 100644
--- a/src/nautilus-navigation-window-menus.c
+++ b/src/nautilus-navigation-window-menus.c
@@ -1237,6 +1237,12 @@ nautilus_window_initialize_menus (NautilusWindow *window)
BONOBO_UI_VERB ("Zoom In", view_menu_zoom_in_callback),
BONOBO_UI_VERB ("Zoom Out", view_menu_zoom_out_callback),
BONOBO_UI_VERB ("Zoom Normal", view_menu_zoom_normal_callback),
+ /* Separate verbs for the Zoom items in the context menus so that
+ * they can be hidden when the normal ones are merely desensitized.
+ */
+ BONOBO_UI_VERB ("Zoom In Popup", view_menu_zoom_in_callback),
+ BONOBO_UI_VERB ("Zoom Out Popup", view_menu_zoom_out_callback),
+ BONOBO_UI_VERB ("Zoom Normal Popup", view_menu_zoom_normal_callback),
BONOBO_UI_VERB ("Add Bookmark", bookmarks_menu_add_bookmark_callback),
BONOBO_UI_VERB ("Edit Bookmarks", bookmarks_menu_edit_bookmarks_callback),
diff --git a/src/nautilus-shell-ui.xml b/src/nautilus-shell-ui.xml
index ad2d712b4..868b5957a 100644
--- a/src/nautilus-shell-ui.xml
+++ b/src/nautilus-shell-ui.xml
@@ -31,6 +31,12 @@
_tip="Show the contents in less detail"/>
<cmd name="Zoom Normal" _label="Normal Size"
_tip="Show the contents at the normal size"/>
+ <cmd name="Zoom In Popup" _label="Zoom In"
+ _tip="Show the contents in more detail"/>
+ <cmd name="Zoom Out Popup" _label="Zoom Out"
+ _tip="Show the contents in less detail"/>
+ <cmd name="Zoom Normal Popup" _label="Normal Size"
+ _tip="Show the contents at the normal size"/>
</commands>
<menu>
@@ -347,9 +353,9 @@
<popup name="background">
<placeholder name="Before Zoom Items"/>
<placeholder name="Zoom Items" delimit="top">
- <menuitem name="Zoom In" verb="Zoom In"/>
- <menuitem name="Zoom Out" verb="Zoom Out"/>
- <menuitem name="Zoom Normal" verb="Zoom Normal"/>
+ <menuitem name="Zoom In" verb="Zoom In Popup"/>
+ <menuitem name="Zoom Out" verb="Zoom Out Popup"/>
+ <menuitem name="Zoom Normal" verb="Zoom Normal Popup"/>
</placeholder>
<placeholder name="After Zoom Items" delimit="top"/>
</popup>
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index 262e57f62..ae0e04636 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -1237,6 +1237,12 @@ nautilus_window_initialize_menus (NautilusWindow *window)
BONOBO_UI_VERB ("Zoom In", view_menu_zoom_in_callback),
BONOBO_UI_VERB ("Zoom Out", view_menu_zoom_out_callback),
BONOBO_UI_VERB ("Zoom Normal", view_menu_zoom_normal_callback),
+ /* Separate verbs for the Zoom items in the context menus so that
+ * they can be hidden when the normal ones are merely desensitized.
+ */
+ BONOBO_UI_VERB ("Zoom In Popup", view_menu_zoom_in_callback),
+ BONOBO_UI_VERB ("Zoom Out Popup", view_menu_zoom_out_callback),
+ BONOBO_UI_VERB ("Zoom Normal Popup", view_menu_zoom_normal_callback),
BONOBO_UI_VERB ("Add Bookmark", bookmarks_menu_add_bookmark_callback),
BONOBO_UI_VERB ("Edit Bookmarks", bookmarks_menu_edit_bookmarks_callback),