? copy-src/ccc/reference/tmpl/item.sgml
? doc/reference/tmpl/application.sgml
? doc/reference/tmpl/block.sgml
? doc/reference/tmpl/presentation-parser.sgml
? doc/reference/tmpl/presentation.sgml
? doc/reference/tmpl/slide.sgml
? doc/reference/tmpl/theme.sgml
? src/widgets/.cria-main-window.c.swp
Index: configure.in
===================================================================
RCS file: /cvs/gnome/criawips/configure.in,v
retrieving revision 1.84.2.1
diff -u -r1.84.2.1 configure.in
--- configure.in	1 Nov 2006 19:33:52 -0000	1.84.2.1
+++ configure.in	17 Nov 2006 22:55:43 -0000
@@ -229,7 +229,6 @@
   copy-src/ccc/reference/Makefile
   copy-src/cdebug/Makefile
   copy-src/helpers/Makefile
-  copy-src/recent-files/Makefile
   
   data/Makefile
   doc/Makefile
Index: copy-src/Makefile.am
===================================================================
RCS file: /cvs/gnome/criawips/copy-src/Makefile.am,v
retrieving revision 1.3
diff -u -r1.3 Makefile.am
--- copy-src/Makefile.am	19 Jul 2005 23:22:47 -0000	1.3
+++ copy-src/Makefile.am	17 Nov 2006 22:55:43 -0000
@@ -9,6 +9,5 @@
 	cdebug	\
 	helpers	\
 	ccc	\
-	recent-files	\
 	$(NULL)
 
Index: data/criawips.desktop.in
===================================================================
RCS file: /cvs/gnome/criawips/data/criawips.desktop.in,v
retrieving revision 1.5
diff -u -r1.5 criawips.desktop.in
--- data/criawips.desktop.in	26 Jan 2005 15:09:37 -0000	1.5
+++ data/criawips.desktop.in	17 Nov 2006 22:55:43 -0000
@@ -3,7 +3,7 @@
 _Name=Criawips Presentations
 _GenericName=Presentations
 _Comment=Create, modify or show Presentations 
-Exec=criawips %F_OR_U
+Exec=criawips %U
 Icon=criawips
 Terminal=false
 Type=Application
Index: data/criawips.ui
===================================================================
RCS file: /cvs/gnome/criawips/data/criawips.ui,v
retrieving revision 1.20.2.2
diff -u -r1.20.2.2 criawips.ui
--- data/criawips.ui	4 Nov 2006 23:55:37 -0000	1.20.2.2
+++ data/criawips.ui	17 Nov 2006 22:55:43 -0000
@@ -3,7 +3,7 @@
 		<menu action="FileMenu">
 			<menuitem name="New" action="FileNew" />
 			<menuitem name="Open" action="FileOpen" />
-			<menu action="RecentDocuments" />
+			<menuitem name="RecentDocuments" action="RecentDocuments" />
 			<separator/>
 			<menuitem name="Save" action="FileSave" />
 			<menuitem name="SaveAs" action="FileSaveAs" />
Index: doc/reference/Makefile.am
===================================================================
RCS file: /cvs/gnome/criawips/doc/reference/Makefile.am,v
retrieving revision 1.3
diff -u -r1.3 Makefile.am
--- doc/reference/Makefile.am	14 Aug 2005 19:36:20 -0000	1.3
+++ doc/reference/Makefile.am	17 Nov 2006 22:55:44 -0000
@@ -30,12 +30,6 @@
 
 # Header files to ignore when scanning.
 IGNORE_HFILES=\
-	egg-recent-item.h	\
-	egg-recent-model.h	\
-	egg-recent-util.h	\
-	egg-recent-view.h	\
-	egg-recent-view-bonobo.h\
-	egg-recent-view-gtk.h	\
 	enumerations.h		\
 	enum-vhead.h		\
 	g-template.h		\
@@ -67,7 +61,6 @@
 	$(OBJECT_CFLAGS)			\
 	$(NULL)
 GTKDOC_LIBS=\
