Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/totem/src/Makefile.am,v
retrieving revision 1.161
diff -u -p -r1.161 Makefile.am
--- Makefile.am	17 Jun 2006 13:00:53 -0000	1.161
+++ Makefile.am	1 Aug 2006 13:42:08 -0000
@@ -37,18 +37,6 @@ nautilus_LTLIBRARIES = $(TOTEM_PROPERTIE
 
 modules_flags = -export_dynamic -avoid-version -module
 
-EGG_RECENT_FILES =                      \
-	egg-recent-model.c              \
-        egg-recent-model.h              \
-	egg-recent-item.c               \
-	egg-recent-item.h               \
-	egg-recent-view.c               \
-	egg-recent-view.h               \
-	egg-recent-view-gtk.c           \
-        egg-recent-view-gtk.h           \
-	egg-recent-util.c               \
-	egg-recent-util.h
-
 BACON_VOLUME = \
 	bacon-volume.c			\
 	bacon-volume.h
@@ -65,10 +53,8 @@ BACON_V4L_SELECTION =			\
 	bacon-v4l-selection.c		\
 	bacon-v4l-selection.h
 
-EGGDIR=$(srcdir)/../../libegg/libegg/recent-files/
 BACONDIR=$(srcdir)/../../libbacon/src
 regenerate-built-sources:
-	EGGFILES="$(EGG_RECENT_FILES)" EGGDIR="$(EGGDIR)" $(srcdir)/update-from-egg.sh || true
 	EGGFILES="$(BACON_MESSAGE_CONNECTION) $(BACON_VOLUME)" EGGDIR="$(BACONDIR)" $(srcdir)/update-from-egg.sh || true
 
 libbaconpropertiespage_la_SOURCES = \
@@ -79,7 +65,6 @@ libbaconpropertiespage_la_SOURCES = \
 
 
 totem_SOURCES = 					\
-	$(EGG_RECENT_FILES)				\
 	totem.c totem.h					\
 	totem-remote.c totem-remote.h			\
 	totem-preferences.c totem-preferences.h		\
Index: totem-menu.c
===================================================================
RCS file: /cvs/gnome/totem/src/totem-menu.c,v
retrieving revision 1.21
diff -u -p -r1.21 totem-menu.c
--- totem-menu.c	13 Jun 2006 09:21:53 -0000	1.21
+++ totem-menu.c	1 Aug 2006 13:42:09 -0000
@@ -31,7 +31,6 @@
 #include "totem.h"
 #include "totem-private.h"
 #include "bacon-video-widget.h"
-#include "egg-recent-view.h"
 
 /* ISO-639 helpers */
 static GHashTable *lang_table;
@@ -431,6 +430,7 @@ totem_sublang_exit (Totem *totem)
 }
 
 /* Recent files */
+#if 0
 static void
 on_recent_file_activate (EggRecentViewGtk *view, EggRecentItem *item,
                          Totem *totem)
