? panel-recent.c.clear
Index: panel-recent.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/panel-recent.c,v
retrieving revision 1.13
diff -u -r1.13 panel-recent.c
--- panel-recent.c	13 Dec 2003 10:06:42 -0000	1.13
+++ panel-recent.c	22 Jan 2004 22:50:08 -0000
@@ -159,6 +159,30 @@
 	g_free (mime_type);
 }
 
+static void
+panel_recent_menu_activate_cb (GtkMenuItem *menu_item, gpointer *data)
+{
+	EggRecentModel *model = (EggRecentModel *)data;
+	GList *recent_list = NULL;
+	GtkWidget *submenu;
+
+	recent_list = egg_recent_model_get_list (model);
+	submenu = gtk_menu_item_get_submenu (menu_item);
+	if (recent_list == NULL) {
+		gtk_widget_set_sensitive (submenu, FALSE);
+	} else {
+		gtk_widget_set_sensitive (submenu, TRUE);
+	}
+}
+
+static void
+recent_documents_clear_cb (GtkMenuItem *menuitem, gpointer *data)
+{
+	EggRecentModel *model = (EggRecentModel *)data;
+        
+	egg_recent_model_clear (model);
+}
+
 void
 panel_recent_append_documents_menu (GtkWidget *top_menu)
 {
@@ -184,9 +208,25 @@
 	
 	/* a model that shows the global recent doc list */
 	model = egg_recent_model_new ("gnome-panel", EGG_RECENT_MODEL_SORT_MRU);
+	g_signal_connect (G_OBJECT (menu_item), "activate",
+			  G_CALLBACK (panel_recent_menu_activate_cb), model);
 
 	view = egg_recent_view_gtk_new (menu, NULL);
 
+	menu_item = gtk_separator_menu_item_new ();
+	gtk_menu_append (menu, menu_item);
+
+	menu_item = gtk_image_menu_item_new ();
+	setup_stock_menu_item (menu_item,
+			       panel_menu_icon_get_size (),
+			       NULL,
+			       _("Clear Recent Documents"),
+			       TRUE);
+	gtk_menu_append (menu, menu_item);
+	g_signal_connect (menu_item, "activate",
+			  G_CALLBACK (recent_documents_clear_cb),
+			  model);
+
 	g_signal_connect (view, "activate",
 			  G_CALLBACK (recent_documents_activate_cb),
 			  menu);