-	$(top_builddir)/copy-src/recent-files/librecent.la	\
 	$(top_builddir)/copy-src/helpers/libhelpers.la		\
 	$(top_builddir)/src/dom/libcriawips-dom.la		\
 	$(top_builddir)/src/io/libcriawips-io.la		\
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/criawips/src/Makefile.am,v
retrieving revision 1.88
diff -u -r1.88 Makefile.am
--- src/Makefile.am	2 Oct 2005 16:23:15 -0000	1.88
+++ src/Makefile.am	17 Nov 2006 22:55:44 -0000
@@ -45,7 +45,6 @@
 	$(NULL)
 libcria_gui_la_LIBADD=\
 	$(top_builddir)/copy-src/ccc/libccc.la		\
-	$(top_builddir)/copy-src/recent-files/librecent.la \
 	cut-n-paste/libcria-cutnpaste.la		\
 	helpers/libcria-helpers.la			\
 	widgets/libcriawips-widgets.la			\
Index: src/application.c
===================================================================
RCS file: /cvs/gnome/criawips/src/application.c,v
retrieving revision 1.61.2.1
diff -u -r1.61.2.1 application.c
--- src/application.c	5 Nov 2006 00:15:27 -0000	1.61.2.1
+++ src/application.c	17 Nov 2006 22:55:46 -0000
@@ -66,7 +66,6 @@
 
 struct _CriaApplicationPriv {
 	GList		     * windows;
-	EggRecentModel	     * recent_model;
 	PangoFontDescription * default_font;
 	GConfClient          * gconf_client;
 	gboolean	       disable_screensaver;
@@ -650,11 +649,6 @@
 	self->priv = g_new0(CriaApplicationPriv,1);
 	self->priv->windows = NULL;
 
-	/* Initialise the recent-files support */
-	self->priv->recent_model = egg_recent_model_new(EGG_RECENT_MODEL_SORT_MRU);
-	egg_recent_model_set_filter_groups(self->priv->recent_model, PACKAGE, NULL);
-	egg_recent_model_set_limit(self->priv->recent_model, 5);
-
 	/* Initialise the preferences */
 	/* Initialise GConf */
 	self->priv->gconf_client = gconf_client_get_default();
@@ -844,24 +838,6 @@
 	}
 
 	return type;
-}
-
-EggRecentModel *
-cria_application_get_recent_model(void) {
-	return self->priv->recent_model;
-}
-
-void
-cria_application_add_to_recent(const gchar* text_uri) {
-	EggRecentModel	* recent_model;
-	EggRecentItem	* recent_item;
-
-	recent_model = cria_application_get_recent_model();
-
-	recent_item = egg_recent_item_new_from_uri(text_uri);
-	egg_recent_item_add_group(recent_item, PACKAGE);
-	egg_recent_model_add_full(recent_model, recent_item);
-	egg_recent_item_unref(recent_item);
 }
 
 PangoFontDescription *
Index: src/application.h
===================================================================
RCS file: /cvs/gnome/criawips/src/application.h,v
retrieving revision 1.28
diff -u -r1.28 application.h
--- src/application.h	7 Aug 2005 21:04:25 -0000	1.28
+++ src/application.h	17 Nov 2006 22:55:47 -0000
@@ -27,7 +27,6 @@
 #define APPLICATION_H
 
 #include <gconf/gconf-client.h>
-#include <recent-files/egg-recent-model.h>
 
 #include <goffice/utils/go-font.h>
 
@@ -70,8 +69,6 @@
 void		  cria_application_show_error_dialog   (GtkWindow	* parent,
 							gchar const	* primary,
 							gchar const	* secondary);
-EggRecentModel	* cria_application_get_recent_model    (void);
-void		  cria_application_add_to_recent       (const	gchar	* text_uri);
 PangoFontDescription * cria_application_get_default_font(void);
 void                   cria_application_set_default_font_name(const gchar* font);
 
Index: src/dom/cria-presentation.c
===================================================================
RCS file: /cvs/gnome/criawips/src/dom/cria-presentation.c,v
retrieving revision 1.6.2.3
diff -u -r1.6.2.3 cria-presentation.c
--- src/dom/cria-presentation.c	17 Nov 2006 12:54:53 -0000	1.6.2.3
+++ src/dom/cria-presentation.c	17 Nov 2006 22:55:48 -0000
@@ -302,9 +302,6 @@
 		}
 		
 		self = NULL;
