diff options
author | Gene Z. Ragan <gzr@eazel.com> | 2000-10-10 00:50:56 +0000 |
---|---|---|
committer | Gene Ragan <gzr@src.gnome.org> | 2000-10-10 00:50:56 +0000 |
commit | 1660631a73d3d0a12d1fe9980b7fc71478d2eb1a (patch) | |
tree | 5051c867e26c29660d1f7ccd30b04a3070f06f67 /libnautilus-extensions/nautilus-bonobo-extensions.c | |
parent | 897a3a0803bd29954a755c31138be44798d94455 (diff) | |
download | nautilus-1660631a73d3d0a12d1fe9980b7fc71478d2eb1a.tar.gz |
Fixed bug 3513, No applications or viewers appear in "Open With" menu in
2000-10-09 Gene Z. Ragan <gzr@eazel.com>
Fixed bug 3513, No applications or viewers appear in "Open With" menu
in menu bar
* libnautilus-extensions/nautilus-bonobo-extensions.c:
* libnautilus-extensions/nautilus-bonobo-extensions.h:
(nautilus_bonobo_add_menu_item),
(nautilus_bonobo_remove_menu_items):
New functions to add a menu items and remove multiple menu items from
a submenu.
* src/file-manager/fm-directory-view.c:
* src/file-manager/fm-directory-view.h:
(bonobo_launch_application_callback),
(bonobo_open_location_with_viewer_callback),
(add_open_with_app_bonobo_menu_item),
(add_open_with_viewer_bonobo_menu_item),
(add_application_to_bonobo_menu), (add_component_to_bonobo_menu),
(reset_bonobo_open_with_menu),
(fm_directory_view_real_update_menus):
Call new nautilus bonobo functions to add applications and viewers
to Open With... menu. Also add verbs in addition to creating
the menu items.
Diffstat (limited to 'libnautilus-extensions/nautilus-bonobo-extensions.c')
-rw-r--r-- | libnautilus-extensions/nautilus-bonobo-extensions.c | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/libnautilus-extensions/nautilus-bonobo-extensions.c b/libnautilus-extensions/nautilus-bonobo-extensions.c index c0d927f17..75ca6f60f 100644 --- a/libnautilus-extensions/nautilus-bonobo-extensions.c +++ b/libnautilus-extensions/nautilus-bonobo-extensions.c @@ -87,8 +87,9 @@ nautilus_bonobo_set_hidden (BonoboUIComponent *ui, NULL); } -gboolean nautilus_bonobo_get_hidden (BonoboUIComponent *ui, - const char *path) +gboolean +nautilus_bonobo_get_hidden (BonoboUIComponent *ui, + const char *path) { char *value; @@ -109,6 +110,42 @@ gboolean nautilus_bonobo_get_hidden (BonoboUIComponent *ui, } void +nautilus_bonobo_add_menu_item (BonoboUIComponent *ui, const char *path, + const char *item_name, const char *item_label) +{ + CORBA_Environment ev; + char *xml_string; + + CORBA_exception_init (&ev); + + xml_string = g_strdup_printf ("<menuitem name=\"%s\" label=\"%s\" verb=\"verb:%s\"/>\n", item_name, item_label, item_name); + bonobo_ui_component_set (ui, path, xml_string, &ev); + + g_free (xml_string); + CORBA_exception_free (&ev); +} + +/** + * nautilus_bonobo_remove_menu_items + * + * Removes all menu items contained in a menu or placeholder + * + * @uih: The BonoboUIHandler for this menu item. + * @path: The standard bonobo-style path specifier for this menu item. + */ +void +nautilus_bonobo_remove_menu_items (BonoboUIComponent *ui, const char *path) +{ + char *remove_wildcard; + + remove_wildcard = g_strdup_printf ("%s/*", path); + + bonobo_ui_component_rm (ui, remove_wildcard, NULL); + + g_free (remove_wildcard); +} + +void nautilus_bonobo_set_icon (BonoboUIComponent *ui, const char *path, const char *icon_relative_path) @@ -146,7 +183,6 @@ nautilus_bonobo_set_icon (BonoboUIComponent *ui, } - #ifdef UIH /** |