diff -uw srcold/gnome-recorder.c src/gnome-recorder.c
--- srcold/gnome-recorder.c	2007-02-06 15:27:20.377735000 +0800
+++ src/gnome-recorder.c	2007-02-06 15:34:33.740268000 +0800
@@ -33,15 +33,15 @@
 #include <gst/gst.h>
 
 #include "gsr-window.h"
-#include "egg-recent-model.h"
 
 extern void gnome_media_profiles_init (GConfClient *conf);
  
 static GList *windows = NULL;
 
 GConfClient *gconf_client = NULL;
 
-EggRecentModel *recent_model = NULL;
 
 static gboolean
 delete_event_cb (GSRWindow *window,
@@ -88,42 +88,7 @@
 
 #define RECENT_HISTORY_LEN 5
 
-static void
-init_recent (void)
-{
-	/* global recent model */
-	recent_model = egg_recent_model_new (EGG_RECENT_MODEL_SORT_MRU);
-
-	egg_recent_model_set_filter_groups (recent_model, 
-					    "gnome-sound-recorder",
-					    NULL);
 
-	egg_recent_model_set_filter_uri_schemes (recent_model, "file", NULL);
-	egg_recent_model_set_limit (recent_model, RECENT_HISTORY_LEN);
-}
-
-void
-gsr_add_recent (gchar *filename)
-{
-	char *uri;
-	EggRecentItem *item;
-
-	g_return_if_fail (filename != NULL);
-
-	uri = g_filename_to_uri (filename, NULL, NULL);
-
-	if (uri) {
-		item = egg_recent_item_new_from_uri (uri);
-		g_return_if_fail (item != NULL);
-
-		egg_recent_item_add_group (item, "gnome-sound-recorder");
-		egg_recent_model_add_full (recent_model, item);
-
-		egg_recent_item_unref (item);
-	}
-
-	g_free (uri);
-}
 
 gint gsr_sample_count = 1;
 
@@ -196,7 +161,6 @@
 	                              GNOME_PARAM_APP_DATADIR, DATADIR,
 	                              NULL);
 
-	init_recent ();
 
 	gtk_window_set_default_icon_name ("gnome-grecord");
 
diff -uw srcold/gsr-window.c src/gsr-window.c
--- srcold/gsr-window.c	2007-02-06 15:27:20.378074000 +0800
+++ src/gsr-window.c	2007-02-06 15:35:22.631766000 +0800
@@ -2,7 +2,7 @@
 /*
  *  Authors: Iain Holmes <iain@prettypeople.org>
  *           Johan Dahlin <johan@gnome.org>
- *           Tim-Philipp Müller <tim centricular net>
+ *           Tim-Philipp M??ller <tim centricular net>
  *
  *  Copyright 2002 Iain Holmes
  *
@@ -46,10 +46,6 @@
 
 #include <profiles/gnome-media-profiles.h>
 
-#include "egg-recent-view.h"
-#include "egg-recent-view-gtk.h"
-#include "egg-recent-model.h"
-#include "egg-recent-util.h"
 
 #include "gsr-window.h"
 
@@ -61,8 +57,6 @@
 
 extern GConfClient *gconf_client;
 
-extern EggRecentModel *recent_model;
-extern void gsr_add_recent (gchar *filename);
 
 #define GCONF_DIR           "/apps/gnome-sound-recorder/"
 #define KEY_OPEN_DIR        GCONF_DIR "system-state/open-file-directory"
@@ -101,7 +95,12 @@
 
 	GtkUIManager *ui_manager;
 	GtkActionGroup *action_group;
-	EggRecentViewGtk *recent_view;
+        
+        /* recent files */         
+        GtkRecentManager *recent_manager;
+        GtkActionGroup *recent_action_group;
+        guint recent_ui_id;
+
 
 	/* statusbar */
 	GtkWidget *statusbar;
@@ -151,6 +150,9 @@
 static void                fill_record_input       (GSRWindow         *window);
 static GSRWindowPipeline * make_record_pipeline    (GSRWindow         *window);
 static GSRWindowPipeline * make_play_pipeline      (GSRWindow         *window);
+static void                init_recent             (GSRWindow         *window);
+static void                gsr_add_recent          (gchar* filename, GSRWindow *window);
+
 
 static void
 show_error_dialog (GtkWindow   *window,
@@ -390,52 +392,6 @@
 	g_free (directory);
 }
 
-static void
-file_open_recent_cb (EggRecentViewGtk *view,
-		     EggRecentItem *item,
-		     GSRWindow *window)
-{
-	gchar *uri;
-	gchar *filename;
-
-	uri = egg_recent_item_get_uri (item);
-	g_return_if_fail (uri != NULL);
-
-	if (!g_str_has_prefix (uri, "file://"))
-		return;
-
-	filename = g_filename_from_uri (uri, NULL, NULL);
-	if (filename == NULL)
-		goto out;
-
-	if (!g_file_test (filename, G_FILE_TEST_EXISTS)) {
-		gchar *filename_utf8;
-		GtkWidget *dlg;
-
-		filename_utf8 = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL);
-		dlg = gtk_message_dialog_new (GTK_WINDOW (window),
-					      GTK_DIALOG_MODAL,
-					      GTK_MESSAGE_ERROR,
-					      GTK_BUTTONS_OK,
-					      _("Unable to load file:\n%s"), filename_utf8);
-
-		gtk_widget_show (dlg);
-		gtk_dialog_run (GTK_DIALOG (dlg));
-		gtk_widget_destroy (dlg);
-
-		egg_recent_model_delete (recent_model, uri);
-
-		g_free (filename_utf8);
-		goto out;
-  	}
-
-		/* Set the file in this window */
-		g_object_set (G_OBJECT (window), "location", filename, NULL);
-
- out:
-	g_free (filename);
-	g_free (uri);
-}
 
 #if 0
 static gboolean
