diff options
author | John Sullivan <sullivan@src.gnome.org> | 2000-10-10 20:31:34 +0000 |
---|---|---|
committer | John Sullivan <sullivan@src.gnome.org> | 2000-10-10 20:31:34 +0000 |
commit | 0d70c39a7f18683b0c06443aa9f6353e9ac8a5f3 (patch) | |
tree | 28065f6458340c3f21be5cf404b68e384a6384e5 /src/nautilus-spatial-window.c | |
parent | ed2ef9a2af0677f3c5c21c7762971700d011df34 (diff) | |
download | nautilus-0d70c39a7f18683b0c06443aa9f6353e9ac8a5f3.tar.gz |
Fixed bug 3587 ("Close All Windows" doesn't work)
Fixed bug 3556 (Find button and Find menu item states aren't
synchronized)
* libnautilus-extensions/nautilus-bonobo-extensions.c:
(nautilus_bonobo_set_accelerator),
(nautilus_bonobo_set_description), (nautilus_bonobo_set_label),
(nautilus_bonobo_set_sensitive),
(nautilus_bonobo_set_hidden),
(nautilus_bonobo_get_hidden), (nautilus_bonobo_set_icon):
Changed g_asserts to g_return_if_fails when checking parameters.
(nautilus_bonobo_set_toggle_state): New cover function for setting
a boolean state on a Bonobo item.
* libnautilus-extensions/nautilus-bonobo-extensions.h:
Prototype for nautilus_bonobo_set_toggle_state.
* src/nautilus-shell-ui.xml: Use different verb for Find button
than for Find menu item to work around bug 3590.
* src/nautilus-window-private.h: Add updating_bonobo_state boolean
to work around design flaw where there's no way to set menu item or
toggle button state without activating its callback.
* src/nautilus-window-menus.c:
Removed #defines for unused MENU_PATHs
(file_menu_toggle_find_mode_callback): Bail out if updating_bonobo_state.
(nautilus_window_initialize_menus): Fix verb name for Close All Windows;
add new verb for Find toggle button.
(nautilus_window_update_find_menu_item): Use #define for path; remove
now-used unused-function from hack.
* src/nautilus-window.c: (navigation_bar_mode_changed_callback):
Set Find toggle button state, inside updating_bonobo_state = TRUE block.
Diffstat (limited to 'src/nautilus-spatial-window.c')
-rw-r--r-- | src/nautilus-spatial-window.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c index a76549950..4e5f900b1 100644 --- a/src/nautilus-spatial-window.c +++ b/src/nautilus-spatial-window.c @@ -91,6 +91,10 @@ /* default web search uri - FIXME bugzilla.eazel.com 2465: this will be changed to point to the Eazel service */ #define DEFAULT_SEARCH_WEB_URI "http://www.google.com" +/* FIXME: bugzilla.eazel.com 3590 + * This shouldn't need to exist. See bug report for details. + */ +#define NAUTILUS_COMMAND_TOGGLE_FIND_MODE_WITH_STATE "/commands/Toggle Find Mode With State" enum { ARG_0, @@ -209,22 +213,32 @@ goto_uri_callback (GtkWidget *widget, static void navigation_bar_mode_changed_callback (GtkWidget *widget, NautilusSwitchableNavigationBarMode mode, - GtkWidget *window) + NautilusWindow *window) { - nautilus_window_update_find_menu_item (NAUTILUS_WINDOW (window)); + gboolean new_toggle_state; -#ifdef UIH + nautilus_window_update_find_menu_item (window); + + window->details->updating_bonobo_state = TRUE; switch (mode) { case NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION: - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (NAUTILUS_WINDOW (window)->search_local_button), FALSE); + new_toggle_state = FALSE; break; case NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_SEARCH: - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (NAUTILUS_WINDOW (window)->search_local_button), TRUE); + new_toggle_state = TRUE; break; default: g_assert_not_reached (); } -#endif + /* FIXME: bugzilla.eazel.com 3590: + * We shouldn't need a separate command for the toggle button and menu item. + * This is a Bonobo design flaw, explained in the bug report. + */ + nautilus_bonobo_set_toggle_state (window->details->shell_ui, + NAUTILUS_COMMAND_TOGGLE_FIND_MODE_WITH_STATE, + new_toggle_state); + + window->details->updating_bonobo_state = FALSE; } void |