-	} else {
-		cria_application_add_to_recent(uri);
-		cdebugo(self, "newFromFile()", "added uri '%s'", uri);
 	}
 
 	cdebugo(self, "newFromFile()", "end");
Index: src/widgets/cria-main-window.c
===================================================================
RCS file: /cvs/gnome/criawips/src/widgets/cria-main-window.c,v
retrieving revision 1.17.2.10
diff -u -r1.17.2.10 cria-main-window.c
--- src/widgets/cria-main-window.c	17 Nov 2006 12:54:54 -0000	1.17.2.10
+++ src/widgets/cria-main-window.c	17 Nov 2006 22:55:53 -0000
@@ -40,6 +40,8 @@
 #include <gtk/gtk.h>
 #include <libgnomeui/libgnomeui.h>
 #include <libgnomevfs/gnome-vfs-ops.h>
+#include <libgnomevfs/gnome-vfs-mime-utils.h>
+#include <libgnomevfs/gnome-vfs-utils.h>
 #include <goffice/gtk/go-action-combo-text.h>
 
 #define CDEBUG_TYPE cria_main_window_get_type
@@ -63,8 +65,6 @@
 
 #include "application.h"
 
-#include <recent-files/egg-recent.h>
-
 enum {
 	PROP_0,
 	PROP_PRESENTATION,
@@ -95,12 +95,15 @@
 			* title_bar;
 	GladeXML	* xml;
 	GtkUIManager	* ui_manager;
-	GtkActionGroup  * action_group;
+	GtkActionGroup  * action_group,
+			 *recent_action_group;
+	guint		  recent_ui_id;
 	GtkAction	* font_family,
 			* font_size,
 			* zoom;
 	CriaPresentation* presentation;
-	EggRecentView	* recent_view;
+	GtkRecentManager *recent_manager;
+	guint		  recent_manager_changed_id;
 	guint		  geometry_timeout_id,
 			  paned_timeout_id,
 			  paned_timeout_id_templates;
@@ -126,7 +129,6 @@
 static	guint	cria_main_window_signals[N_SIGNALS] = { 0 };
 #endif
 
-static void cb_recent_files_open(GtkAction *action, CriaMainWindow* self);
 static void cmw_init_actions(CriaMainWindow* self);
 static GtkActionEntry entries[];
 static GtkToggleActionEntry toggle_entries[];
@@ -347,6 +349,78 @@
 }
 
 static void
