summaryrefslogtreecommitdiff
path: root/libnautilus-extensions/nautilus-bonobo-extensions.c
diff options
context:
space:
mode:
authorJohn Sullivan <sullivan@src.gnome.org>2000-11-17 02:22:16 +0000
committerJohn Sullivan <sullivan@src.gnome.org>2000-11-17 02:22:16 +0000
commit177cb52d9469ed63a6e59aad9787bc64d2f6df06 (patch)
treed7f2ae3e750314f390cbf1623ca188cf2979059e /libnautilus-extensions/nautilus-bonobo-extensions.c
parent1e9980f83c426f975704f98a59e52d047ffd2db1 (diff)
downloadnautilus-177cb52d9469ed63a6e59aad9787bc64d2f6df06.tar.gz
reviewed by: Darin Adler <darin@eazel.com>
Final changes to kill off the legendary bug 3579 (Convert directory view context menus to use Bonobo) * libnautilus/nautilus-bonobo-ui.h: #define for zoom items placeholder in popup. Remove #defines for popup-specific zooming commands, since now we don't need distinct popup-specific ones. * libnautilus-extensions/nautilus-bonobo-extensions.h: * libnautilus-extensions/nautilus-bonobo-extensions.c: (nautilus_bonobo_set_label_for_menu_item_and_command): Moved this here and commented; it had been a private function in fm-directory-view.c. * src/file-manager/fm-directory-view.c: (real_merge_menus): Just hide the placeholder for the zoom items, which is now sufficient due to a Bonobo fix Darin made. (real_update_menus): Update for API name change. (set_label_for_menu_and_command): Moved this to another file and renamed it. * src/file-manager/fm-icon-view.c: (fm_icon_view_update_menus): Update the dynamic menu items in-line here, as was done with fm-directory-view.c in an earlier checkin. (compute_menu_item_info), (update_one_menu_item): Removed these obsolete functions. * src/nautilus-shell-ui.xml: Eliminated special pop-up versions of zoom commands. They existed only to allow hiding without affecting the menu-bar versions, but now that placeholders can be hidden these aren't necessary. * src/nautilus-window-menus.c: (nautilus_window_initialize_menus): Removed verb installation for pop-up versions of zoom commands.
Diffstat (limited to 'libnautilus-extensions/nautilus-bonobo-extensions.c')
-rw-r--r--libnautilus-extensions/nautilus-bonobo-extensions.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libnautilus-extensions/nautilus-bonobo-extensions.c b/libnautilus-extensions/nautilus-bonobo-extensions.c
index 1b7f93c8e..d40cff35a 100644
--- a/libnautilus-extensions/nautilus-bonobo-extensions.c
+++ b/libnautilus-extensions/nautilus-bonobo-extensions.c
@@ -26,6 +26,7 @@
#include <config.h>
#include "nautilus-bonobo-extensions.h"
+#include "nautilus-string.h"
#include <bonobo/bonobo-ui-util.h>
#include <libgnomevfs/gnome-vfs-utils.h>
@@ -390,6 +391,30 @@ nautilus_bonobo_remove_menu_items_and_commands (BonoboUIComponent *ui,
g_free (remove_wildcard);
}
+/* Call to set the user-visible label of a menu item to a string
+ * containing an underscore accelerator. The underscore is stripped
+ * off before setting the label of the command, because pop-up menu
+ * and tool bar button labels shouldn't have the underscore.
+ */
+void
+nautilus_bonobo_set_label_for_menu_item_and_command (BonoboUIComponent *ui,
+ const char *menu_item_path,
+ const char *command_path,
+ const char *label_with_underscore)
+{
+ char *label_no_underscore;
+
+ label_no_underscore = nautilus_str_strip_chr (label_with_underscore, '_');
+ nautilus_bonobo_set_label (ui,
+ menu_item_path,
+ label_with_underscore);
+ nautilus_bonobo_set_label (ui,
+ command_path,
+ label_no_underscore);
+
+ g_free (label_no_underscore);
+}
+
void
nautilus_bonobo_set_icon (BonoboUIComponent *ui,
const char *path,