summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGene Z. Ragan <gzr@eazel.com>2000-06-02 05:51:35 +0000
committerGene Ragan <gzr@src.gnome.org>2000-06-02 05:51:35 +0000
commitf1cc9405bd240ed989732b72a273eae48d42fa80 (patch)
treed625a8db9983cff69d39d33ec5173d4829d9deea
parent2dcd63aca7f0978711b6f389c0dedff2a4240f8d (diff)
downloadnautilus-f1cc9405bd240ed989732b72a273eae48d42fa80.tar.gz
New call to be used internally to get the current undo transaction. An
2000-06-01 Gene Z. Ragan <gzr@eazel.com> * libnautilus/nautilus-undo-manager.c: * libnautilus/nautilus-undo-manager.h: (nautilus_undo_manager_get_current_undo_transaction): New call to be used internally to get the current undo transaction. An example of this call being used is in the menu code that displays the current undo operation name. * libnautilus/nautilus-undo-transaction.c: (impl_Nautilus_Undo_Transaction__get_undo_description), (impl_Nautilus_Undo_Transaction__get_redo_description), (impl_Nautilus_Undo_Transaction__get_operation_name), (impl_Nautilus_Undo_Transaction__undo), Added actual functionlality to these calls. They now work as advertised. (nautilus_undo_transaction_new), Made changed needed to actually use the operation name and description that is passed in. (nautilus_undo_transaction_destroy), Clean up stored operation name and description strings. * src/nautilus-window-menus.c: (update_undo_menu_item): The undo operation name is now displayed in the menu item.
-rw-r--r--ChangeLog28
-rw-r--r--libnautilus-extensions/nautilus-undo-manager.c26
-rw-r--r--libnautilus-extensions/nautilus-undo-manager.h6
-rw-r--r--libnautilus-private/nautilus-undo-manager.c26
-rw-r--r--libnautilus-private/nautilus-undo-manager.h6
-rw-r--r--libnautilus/nautilus-distributed-undo.idl2
-rw-r--r--libnautilus/nautilus-undo-manager.c26
-rw-r--r--libnautilus/nautilus-undo-manager.h6
-rw-r--r--libnautilus/nautilus-undo-transaction.c98
-rw-r--r--libnautilus/nautilus-undo-transaction.h14
-rw-r--r--libnautilus/nautilus-undo.idl2
-rw-r--r--libnautilus/nautilus-undoable.c5
-rw-r--r--src/nautilus-navigation-window-menus.c33
-rw-r--r--src/nautilus-window-menus.c33
14 files changed, 266 insertions, 45 deletions
diff --git a/ChangeLog b/ChangeLog
index a141a4aa0..5f821cc41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2000-06-01 Gene Z. Ragan <gzr@eazel.com>
+
+ * libnautilus/nautilus-undo-manager.c:
+ * libnautilus/nautilus-undo-manager.h:
+ (nautilus_undo_manager_get_current_undo_transaction):
+ New call to be used internally to get the current undo transaction.
+ An example of this call being used is in the menu code that displays
+ the current undo operation name.
+
+ * libnautilus/nautilus-undo-transaction.c:
+ (impl_Nautilus_Undo_Transaction__get_undo_description),
+ (impl_Nautilus_Undo_Transaction__get_redo_description),
+ (impl_Nautilus_Undo_Transaction__get_operation_name),
+ (impl_Nautilus_Undo_Transaction__undo),
+ Added actual functionlality to these calls. They now
+ work as advertised.
+
+ (nautilus_undo_transaction_new),
+ Made changed needed to actually use the operation
+ name and description that is passed in.
+
+ (nautilus_undo_transaction_destroy),
+ Clean up stored operation name and description strings.
+
+ * src/nautilus-window-menus.c:
+ (update_undo_menu_item):
+ The undo operation name is now displayed in the menu item.
+
2000-06-01 Pavel Cisler <pavel@eazel.com>
* libnautilus-extensions/nautilus-drag.h:
diff --git a/libnautilus-extensions/nautilus-undo-manager.c b/libnautilus-extensions/nautilus-undo-manager.c
index 96e746c24..15af401ff 100644
--- a/libnautilus-extensions/nautilus-undo-manager.c
+++ b/libnautilus-extensions/nautilus-undo-manager.c
@@ -400,6 +400,32 @@ nautilus_undo_manager_forget_transaction (NautilusUndoManager *manager,
}
+Nautilus_Undo_Transaction
+nautilus_undo_manager_get_current_undo_transaction (NautilusUndoManager *manager)
+{
+ GList *last_in_list;
+ CORBA_Object undo_transaction;
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+
+ /* Verify we have a transaction to be undone */
+ if (manager->details->undo_list == NULL) {
+ g_warning ("NautilusUndoManager has no undo transaction in the queue.");
+ return NULL;
+ }
+
+ /* Pop last transaction off undo list */
+ last_in_list = g_list_last (manager->details->undo_list);
+ g_assert (last_in_list != NULL);
+ undo_transaction = last_in_list->data;
+
+ return undo_transaction;
+
+ CORBA_exception_free (&ev);
+}
+
+
gboolean
nautilus_undo_manager_can_undo (NautilusUndoManager *manager)
{
diff --git a/libnautilus-extensions/nautilus-undo-manager.h b/libnautilus-extensions/nautilus-undo-manager.h
index 671acbeb2..668733d1b 100644
--- a/libnautilus-extensions/nautilus-undo-manager.h
+++ b/libnautilus-extensions/nautilus-undo-manager.h
@@ -58,7 +58,7 @@ struct NautilusUndoManagerClass {
/* GtkObject */
GtkType nautilus_undo_manager_get_type (void);
-NautilusUndoManager *nautilus_undo_manager_new (void);
+NautilusUndoManager *nautilus_undo_manager_new (void);
/* Prototypes */
gboolean nautilus_undo_manager_can_undo (NautilusUndoManager *manager);
@@ -79,4 +79,8 @@ void nautilus_undo_manager_stash_global_undo (Nautilus_Undo_Manager undo_
Nautilus_Undo_Manager nautilus_undo_manager_get_global_undo (void);
+Nautilus_Undo_Transaction nautilus_undo_manager_get_current_undo_transaction (NautilusUndoManager *manager);
+
+
+
#endif
diff --git a/libnautilus-private/nautilus-undo-manager.c b/libnautilus-private/nautilus-undo-manager.c
index 96e746c24..15af401ff 100644
--- a/libnautilus-private/nautilus-undo-manager.c
+++ b/libnautilus-private/nautilus-undo-manager.c
@@ -400,6 +400,32 @@ nautilus_undo_manager_forget_transaction (NautilusUndoManager *manager,
}
+Nautilus_Undo_Transaction
+nautilus_undo_manager_get_current_undo_transaction (NautilusUndoManager *manager)
+{
+ GList *last_in_list;
+ CORBA_Object undo_transaction;
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+
+ /* Verify we have a transaction to be undone */
+ if (manager->details->undo_list == NULL) {
+ g_warning ("NautilusUndoManager has no undo transaction in the queue.");
+ return NULL;
+ }
+
+ /* Pop last transaction off undo list */
+ last_in_list = g_list_last (manager->details->undo_list);
+ g_assert (last_in_list != NULL);
+ undo_transaction = last_in_list->data;
+
+ return undo_transaction;
+
+ CORBA_exception_free (&ev);
+}
+
+
gboolean
nautilus_undo_manager_can_undo (NautilusUndoManager *manager)
{
diff --git a/libnautilus-private/nautilus-undo-manager.h b/libnautilus-private/nautilus-undo-manager.h
index 671acbeb2..668733d1b 100644
--- a/libnautilus-private/nautilus-undo-manager.h
+++ b/libnautilus-private/nautilus-undo-manager.h
@@ -58,7 +58,7 @@ struct NautilusUndoManagerClass {
/* GtkObject */
GtkType nautilus_undo_manager_get_type (void);
-NautilusUndoManager *nautilus_undo_manager_new (void);
+NautilusUndoManager *nautilus_undo_manager_new (void);
/* Prototypes */
gboolean nautilus_undo_manager_can_undo (NautilusUndoManager *manager);
@@ -79,4 +79,8 @@ void nautilus_undo_manager_stash_global_undo (Nautilus_Undo_Manager undo_
Nautilus_Undo_Manager nautilus_undo_manager_get_global_undo (void);
+Nautilus_Undo_Transaction nautilus_undo_manager_get_current_undo_transaction (NautilusUndoManager *manager);
+
+
+
#endif
diff --git a/libnautilus/nautilus-distributed-undo.idl b/libnautilus/nautilus-distributed-undo.idl
index b7796e126..49476af93 100644
--- a/libnautilus/nautilus-distributed-undo.idl
+++ b/libnautilus/nautilus-distributed-undo.idl
@@ -50,7 +50,7 @@ module Nautilus {
*/
readonly attribute MenuItem undo_description;
readonly attribute MenuItem redo_description;
- readonly attribute string base_description;
+ readonly attribute string operation_name;
/* Here's how you actually perform an undo.
* Once it's performed, calling this again is
diff --git a/libnautilus/nautilus-undo-manager.c b/libnautilus/nautilus-undo-manager.c
index 96e746c24..15af401ff 100644
--- a/libnautilus/nautilus-undo-manager.c
+++ b/libnautilus/nautilus-undo-manager.c
@@ -400,6 +400,32 @@ nautilus_undo_manager_forget_transaction (NautilusUndoManager *manager,
}
+Nautilus_Undo_Transaction
+nautilus_undo_manager_get_current_undo_transaction (NautilusUndoManager *manager)
+{
+ GList *last_in_list;
+ CORBA_Object undo_transaction;
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+
+ /* Verify we have a transaction to be undone */
+ if (manager->details->undo_list == NULL) {
+ g_warning ("NautilusUndoManager has no undo transaction in the queue.");
+ return NULL;
+ }
+
+ /* Pop last transaction off undo list */
+ last_in_list = g_list_last (manager->details->undo_list);
+ g_assert (last_in_list != NULL);
+ undo_transaction = last_in_list->data;
+
+ return undo_transaction;
+
+ CORBA_exception_free (&ev);
+}
+
+
gboolean
nautilus_undo_manager_can_undo (NautilusUndoManager *manager)
{
diff --git a/libnautilus/nautilus-undo-manager.h b/libnautilus/nautilus-undo-manager.h
index 671acbeb2..668733d1b 100644
--- a/libnautilus/nautilus-undo-manager.h
+++ b/libnautilus/nautilus-undo-manager.h
@@ -58,7 +58,7 @@ struct NautilusUndoManagerClass {
/* GtkObject */
GtkType nautilus_undo_manager_get_type (void);
-NautilusUndoManager *nautilus_undo_manager_new (void);
+NautilusUndoManager *nautilus_undo_manager_new (void);
/* Prototypes */
gboolean nautilus_undo_manager_can_undo (NautilusUndoManager *manager);
@@ -79,4 +79,8 @@ void nautilus_undo_manager_stash_global_undo (Nautilus_Undo_Manager undo_
Nautilus_Undo_Manager nautilus_undo_manager_get_global_undo (void);
+Nautilus_Undo_Transaction nautilus_undo_manager_get_current_undo_transaction (NautilusUndoManager *manager);
+
+
+
#endif
diff --git a/libnautilus/nautilus-undo-transaction.c b/libnautilus/nautilus-undo-transaction.c
index f84924993..1d0ce5cea 100644
--- a/libnautilus/nautilus-undo-transaction.c
+++ b/libnautilus/nautilus-undo-transaction.c
@@ -53,7 +53,7 @@ static Nautilus_Undo_MenuItem *impl_Nautilus_Undo_Transaction__get_undo_descript
CORBA_Environment *ev);
static Nautilus_Undo_MenuItem *impl_Nautilus_Undo_Transaction__get_redo_description (impl_POA_Nautilus_Undo_Transaction *servant,
CORBA_Environment *ev);
-static CORBA_char *impl_Nautilus_Undo_Transaction__get_base_description (impl_POA_Nautilus_Undo_Transaction *servant,
+static CORBA_char *impl_Nautilus_Undo_Transaction__get_operation_name (impl_POA_Nautilus_Undo_Transaction *servant,
CORBA_Environment *ev);
static void impl_Nautilus_Undo_Transaction__undo (impl_POA_Nautilus_Undo_Transaction *servant,
CORBA_Environment *ev);
@@ -67,7 +67,7 @@ POA_Nautilus_Undo_Transaction__epv libnautilus_Nautilus_Undo_Transaction_epv =
(gpointer) &impl_Nautilus_Undo_Transaction__get_undo_description,
(gpointer) &impl_Nautilus_Undo_Transaction__get_redo_description,
- (gpointer) &impl_Nautilus_Undo_Transaction__get_base_description,
+ (gpointer) &impl_Nautilus_Undo_Transaction__get_operation_name,
(gpointer) &impl_Nautilus_Undo_Transaction__undo
};
@@ -128,38 +128,95 @@ impl_Nautilus_Undo_Transaction__create (NautilusUndoTransaction *transaction, CO
}
-static Nautilus_Undo_MenuItem *impl_Nautilus_Undo_Transaction__get_undo_description (impl_POA_Nautilus_Undo_Transaction *servant,
+static Nautilus_Undo_MenuItem *
+impl_Nautilus_Undo_Transaction__get_undo_description (impl_POA_Nautilus_Undo_Transaction *servant,
CORBA_Environment *ev)
{
- return NULL;
+ Nautilus_Undo_MenuItem *item;
+ NautilusUndoTransaction *transaction;
+
+ CORBA_exception_init(ev);
+
+ transaction = servant->undo_transaction;
+
+ item = ORBit_alloc (sizeof (Nautilus_Undo_MenuItem), NULL, NULL);
+
+ item->name = ORBit_alloc (strlen (transaction->undo_menu_item_name) * sizeof (CORBA_char), NULL, NULL);
+ strcpy (item->name, transaction->undo_menu_item_name);
+
+ item->description = ORBit_alloc (strlen (transaction->undo_menu_item_description) * sizeof (CORBA_char), NULL, NULL);
+ strcpy (item->description, transaction->undo_menu_item_description);
+
+ CORBA_exception_free(ev);
+
+ return item;
}
-static Nautilus_Undo_MenuItem *impl_Nautilus_Undo_Transaction__get_redo_description (impl_POA_Nautilus_Undo_Transaction *servant,
+static Nautilus_Undo_MenuItem *
+impl_Nautilus_Undo_Transaction__get_redo_description (impl_POA_Nautilus_Undo_Transaction *servant,
CORBA_Environment *ev)
{
- return NULL;
+ Nautilus_Undo_MenuItem *item;
+ NautilusUndoTransaction *transaction;
+
+ CORBA_exception_init(ev);
+
+ transaction = servant->undo_transaction;
+
+ item = ORBit_alloc (sizeof (Nautilus_Undo_MenuItem), NULL, NULL);
+
+ item->name = ORBit_alloc (strlen (transaction->redo_menu_item_name) * sizeof (CORBA_char), NULL, NULL);
+ strcpy (item->name, transaction->redo_menu_item_name);
+
+ item->description = ORBit_alloc (strlen (transaction->redo_menu_item_description) * sizeof (CORBA_char), NULL, NULL);
+ strcpy (item->description, transaction->redo_menu_item_description);
+
+ CORBA_exception_free(ev);
+
+ return item;
+
}
-static CORBA_char *impl_Nautilus_Undo_Transaction__get_base_description (impl_POA_Nautilus_Undo_Transaction *servant,
+static CORBA_char *
+impl_Nautilus_Undo_Transaction__get_operation_name (impl_POA_Nautilus_Undo_Transaction *servant,
CORBA_Environment *ev)
{
- return NULL;
+ NautilusUndoTransaction *transaction;
+ CORBA_char *operation_name;
+
+ CORBA_exception_init(ev);
+
+ transaction = servant->undo_transaction;
+
+ operation_name = ORBit_alloc (strlen (transaction->operation_name) * sizeof (CORBA_char), NULL, NULL);
+ strcpy (operation_name, transaction->operation_name);
+
+ CORBA_exception_free(ev);
+
+ return operation_name;
}
-static void impl_Nautilus_Undo_Transaction__undo (impl_POA_Nautilus_Undo_Transaction *servant, CORBA_Environment *ev)
+static void
+impl_Nautilus_Undo_Transaction__undo (impl_POA_Nautilus_Undo_Transaction *servant, CORBA_Environment *ev)
{
nautilus_undo_transaction_undo (servant->undo_transaction);
}
/* nautilus_undo_transaction_new */
NautilusUndoTransaction *
-nautilus_undo_transaction_new (const gchar *name)
+nautilus_undo_transaction_new (const char *operation_name, const char *undo_menu_item_name,
+ const char *undo_menu_item_description, const char *redo_menu_item_name,
+ const char *redo_menu_item_description)
{
NautilusUndoTransaction *transaction;
transaction = gtk_type_new (nautilus_undo_transaction_get_type ());
- transaction->name = g_strdup(name);
+ transaction->operation_name = g_strdup (operation_name);
+ transaction->undo_menu_item_name = g_strdup (undo_menu_item_name);
+ transaction->undo_menu_item_description = g_strdup (undo_menu_item_description);
+ transaction->redo_menu_item_name = g_strdup (redo_menu_item_name);
+ transaction->redo_menu_item_description = g_strdup (redo_menu_item_description);
return transaction;
}
@@ -194,7 +251,11 @@ nautilus_undo_transaction_destroy (GtkObject *object)
/* Empty list */
g_list_free(transaction->transaction_list);
- g_free(transaction->name);
+ g_free(transaction->operation_name);
+ g_free(transaction->undo_menu_item_name);
+ g_free(transaction->undo_menu_item_description);
+ g_free(transaction->redo_menu_item_name);
+ g_free(transaction->redo_menu_item_description);
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
}
@@ -265,19 +326,6 @@ nautilus_undo_transaction_undo (NautilusUndoTransaction *transaction)
/* nautilus_undo_transaction_contains_object
*
- * Return name of requested transaction
- */
-const gchar *
-nautilus_undo_transaction_get_name (NautilusUndoTransaction *transaction)
-{
- g_return_val_if_fail(transaction != NULL, NULL);
-
- return transaction->name;
-}
-
-
-/* nautilus_undo_transaction_contains_object
- *
* Return TRUE if object is contained by transaction
*/
gboolean
diff --git a/libnautilus/nautilus-undo-transaction.h b/libnautilus/nautilus-undo-transaction.h
index f0a2c8441..2e46ef7e6 100644
--- a/libnautilus/nautilus-undo-transaction.h
+++ b/libnautilus/nautilus-undo-transaction.h
@@ -46,7 +46,11 @@ typedef struct NautilusUndoTransactionClass NautilusUndoTransactionClass;
struct NautilusUndoTransaction {
BonoboObject parent;
- gchar *name;
+ char *operation_name;
+ char *undo_menu_item_name;
+ char *undo_menu_item_description;
+ char *redo_menu_item_name;
+ char *redo_menu_item_description;
GList *transaction_list;
};
@@ -56,11 +60,13 @@ struct NautilusUndoTransactionClass {
};
GtkType nautilus_undo_transaction_get_type (void);
-NautilusUndoTransaction *nautilus_undo_transaction_new (const gchar *name);
-
+NautilusUndoTransaction *nautilus_undo_transaction_new (const char *operation_name,
+ const char *undo_menu_item_name,
+ const char *undo_menu_item_description,
+ const char *redo_menu_item_name,
+ const char *redo_menu_item_description);
gboolean nautilus_undo_transaction_add_undoable (NautilusUndoTransaction *transaction,
NautilusUndoable *undoable);
-const gchar *nautilus_undo_transaction_get_name (NautilusUndoTransaction *transaction);
gboolean nautilus_undo_transaction_contains_object (NautilusUndoTransaction *transaction,
GtkObject *object);
#endif
diff --git a/libnautilus/nautilus-undo.idl b/libnautilus/nautilus-undo.idl
index b7796e126..49476af93 100644
--- a/libnautilus/nautilus-undo.idl
+++ b/libnautilus/nautilus-undo.idl
@@ -50,7 +50,7 @@ module Nautilus {
*/
readonly attribute MenuItem undo_description;
readonly attribute MenuItem redo_description;
- readonly attribute string base_description;
+ readonly attribute string operation_name;
/* Here's how you actually perform an undo.
* Once it's performed, calling this again is
diff --git a/libnautilus/nautilus-undoable.c b/libnautilus/nautilus-undoable.c
index 41fa6ebaf..2bbdab4e4 100644
--- a/libnautilus/nautilus-undoable.c
+++ b/libnautilus/nautilus-undoable.c
@@ -299,7 +299,10 @@ nautilus_undo_register_full (GList *atoms,
}
/* Create an undo transaction */
- transaction = nautilus_undo_transaction_new (operation_name);
+ transaction = nautilus_undo_transaction_new (operation_name, undo_menu_item_name,
+ undo_menu_item_description,
+ redo_menu_item_name,
+ redo_menu_item_description);
for (p = atoms; p != NULL; p = p->next) {
atom = p->data;
diff --git a/src/nautilus-navigation-window-menus.c b/src/nautilus-navigation-window-menus.c
index f1e082aac..4260d07bb 100644
--- a/src/nautilus-navigation-window-menus.c
+++ b/src/nautilus-navigation-window-menus.c
@@ -1053,14 +1053,37 @@ update_eazel_theme_menu_item (NautilusWindow *window)
static void
update_undo_menu_item (NautilusWindow *window)
{
- NautilusUndoManager *undo_manager;
+ NautilusUndoManager *local_manager;
+ Nautilus_Undo_Manager undo_transaction;
+ Nautilus_Undo_MenuItem *menu_item;
+ gboolean update;
+ CORBA_Environment ev;
g_assert (NAUTILUS_IS_WINDOW (window));
- undo_manager = NAUTILUS_UNDO_MANAGER (NAUTILUS_APP (window->app)->undo_manager);
- if (undo_manager != NULL) {
- bonobo_ui_handler_menu_set_sensitivity(window->uih, NAUTILUS_MENU_PATH_UNDO_ITEM,
- nautilus_undo_manager_can_undo (undo_manager));
+ local_manager = NAUTILUS_UNDO_MANAGER (NAUTILUS_APP (window->app)->undo_manager);
+ if (local_manager != NULL) {
+ update = nautilus_undo_manager_can_undo (local_manager);
+
+ bonobo_ui_handler_menu_set_sensitivity(window->uih, NAUTILUS_MENU_PATH_UNDO_ITEM, update);
+
+ if (update) {
+ /* Get undo transaction name */
+ CORBA_exception_init(&ev);
+
+ undo_transaction = nautilus_undo_manager_get_current_undo_transaction (local_manager);
+ menu_item = Nautilus_Undo_Transaction__get_undo_description (undo_transaction, &ev);
+
+ bonobo_ui_handler_menu_set_label (window->uih, NAUTILUS_MENU_PATH_UNDO_ITEM, menu_item->name);
+
+ CORBA_free (menu_item);
+
+ CORBA_exception_free(&ev);
+ }
+ else {
+ bonobo_ui_handler_menu_set_label (window->uih, NAUTILUS_MENU_PATH_UNDO_ITEM, _("Undo"));
+ }
+
} else {
bonobo_ui_handler_menu_set_sensitivity(window->uih, NAUTILUS_MENU_PATH_UNDO_ITEM,
FALSE);
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index f1e082aac..4260d07bb 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -1053,14 +1053,37 @@ update_eazel_theme_menu_item (NautilusWindow *window)
static void
update_undo_menu_item (NautilusWindow *window)
{
- NautilusUndoManager *undo_manager;
+ NautilusUndoManager *local_manager;
+ Nautilus_Undo_Manager undo_transaction;
+ Nautilus_Undo_MenuItem *menu_item;
+ gboolean update;
+ CORBA_Environment ev;
g_assert (NAUTILUS_IS_WINDOW (window));
- undo_manager = NAUTILUS_UNDO_MANAGER (NAUTILUS_APP (window->app)->undo_manager);
- if (undo_manager != NULL) {
- bonobo_ui_handler_menu_set_sensitivity(window->uih, NAUTILUS_MENU_PATH_UNDO_ITEM,
- nautilus_undo_manager_can_undo (undo_manager));
+ local_manager = NAUTILUS_UNDO_MANAGER (NAUTILUS_APP (window->app)->undo_manager);
+ if (local_manager != NULL) {
+ update = nautilus_undo_manager_can_undo (local_manager);
+
+ bonobo_ui_handler_menu_set_sensitivity(window->uih, NAUTILUS_MENU_PATH_UNDO_ITEM, update);
+
+ if (update) {
+ /* Get undo transaction name */
+ CORBA_exception_init(&ev);
+
+ undo_transaction = nautilus_undo_manager_get_current_undo_transaction (local_manager);
+ menu_item = Nautilus_Undo_Transaction__get_undo_description (undo_transaction, &ev);
+
+ bonobo_ui_handler_menu_set_label (window->uih, NAUTILUS_MENU_PATH_UNDO_ITEM, menu_item->name);
+
+ CORBA_free (menu_item);
+
+ CORBA_exception_free(&ev);
+ }
+ else {
+ bonobo_ui_handler_menu_set_label (window->uih, NAUTILUS_MENU_PATH_UNDO_ITEM, _("Undo"));
+ }
+
} else {
bonobo_ui_handler_menu_set_sensitivity(window->uih, NAUTILUS_MENU_PATH_UNDO_ITEM,
FALSE);