@@ -445,7 +445,7 @@ on_recent_file_activate (EggRecentViewGt
 
 	end = totem_playlist_get_last (totem->playlist);
 	playlist_changed = totem_playlist_add_mrl (totem->playlist, uri, NULL);
-	egg_recent_model_add_full (totem->recent_model, item);
+	egg_recent_manager_add_full (totem->recent_manager, item);
 
 	totem_signal_unblock_by_data (totem->playlist, totem);
 
@@ -461,31 +461,34 @@ on_recent_file_activate (EggRecentViewGt
 
 	g_free (uri);
 }
+#endif
 
-static void
-totem_remove_deleted_recent (Totem *totem)
+static int
+totem_recent_find_menu_offset (GtkWidget *menu, GtkWidget *sep)
 {
-	GList *files, *l;
+	int i;
+	GList *menu_children;
+	GList *p;
+	GtkWidget *menu_item;
+	gint menu_loc=-1;
 
-	files = egg_recent_model_get_list (totem->recent_model);
-	for (l = files; l != NULL; l = l->next) {
-		EggRecentItem *item = l->data;
-		const char *txturi;
-		GnomeVFSURI *uri;
-
-		txturi = egg_recent_item_peek_uri (item);
-		if (txturi == NULL)
-			continue;
-
-		if (g_str_has_prefix (txturi, "file:") == FALSE)
-			continue;
-
-		uri = gnome_vfs_uri_new (txturi);
-		if (gnome_vfs_uri_exists (uri) == FALSE) {
-			egg_recent_model_delete (totem->recent_model, txturi);
+	menu_children = GTK_MENU_SHELL (menu)->children;
+
+	i = 0;
+	p = menu_children;
+	while (p != NULL) {
+		menu_item = (GtkWidget *)p->data;
+
+		if (menu_item == sep) {
+			menu_loc = i;
+			break;
 		}
-		gnome_vfs_uri_unref (uri);
+
+		p = p->next;
+		i++;
 	}
+
+	return menu_loc;
 }
 
 void
@@ -493,6 +496,7 @@ totem_setup_recent (Totem *totem)
 {
 	GtkWidget *menu_item;
 	GtkWidget *menu;
+	GtkRecentFilter *filter;
 
 	menu_item = glade_xml_get_widget (totem->xml, "tmw_menu_item_movie");
 	menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item));
@@ -502,35 +506,42 @@ totem_setup_recent (Totem *totem)
 	/* it would be better if we just filtered by mime-type, but there
 	 * doesn't seem to be an easy way to figure out which mime-types we
 	 * can handle */
-	totem->recent_model = egg_recent_model_new (EGG_RECENT_MODEL_SORT_MRU);
-
-	totem->recent_view = egg_recent_view_gtk_new (menu, menu_item);
-	egg_recent_view_gtk_show_icons (EGG_RECENT_VIEW_GTK
-			(totem->recent_view), FALSE);
-	egg_recent_model_set_limit (totem->recent_model, 5);
-	egg_recent_view_set_model (EGG_RECENT_VIEW (totem->recent_view),
-			totem->recent_model);
-	egg_recent_model_set_filter_groups (totem->recent_model,
-			"Totem", NULL);
-	egg_recent_view_gtk_set_trailing_sep (totem->recent_view, TRUE);
-
-	totem_remove_deleted_recent (totem);
+	totem->recent_manager = gtk_recent_manager_get_default ();
 
-	g_signal_connect (totem->recent_view, "activate",
-			G_CALLBACK (on_recent_file_activate), totem);
+	totem->recent_menu = gtk_recent_chooser_menu_new_for_manager
+		(totem->recent_manager);
+	gtk_recent_chooser_set_show_icons (GTK_RECENT_CHOOSER
+			(totem->recent_menu), FALSE);
+	gtk_recent_chooser_set_limit (GTK_RECENT_CHOOSER
+			(totem->recent_menu), 5);
+	gtk_recent_chooser_set_show_not_found (GTK_RECENT_CHOOSER
+			(totem->recent_menu), FALSE);
+	filter = gtk_recent_filter_new ();
+	gtk_recent_filter_add_group (filter, "Totem");
+	gtk_recent_chooser_set_filter (GTK_RECENT_CHOOSER
+			(totem->recent_menu), filter);
+	gtk_menu_shell_insert (GTK_MENU_SHELL (menu), totem->recent_menu,
+			totem_recent_find_menu_offset (menu, menu_item));
+//	egg_recent_menu_gtk_set_trailing_sep (totem->recent_menu, TRUE);
+
+	//FIXME?
+//	g_signal_connect (totem->recent_menu, "activate",
+//			G_CALLBACK (on_recent_file_activate), totem);
 }
 
 void
 totem_action_add_recent (Totem *totem, const char *filename)
 {
-	EggRecentItem *item;
+	GtkRecentData data;
+	char *groups[] = { "Totem", NULL };
 
 	if (strstr (filename, "file:///") == NULL)
 		return;
 
-	item = egg_recent_item_new_from_uri (filename);
-	egg_recent_item_add_group (item, "Totem");
-	egg_recent_model_add_full (totem->recent_model, item);
+	data.mime_type = gnome_vfs_get_mime_type (filename);
+	data.groups = groups;
+	gtk_recent_manager_add_full (totem->recent_manager,
+			filename, &data);
 }
 
 /* Play Disc menu items */
Index: totem-private.h
===================================================================
RCS file: /cvs/gnome/totem/src/totem-private.h,v
retrieving revision 1.40
diff -u -p -r1.40 totem-private.h
--- totem-private.h	18 Jun 2006 17:11:35 -0000	1.40
+++ totem-private.h	1 Aug 2006 13:42:09 -0000
@@ -31,11 +31,10 @@
 #include <glade/glade.h>
 #include <gconf/gconf-client.h>
 #include <libgnomevfs/gnome-vfs.h>
+#include <gtk/gtk.h>
 
 #include "totem-remote.h"
 #include "totem-scrsaver.h"
-#include "egg-recent-model.h"
-#include "egg-recent-view-gtk.h"
 #include "totem-playlist.h"
 #include "bacon-message-connection.h"
 #include "bacon-video-widget.h"
@@ -131,8 +130,8 @@ struct Totem {
 	TotemScrsaver *scr;
 
 	/* recent file stuff */
-	EggRecentModel *recent_model;
-	EggRecentViewGtk *recent_view;
+	GtkRecentManager *recent_manager;
+	GtkWidget *recent_menu;
 
 	/* Monitor for playlist unmounts and drives/volumes monitoring */
 	GnomeVFSVolumeMonitor *monitor;
