? depcomp
? intltool-extract.in
? intltool-merge.in
? intltool-update.in
? plugins/changecase/changecase.loT
Index: gedit/gedit-commands.c
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-commands.c,v
retrieving revision 1.51.2.46
diff -u -r1.51.2.46 gedit-commands.c
--- gedit/gedit-commands.c	14 Jun 2005 15:09:09 -0000	1.51.2.46
+++ gedit/gedit-commands.c	15 Jun 2005 12:15:41 -0000
@@ -1191,7 +1191,7 @@
 
 	gtk_widget_grab_focus (GTK_WIDGET (active_view));
 }
-
+							 
 void 
 gedit_cmd_edit_cut (GtkAction   *action,
 		    GeditWindow *window)
Index: gedit/gedit-commands.h
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-commands.h,v
retrieving revision 1.10.10.7
diff -u -r1.10.10.7 gedit-commands.h
--- gedit/gedit-commands.h	12 May 2005 10:43:26 -0000	1.10.10.7
+++ gedit/gedit-commands.h	15 Jun 2005 12:15:41 -0000
@@ -81,6 +81,8 @@
 							 GeditWindow *window);
 void		gedit_cmd_edit_redo			(GtkAction   *action,
 							 GeditWindow *window);
+void		gedit_cmd_edit_update_undo	(GtkAction	 *action,
+							 GeditWindow *window);
 void		gedit_cmd_edit_cut			(GtkAction   *action,
 							 GeditWindow *window);
 void		gedit_cmd_edit_copy			(GtkAction   *action,
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 12:15:43 -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,78 @@
 	}
 }
 
+static void
+can_undo (GeditDocument *doc,
+          gboolean       can,
+          GeditWindow   *window)
+{
+	GtkAction *action;
+	gchar *undo,*label,*undo_trunc;
+    
+	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));
+        undo_trunc = gedit_utils_str_middle_truncate (undo, 25);
+
+		label = g_strconcat (_("Undo "), undo_trunc, NULL);
+
+        g_object_set (action, "label", label, NULL);
+
+		g_free (undo);
+        g_free (undo_trunc);
+		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,*undo_trunc;
+
+	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));
+        undo_trunc = gedit_utils_str_middle_truncate (undo, 25);
+
+		label = g_strconcat (_("Redo "), undo_trunc, NULL);
+
+		g_object_set (action, "label", label, NULL);
+
+		g_free (undo);
+        g_free (undo_trunc);
+		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 +524,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 +947,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 ();
@@ -895,7 +967,7 @@
 						    recent_tooltip_func_uim,
 						    window);
 	egg_recent_view_set_model (EGG_RECENT_VIEW (recent_view), recent_model);
-
+	
 	/* languages menu */
 	action_group = gtk_action_group_new ("LanguagesActions");
 	gtk_action_group_set_translation_domain (action_group, NULL);
@@ -1363,7 +1435,7 @@
 	GeditTab *tab;
 	GtkAction *action;
 	gchar *action_name;
-
+    
 	/* CHECK: I don't know why but it seems notebook_switch_page is called
 	two times every time the user change the active tab */
 	
@@ -1401,11 +1473,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 +1750,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
