diff options
author | Mathieu Lacage <mathieu@eazel.com> | 2000-10-09 22:06:13 +0000 |
---|---|---|
committer | Mathieu Lacage <mathieu@src.gnome.org> | 2000-10-09 22:06:13 +0000 |
commit | eea192b04c4a27badabc24e16e944c85b50a9d6e (patch) | |
tree | a2c7ece00320fb6b9e07e60dbeb49251bbfa9d99 /libnautilus-extensions/nautilus-bonobo-extensions.c | |
parent | 0a5e99aa5ece6c5f4212672c0de918deb19cc5e5 (diff) | |
download | nautilus-eea192b04c4a27badabc24e16e944c85b50a9d6e.tar.gz |
Fix bugs 3498, 3523 and the nautilus part of 3497 3497 bug fix is disabled
2000-10-09 Mathieu Lacage <mathieu@eazel.com>
Fix bugs 3498, 3523 and the nautilus part of 3497
3497 bug fix is disabled because there is a bug in bonobo.
bug you can try it if you set BONOBO_WORKAROUND to 1.
* 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):
add g_asserts. add (nautilus_bonobo_set_icon)
* libnautilus-extensions/nautilus-bonobo-extensions.h:
add (nautilus_bonobo_set_icon) prototype
* src/Makefile.am: beautification.
* src/file-manager/fm-desktop-icon-view.c:
(fm_desktop_icon_view_initialize_class): a space...
* src/file-manager/fm-directory-view.c:
(fm_directory_view_real_merge_menus): a space too...
* src/nautilus-shell-ui.xml: mainly a few spaces.
* src/nautilus-window-manage-views.c: (load_content_view):
use bonobo_ui_component_freeze/thaw
* src/nautilus-window-menus.c:
(nautilus_window_update_show_hide_menu_items),
(get_user_level_icon_name), (switch_to_user_level),
(add_user_level_menu_item), (nautilus_window_initialize_menus),
(nautilus_window_update_find_menu_item),
(update_user_level_menu_items),
(convert_user_level_to_path):
use bonobo_ui_component_freeze/thaw and add the corect calls to
nautilus_bonobo_set_icon
* src/nautilus-window.c: (nautilus_window_constructed),
(show_dock_item): add calls to nautilus_bonobo_set_hidden to remove
the toolbars for the desktop case.
Diffstat (limited to 'libnautilus-extensions/nautilus-bonobo-extensions.c')
-rw-r--r-- | libnautilus-extensions/nautilus-bonobo-extensions.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/libnautilus-extensions/nautilus-bonobo-extensions.c b/libnautilus-extensions/nautilus-bonobo-extensions.c index 2f32f055b..c0d927f17 100644 --- a/libnautilus-extensions/nautilus-bonobo-extensions.c +++ b/libnautilus-extensions/nautilus-bonobo-extensions.c @@ -32,6 +32,7 @@ nautilus_bonobo_set_accelerator (BonoboUIComponent *ui, const char *path, const char *accelerator) { + g_assert (ui != NULL); bonobo_ui_component_set_prop (ui, path, "accel", accelerator, @@ -43,6 +44,7 @@ nautilus_bonobo_set_description (BonoboUIComponent *ui, const char *path, const char *description) { + g_assert (ui != NULL); bonobo_ui_component_set_prop (ui, path, "descr", description, @@ -54,6 +56,7 @@ nautilus_bonobo_set_label (BonoboUIComponent *ui, const char *path, const char *label) { + g_assert (ui != NULL); bonobo_ui_component_set_prop (ui, path, "label", label, @@ -65,6 +68,7 @@ nautilus_bonobo_set_sensitive (BonoboUIComponent *ui, const char *path, gboolean sensitive) { + g_assert (ui != NULL); bonobo_ui_component_set_prop (ui, path, "sensitive", sensitive ? "1" : "0", @@ -76,6 +80,7 @@ nautilus_bonobo_set_hidden (BonoboUIComponent *ui, const char *path, gboolean hidden) { + g_assert (ui != NULL); bonobo_ui_component_set_prop (ui, path, "hidden", hidden ? "1" : "0", @@ -86,6 +91,9 @@ gboolean nautilus_bonobo_get_hidden (BonoboUIComponent *ui, const char *path) { char *value; + + g_assert (ui != NULL); + value = bonobo_ui_component_get_prop (ui, path, "hidden", NULL); @@ -100,6 +108,44 @@ gboolean nautilus_bonobo_get_hidden (BonoboUIComponent *ui, } } +void +nautilus_bonobo_set_icon (BonoboUIComponent *ui, + const char *path, + const char *icon_relative_path) +{ + char *current_icon; + char *pixtype; + + g_assert (ui != NULL); + g_return_if_fail (icon_relative_path != NULL); + g_return_if_fail (path != NULL); + + current_icon = bonobo_ui_component_get_prop (ui, path, + "pixname", NULL); + if (current_icon == NULL + || strcmp (current_icon, icon_relative_path) != 0) { + /*g_print ("setting %s to %s\n", path, icon_relative_path);*/ + bonobo_ui_component_set_prop (ui, path, + "pixname", + icon_relative_path, NULL); + } + + g_free (current_icon); + + + pixtype = bonobo_ui_component_get_prop (ui, path, + "pixtype", NULL); + if (pixtype == NULL + || strcmp (pixtype, "filename") != 0) { + bonobo_ui_component_set_prop (ui, path, + "pixtype", + "filename", NULL); + } + + g_free (pixtype); + +} + #ifdef UIH |