From c631dfb4add034db59cb477843ca95bcc2986758 Mon Sep 17 00:00:00 2001 From: gustav_b Date: Sun, 9 Jul 2006 11:32:23 +0000 Subject: Added descriptions to Undo/Redo commands in the menus (bzr r1379) --- src/helper/action.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/helper/action.cpp') diff --git a/src/helper/action.cpp b/src/helper/action.cpp index 9584c5dae..1c8c7ec15 100644 --- a/src/helper/action.cpp +++ b/src/helper/action.cpp @@ -13,7 +13,6 @@ #include - #include "helper/action.h" static void sp_action_class_init (SPActionClass *klass); @@ -206,6 +205,37 @@ sp_action_set_sensitive (SPAction *action, unsigned int sensitive) } } + +/** + * Change name for all actions that can be taken with the action. + */ +void +sp_action_set_name (SPAction *action, Glib::ustring name) +{ + nr_return_if_fail (action != NULL); + nr_return_if_fail (SP_IS_ACTION (action)); + + NRActiveObject *aobject; + g_free(action->name); + action->name = g_strdup(name.c_str()); + aobject = (NRActiveObject *) action; + if (aobject->callbacks) { + unsigned int i; + for (i = 0; i < aobject->callbacks->length; i++) { + NRObjectListener *listener; + SPActionEventVector *avector; + listener = aobject->callbacks->listeners + i; + avector = (SPActionEventVector *) listener->vector; + if ((listener->size >= sizeof (SPActionEventVector)) && avector->set_name) { + avector->set_name (action, name, listener->data); + } + } + } +} + + + + /** * Return View associated with the action. */ -- cgit v1.2.3