@@ -2014,6 +1970,27 @@
 		g_signal_connect (proxy, "deselect",
 				  G_CALLBACK (menu_item_deselect_cb), window);
 	}
+        GtkRecentInfo *recent_info;
+	GdkPixbuf *icon;
+	GtkWidget *image;
+	gint w, h;
+
+	recent_info = g_object_get_data (G_OBJECT (action), "recent-info");
+
+	if (recent_info == NULL) {
+		return;
+	}
+
+	if (GTK_IS_IMAGE_MENU_ITEM (proxy)) {
+		gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &w, &h);
+		icon = gtk_recent_info_get_icon (recent_info, w);
+
+		if (icon != NULL) {
+			image = gtk_image_new_from_pixbuf (icon);
+			gtk_image_menu_item_set_image
+				(GTK_IMAGE_MENU_ITEM (proxy), image);
+		}
+	}
 }
 
 static void
@@ -2106,6 +2083,7 @@
 	g_signal_connect (priv->ui_manager, "disconnect_proxy",
 			 G_CALLBACK (disconnect_proxy_cb), window);
 
+       
 	priv->action_group = gtk_action_group_new ("GSRWindowActions");
 	gtk_action_group_set_translation_domain (priv->action_group, NULL);
 	gtk_action_group_add_actions (priv->action_group,
@@ -2143,13 +2121,9 @@
 	submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (file_menu));
 	rec_menu = gtk_ui_manager_get_widget (priv->ui_manager,
 					      "/MenuBar/FileMenu/FileRecentMenu");
-	priv->recent_view = egg_recent_view_gtk_new (submenu, rec_menu);
-	egg_recent_view_gtk_show_icons (EGG_RECENT_VIEW_GTK (priv->recent_view),
-					FALSE);
-	egg_recent_view_gtk_set_trailing_sep (priv->recent_view, TRUE);
-	egg_recent_view_set_model (EGG_RECENT_VIEW (priv->recent_view), recent_model); 
-	g_signal_connect (priv->recent_view, "activate",
-			  G_CALLBACK (file_open_recent_cb), window);
+	
+	
+         
 
 	/* window content: hscale, labels, etc */
 	content_vbox = gtk_vbox_new (FALSE, 7);
@@ -2334,9 +2308,8 @@
 			gtk_label_set (GTK_LABEL (priv->name_label), short_name);
 		}
 
-		if (recent_model) {
-			gsr_add_recent (priv->filename);
-		}
+
+	        gsr_add_recent (priv->filename,window);
 
 		title = g_strdup_printf ("%s - Sound Recorder", short_name);
 		gtk_window_set_title (GTK_WINDOW (window), title);
@@ -2516,7 +2489,187 @@
 
 	window->priv->saved = TRUE;
 
+        init_recent (window);
+
 	gtk_window_set_default_size (GTK_WINDOW (window), 512, 200);
 
 	return GTK_WIDGET (window);
 }
