? depcomp
? intltool-extract.in
? intltool-merge.in
? intltool-update.in
? plugins/changecase/changecase.loT
Index: gedit/gedit-window.c
===================================================================
RCS file: /cvs/gnome/gedit/gedit/Attic/gedit-window.c,v
retrieving revision 1.4.2.78
diff -u -r1.4.2.78 gedit-window.c
--- gedit/gedit-window.c	14 Jun 2005 14:58:21 -0000	1.4.2.78
+++ gedit/gedit-window.c	15 Jun 2005 15:45:23 -0000
@@ -38,6 +38,7 @@
 #include <string.h>
 
 #include <glib/gi18n.h>
+#include <gtksourceview/gtksourcebuffer.h>
 #include <gtksourceview/gtksourcelanguage.h>
 #include <gtksourceview/gtksourcelanguagesmanager.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
@@ -325,6 +326,72 @@
 	}
 }
 
+static void
+can_undo (GeditDocument *doc,
+          gboolean       can,
+          GeditWindow   *window)
+{
+	GtkAction *action;
+	gchar *undo,*label;
+    
+	if (doc != gedit_window_get_active_document (window))
+		return;
+		
+	action = gtk_action_group_get_action (window->priv->action_group,
+					     "EditUndo");
+	gtk_action_set_sensitive (action, can);
+	
+	if (can)
+	{
+		/* We have things to undo, update the menu item		
+		  This will become somthing like "Undo deletion of 'xxx'" */
+		undo = gtk_source_buffer_get_undo_action (GTK_SOURCE_BUFFER (doc));
+		label = g_strdup_printf (_("Undo %s"), undo);
+
+		g_object_set (action, "label", label, NULL);
+
+		g_free (undo);
+		g_free (label);
+	}
+	else
+	{
+		g_object_set (action, "label", _("Undo"), NULL);
+	}
+}
+
+static void
+can_redo (GeditDocument *doc,
+          gboolean       can,
+          GeditWindow   *window)
+{
+	GtkAction *action;
+	gchar *undo,*label;
+
+	if (doc != gedit_window_get_active_document (window))
+		return;
+
+	action = gtk_action_group_get_action (window->priv->action_group,
+					     "EditRedo");
+	gtk_action_set_sensitive (action, can);
+
+	if (can)
+	{
+		/* We have things to redo, update the menu item
+		   This will become somthing like "Redo typing of 'xxx'" */
+		undo = gtk_source_buffer_get_redo_action (GTK_SOURCE_BUFFER (doc));
+		label = g_strdup_printf (_("Redo %s"), undo);
+
+		g_object_set (action, "label", label, NULL);
+
+		g_free (undo);
+		g_free (label);
+	}
+	else
+	{
+		g_object_set (action, "label", _("Redo"), NULL);
+	}
+}
+
 /* Returns TRUE if toolbar is visible */
 static gboolean
 set_toolbar_style (GeditWindow *window,
@@ -451,17 +518,9 @@
 	gtk_action_set_sensitive (action,
 				  state != GEDIT_TAB_STATE_SAVING);
 
-	action = gtk_action_group_get_action (window->priv->action_group,
-					      "EditUndo");
-	gtk_action_set_sensitive (action, 
-				  state_normal &&
-				  gtk_source_buffer_can_undo (GTK_SOURCE_BUFFER (doc)));
-
-	action = gtk_action_group_get_action (window->priv->action_group,
-					      "EditRedo");
-	gtk_action_set_sensitive (action, 
-				  state_normal &&
-				  gtk_source_buffer_can_redo (GTK_SOURCE_BUFFER (doc)));
+    /* Special handling for Undo/Redo, we must also change the label */
+	can_undo (doc, gtk_source_buffer_can_undo (GTK_SOURCE_BUFFER (doc)), window);
+	can_redo (doc, gtk_source_buffer_can_redo (GTK_SOURCE_BUFFER (doc)), window);
 
 	action = gtk_action_group_get_action (window->priv->action_group,
 					      "EditCut");
@@ -882,6 +941,13 @@
 	g_object_set (action, "is_important", TRUE, NULL);
 	action = gtk_action_group_get_action (action_group, "EditUndo");
 	g_object_set (action, "is_important", TRUE, NULL);
+    
+	/* Set short names for Undo/Redo on the toolbar */
+	action = gtk_action_group_get_action (action_group, "EditUndo");
+	g_object_set (action, "short_label", _("Undo"), NULL);
+
+	action = gtk_action_group_get_action (action_group, "EditRedo");
+	g_object_set (action, "short_label", _("Redo"), NULL);
 
 	/* recent files menu */
 	recent_model = gedit_recent_get_model ();
@@ -1401,11 +1467,11 @@
 					  window);
 	gedit_statusbar_set_overwrite (GEDIT_STATUSBAR (window->priv->statusbar),
 				       gtk_text_view_get_overwrite (GTK_TEXT_VIEW (view)));
-				       
+
 	g_signal_emit (G_OBJECT (window), 
 		       signals[ACTIVE_TAB_CHANGED], 
 		       0, 
-		       window->priv->active_tab);				       
+		       window->priv->active_tab);
 }
 
 static void
@@ -1678,36 +1744,6 @@
 	gtk_target_list_unref (tl);
 
 	return result;
-}
-
-static void
-can_undo (GeditDocument *doc,
-          gboolean       can,
-          GeditWindow   *window)
-{
-	GtkAction *action;
-	
-	if (doc != gedit_window_get_active_document (window))
-		return;
-		
-	action = gtk_action_group_get_action (window->priv->action_group,
-					     "EditUndo");
-	gtk_action_set_sensitive (action, can);
-}
-
-static void
-can_redo (GeditDocument *doc,
-          gboolean       can,
-          GeditWindow   *window)
-{
-	GtkAction *action;
-
-	if (doc != gedit_window_get_active_document (window))
-		return;
-	
-	action = gtk_action_group_get_action (window->priv->action_group,
-					     "EditRedo");
-	gtk_action_set_sensitive (action, can);
 }
 
 static void