+main_window_recent_item_activated (GtkRecentChooser *chooser, CriaMainWindow *main_window)
+{
+	GtkRecentInfo *recent_info;
+	const gchar *text_uri;
+
+	g_return_if_fail (GTK_IS_RECENT_CHOOSER (chooser));
+	g_return_if_fail (CRIA_IS_MAIN_WINDOW (main_window));
+
+	recent_info = gtk_recent_chooser_get_current_item (chooser);
+	text_uri = gtk_recent_info_get_uri (recent_info);
+	gtk_recent_info_unref (recent_info);
+
+	cria_main_window_set_presentation_from_text_uri(main_window, text_uri);
+}
+
+static void
+main_window_realize (GtkWidget *widget) {
+	CriaMainWindow *main_window;
+	GdkScreen *screen;
+	GtkWidget *menu, *recent_menu_item;
+	GtkRecentFilter *filter;
+
+	g_return_if_fail (CRIA_IS_MAIN_WINDOW (widget));
+
+	GTK_WIDGET_CLASS (cria_main_window_parent_class)->realize (widget);
+
+	main_window = CRIA_MAIN_WINDOW (widget);
+
+	screen = gtk_widget_get_screen (widget);
+	main_window->priv->recent_manager = gtk_recent_manager_get_for_screen (screen);
+
+	menu = gtk_recent_chooser_menu_new_for_manager (main_window->priv->recent_manager);
+	gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (menu), GTK_RECENT_SORT_MRU);
+
+	filter = gtk_recent_filter_new ();
+	gtk_recent_filter_add_application (filter, g_get_application_name ());
+	gtk_recent_chooser_set_filter (GTK_RECENT_CHOOSER (menu), filter);
+
+	g_signal_connect (G_OBJECT (menu), "item-activated", G_CALLBACK (main_window_recent_item_activated), main_window);
+
+	recent_menu_item = gtk_ui_manager_get_widget (main_window->priv->ui_manager, "/menubar/FileMenu/RecentDocuments");
+	gtk_menu_item_set_submenu (GTK_MENU_ITEM (recent_menu_item), menu);
+}
+
+static void
+main_window_screen_changed (GtkWidget *widget, GdkScreen *screen) {
+	CriaMainWindow *main_window;
+	GtkWidget *menu, *recent_menu_item;
+	GtkRecentFilter *filter;
+
+	g_return_if_fail (CRIA_IS_MAIN_WINDOW (widget));
+
+	main_window = CRIA_MAIN_WINDOW (widget);
+
+	main_window->priv->recent_manager = gtk_recent_manager_get_for_screen (screen);
+
+	menu = gtk_recent_chooser_menu_new_for_manager (main_window->priv->recent_manager);
+	gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (menu), GTK_RECENT_SORT_MRU);
+
+	filter = gtk_recent_filter_new ();
+	gtk_recent_filter_add_application (filter, g_get_application_name ());
+	gtk_recent_chooser_set_filter (GTK_RECENT_CHOOSER (menu), filter);
+
+	g_signal_connect (G_OBJECT (menu), "item-activated", G_CALLBACK (main_window_recent_item_activated), main_window);
+
+	recent_menu_item = gtk_ui_manager_get_widget (main_window->priv->ui_manager, "/menubar/FileMenu/RecentDocuments");
+	gtk_menu_item_set_submenu (GTK_MENU_ITEM (recent_menu_item), menu);
+
+	GTK_WIDGET_CLASS (cria_main_window_parent_class)->screen_changed (widget, screen);
+}
+
+static void
 cria_main_window_class_init(CriaMainWindowClass* self_class) {
 	GObjectClass	* go_class;
 	GtkWidgetClass  * gw_class;
@@ -370,6 +444,8 @@
 	gw_class->configure_event    = cmw_configure_event;
 	gw_class->drag_data_received = cmw_drag_data_received;
 	gw_class->delete_event       = cmw_delete_event;
+	gw_class->realize = main_window_realize;
+	gw_class->screen_changed = main_window_screen_changed;
 	gw_class->window_state_event = cmw_window_state_event;
 
 	_cria_slide_view_install_properties(go_class, PROP_SLIDE);
@@ -701,10 +777,8 @@
 static void
 cria_main_window_init(CriaMainWindow* self) {
 	GtkWidget	* helper,
-			* recent_widget,
 			* scrolled,
 			* text_pane;
-	EggRecentModel	* recent_model;
 	GError		* error = NULL;
 	
 	static GtkTargetEntry drag_types[] = {
@@ -764,13 +838,9 @@
 	self->priv->vbox = glade_xml_get_widget(self->priv->xml, "main_vbox");
 	gtk_container_add(GTK_CONTAINER(self), self->priv->vbox);
 
-	/* Recent files support using egg-recent */	
-	recent_model = cria_application_get_recent_model();
-
-	self->priv->recent_view = EGG_RECENT_VIEW(egg_recent_view_uimanager_new(self->priv->ui_manager, "/menubar/FileMenu/RecentDocuments", G_CALLBACK(cb_recent_files_open), self));
-
-	egg_recent_view_set_model(EGG_RECENT_VIEW(self->priv->recent_view), recent_model);
-	recent_widget = gtk_ui_manager_get_widget(self->priv->ui_manager, "/menubar/FileMenu/RecentDocuments");
+	/* Recent files support using gtk recent file support */
+	self->priv->recent_action_group = NULL;
+	self->priv->recent_ui_id = gtk_ui_manager_new_merge_id (self->priv->ui_manager);
 
 	/* master slide menus */
 	self->theme_actions = cria_theme_actions_new(self->priv->ui_manager, "/menubar/MasterSlideMenu/MasterSlideApply");
@@ -912,6 +982,33 @@
 	return GTK_WIDGET(self);
 }
 
+static void
+cria_main_window_add_to_recent(CriaMainWindow *main_window, const gchar *text_uri, CriaPresentation *presentation) {
+	GtkRecentData data;
+	gchar *groups[] = { "Office", "Presentation", NULL };
+
+	g_return_if_fail (CRIA_IS_MAIN_WINDOW (main_window));
+	g_return_if_fail (text_uri != NULL);
+
+	if (*cria_presentation_get_title (presentation)) {
+		data.display_name = g_strdup (cria_presentation_get_title (presentation));
+	} else {
+		data.display_name = g_path_get_basename (text_uri);
+	}
+	data.description = NULL; // FIXME use presentation description
+	data.mime_type = gnome_vfs_get_mime_type (text_uri);
+	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 (main_window->priv->recent_manager, text_uri, &data);
+
+	g_free (data.display_name);
+	g_free (data.mime_type);
+	g_free (data.app_name);
+	g_free (data.app_exec);
+}
+
 /**
  * cria_main_window_new:
  * @filename: filename of the new window
@@ -927,6 +1024,8 @@
 	CriaPresentation* presentation;
 	GType		  type = CRIA_TYPE_MAIN_WINDOW;
 	GError		* error = NULL;
+	GtkWidget	 *main_window;
+	gchar		 *uri;
 
 	g_return_val_if_fail(filename, NULL);
 
@@ -946,7 +1045,15 @@
 		g_error_free(error);
 	}
 
-	return cmw_new_presentation(presentation);
+	main_window = cmw_new_presentation(presentation);
+
+	if (main_window != NULL) {
+		uri = gnome_vfs_make_uri_from_shell_arg(filename);
+		cria_main_window_add_to_recent(CRIA_MAIN_WINDOW (main_window), uri, presentation);
+		g_free(uri);
+	}
+
+	return main_window;
 }
 
 GtkWidget*
@@ -1072,7 +1179,7 @@
 					g_error_free(error);
 				} else {
 					gchar* text_uri = gnome_vfs_uri_to_string(uri, GNOME_VFS_URI_HIDE_PASSWORD);
-					cria_application_add_to_recent(text_uri);
+					cria_main_window_add_to_recent(self, text_uri, cria_main_window_get_presentation(self));
 					cria_presentation_set_uri(cria_main_window_get_presentation(self), uri);
 					g_free(text_uri);
 				}
@@ -1107,7 +1214,7 @@
 			g_error_free(error);
 		} else {
 			gchar* text_uri = gnome_vfs_uri_to_string(cria_presentation_get_uri(cria_main_window_get_presentation(self)), GNOME_VFS_URI_HIDE_PASSWORD);
-			cria_application_add_to_recent(text_uri);
+			cria_main_window_add_to_recent(self, text_uri, cria_main_window_get_presentation(self));
 			g_free(text_uri);
 		}
 	}
@@ -1294,7 +1401,7 @@
 		g_free(error_message);
 		g_error_free(error);
 	} else {
-		cria_application_add_to_recent(text_uri);
+		cria_main_window_add_to_recent(self, text_uri, presentation);
 	
 		cria_main_window_set_presentation(self, presentation);
 		g_object_unref(presentation);
@@ -1605,18 +1712,6 @@
 	cria_application_set_templates_visible(visible);
 }
 
-/* callback to load recent file */
-static void
-cb_recent_files_open(GtkAction *action, CriaMainWindow* self) {
-	gchar	* text_uri;
-	text_uri = egg_recent_item_get_uri(
-			egg_recent_view_uimanager_get_item(
-				EGG_RECENT_VIEW_UIMANAGER(self->priv->recent_view),
-				action));
-	cria_main_window_set_presentation_from_text_uri(self, text_uri);
-	g_free(text_uri);
-}
-
 static GtkActionEntry entries[] = {
 	/* use this one when you add new items */
 	{"FooBarDummy",		GTK_STOCK_MISSING_IMAGE,NULL},
@@ -1630,7 +1725,7 @@
 	{"FileOpen",		GTK_STOCK_OPEN,		N_("_Open"),
 	 "<control>O",		N_("Open a Presentation"),
 	 G_CALLBACK(cb_action_file_open)},
-	{"RecentDocuments",	NULL,			N_("_Recent Files")},
+	{"RecentDocuments",     NULL,                   N_("_Recent Files")},
 	{"FileSave",		GTK_STOCK_SAVE,		N_("_Save"),
 	 "<control>S",		N_("Save the Presentation"),
 	 G_CALLBACK(cb_action_file_save)},
