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 /libnautilus-private/nautilus-bonobo-extensions.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 'libnautilus-private/nautilus-bonobo-extensions.c')
-rw-r--r-- | libnautilus-private/nautilus-bonobo-extensions.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/libnautilus-private/nautilus-bonobo-extensions.c b/libnautilus-private/nautilus-bonobo-extensions.c index 2694fc2eb..c8fd5a9f8 100644 --- a/libnautilus-private/nautilus-bonobo-extensions.c +++ b/libnautilus-private/nautilus-bonobo-extensions.c @@ -32,7 +32,7 @@ nautilus_bonobo_set_accelerator (BonoboUIComponent *ui, const char *path, const char *accelerator) { - g_assert (ui != NULL); + g_return_if_fail (ui != NULL); bonobo_ui_component_set_prop (ui, path, "accel", accelerator, @@ -44,7 +44,7 @@ nautilus_bonobo_set_description (BonoboUIComponent *ui, const char *path, const char *description) { - g_assert (ui != NULL); + g_return_if_fail (ui != NULL); bonobo_ui_component_set_prop (ui, path, "descr", description, @@ -56,7 +56,7 @@ nautilus_bonobo_set_label (BonoboUIComponent *ui, const char *path, const char *label) { - g_assert (ui != NULL); + g_return_if_fail (ui != NULL); bonobo_ui_component_set_prop (ui, path, "label", label, @@ -68,7 +68,7 @@ nautilus_bonobo_set_sensitive (BonoboUIComponent *ui, const char *path, gboolean sensitive) { - g_assert (ui != NULL); + g_return_if_fail (ui != NULL); bonobo_ui_component_set_prop (ui, path, "sensitive", sensitive ? "1" : "0", @@ -76,11 +76,23 @@ nautilus_bonobo_set_sensitive (BonoboUIComponent *ui, } void +nautilus_bonobo_set_toggle_state (BonoboUIComponent *ui, + const char *path, + gboolean state) +{ + g_return_if_fail (ui != NULL); + bonobo_ui_component_set_prop (ui, path, + "state", + state ? "1" : "0", + NULL); +} + +void nautilus_bonobo_set_hidden (BonoboUIComponent *ui, const char *path, gboolean hidden) { - g_assert (ui != NULL); + g_return_if_fail (ui != NULL); bonobo_ui_component_set_prop (ui, path, "hidden", hidden ? "1" : "0", @@ -93,7 +105,7 @@ nautilus_bonobo_get_hidden (BonoboUIComponent *ui, { char *value; - g_assert (ui != NULL); + g_return_val_if_fail (ui != NULL, FALSE); value = bonobo_ui_component_get_prop (ui, path, "hidden", @@ -152,7 +164,7 @@ nautilus_bonobo_set_icon (BonoboUIComponent *ui, char *current_icon; char *pixtype; - g_assert (ui != NULL); + g_return_if_fail (ui != NULL); g_return_if_fail (icon_relative_path != NULL); g_return_if_fail (path != NULL); |