+
+/* Recent files */
+static void
+on_recent_file_item_activated (GtkAction *action,
+                               GSRWindow *window)
+{
+	GtkRecentInfo *recent_info;
+	const gchar *uri;
+       const gchar *short_name;
+       const gchar *title;
+	
+	recent_info = g_object_get_data (G_OBJECT (action), "recent-info");
+	uri = gtk_recent_info_get_uri (recent_info);
+       
+        
+       window->priv->filename = g_strdup (uri);
+	window->priv->working_file = g_strdup (window->priv->filename);
+	window->priv->len_secs = 0;
+	short_name = g_path_get_basename (window->priv->filename);
+       window->priv->has_file = TRUE;
+       title = g_strdup_printf ("%s - Sound Recorder", short_name);
+	gtk_window_set_title (GTK_WINDOW (window), title);
+	g_free (title);
+	g_free (short_name);
+       g_free (uri);
+       
+       set_action_sensitive (window, "Play", window->priv->has_file ? TRUE : FALSE);
+	set_action_sensitive (window, "Stop", FALSE);
+	set_action_sensitive (window, "Record", TRUE);
+	set_action_sensitive (window, "FileSave", window->priv->has_file ? TRUE : FALSE);
+	set_action_sensitive (window, "FileSaveAs", window->priv->has_file ? TRUE : FALSE);
+		
+
+
+}
+
+void
+gsr_add_recent (gchar *filename, GSRWindow *window)
+{	     
+        
+       GtkRecentData data;
+	char *groups[] = { "gnome-sound-record", NULL };
+	char *display;
+
+	
+	display = g_strdup(filename);
+	if (display) {
+		data.display_name = g_filename_display_basename (display);
+		g_free (display);
+	}
+	data.description = NULL;
+	data.mime_type = gnome_vfs_get_mime_type (filename);
+	data.app_name = g_strdup (g_get_application_name ());
+	data.app_exec = g_strjoin (" ", g_get_prgname (), "%u", NULL);
+	data.groups = groups;
+	gtk_recent_manager_add_full (window->priv->recent_manager,
+			filename, &data);
+
+	g_free (data.display_name);
+	g_free (data.mime_type);
+	g_free (data.app_name);
+	g_free (data.app_exec);
+}
+
+static void
+gsr_recent_manager_changed_callback (GtkRecentManager *recent_manager, GSRWindow *window)
+{
+	GList *items, *l;
+	guint n_items = 0;
+	static guint i = 0;
+
+	gtk_ui_manager_remove_ui (window->priv->ui_manager, window->priv->recent_ui_id);
+	gtk_ui_manager_ensure_update (window->priv->ui_manager);
+
+	if (window->priv->recent_action_group) {
+		gtk_ui_manager_remove_action_group (window->priv->ui_manager,
+				window->priv->recent_action_group);
+		g_object_unref (window->priv->recent_action_group);
+	}
+	window->priv->recent_action_group = gtk_action_group_new ("recent-action-group");
+	gtk_ui_manager_insert_action_group (window->priv->ui_manager,
+			window->priv->recent_action_group, -1);
+ 
+	items = gtk_recent_manager_get_items (recent_manager);+	
+
+	for (l = items; l && l->data; l = g_list_next (l)) {
+		GtkRecentInfo *info;
+		GtkAction     *action;
+		gchar         *action_name;
+		gchar         *label;
+
+		info = (GtkRecentInfo *) l->data;
+
+		if (!gtk_recent_info_has_group (info, "gnome-sound-record"))
+			continue;
+
+		action_name = g_strdup_printf ("recent-file%u", i++);
+		label = g_strdup_printf ("_%d.  %s", n_items + 1,
+				gtk_recent_info_get_display_name (info));
+
+		action = g_object_new (GTK_TYPE_ACTION,
+			       "name", action_name,
+			       "label", label,
+			       NULL);
+
+		g_object_set_data_full (G_OBJECT (action), "recent-info",
+				gtk_recent_info_ref (info),
+				(GDestroyNotify) gtk_recent_info_unref);
+		g_signal_connect (G_OBJECT (action), "activate",
+			  	G_CALLBACK (on_recent_file_item_activated),
+				window);
+
+		gtk_action_group_add_action (window->priv->recent_action_group,
+				action);
+		g_object_unref (action);
+
+		gtk_ui_manager_add_ui (window->priv->ui_manager, window->priv->recent_ui_id,
+			       "/MenuBar/FileMenu/FileRecentMenu",
+			       label, action_name, GTK_UI_MANAGER_MENUITEM,
+			       FALSE);
+                
+		g_free (action_name);
+		g_free (label);
+
+		if (++n_items == 5)
+			break;
+	}
+       gtk_ui_manager_add_ui (window->priv->ui_manager, window->priv->recent_ui_id,
+                                "/MenuBar/FileMenu/FileRecentMenu",
+			       "PageInfoSep2", NULL,
+			       GTK_UI_MANAGER_SEPARATOR, FALSE);
+
+	gtk_ui_manager_ensure_update (window->priv->ui_manager);
+
+	g_list_foreach (items, (GFunc) gtk_recent_info_unref, NULL);
+	g_list_free (items);
+}
+void
+init_recent (GSRWindow *window)
+{
+	window->priv->recent_manager = gtk_recent_manager_get_default ();
+	window->priv->recent_action_group = NULL;
+	window->priv->recent_ui_id = gtk_ui_manager_new_merge_id
+			(window->priv->ui_manager);
+
+	g_signal_connect (G_OBJECT (window->priv->recent_manager), "changed",
+			G_CALLBACK (gsr_recent_manager_changed_callback),
+			window);
+
+	gsr_recent_manager_changed_callback (window->priv->recent_manager, window);
+}
+static void
+ui_manager_connect_proxy_callback (GtkUIManager *ui_manager,
+		GtkAction *action, GtkWidget *widget, GSRWindow *window)
+{
+	GtkRecentInfo *recent_info;
+	GdkPixbuf *icon;
+	GtkWidget *image;
+	gint w, h;
+
+	recent_info = g_object_get_data (G_OBJECT (action), "recent-info");
+
+	if (recent_info == NULL) {
+		return;
+	}
+
+	if (GTK_IS_IMAGE_MENU_ITEM (widget)) {
+		gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &w, &h);
+		icon = gtk_recent_info_get_icon (recent_info, w);
+
+		if (icon != NULL) {
+			image = gtk_image_new_from_pixbuf (icon);
+			gtk_image_menu_item_set_image
+				(GTK_IMAGE_MENU_ITEM (widget), image);
+		}
+	}
+}
