--- gnome-panel/ChangeLog	Thu Mar 18 15:48:41 2004
+++ gnome-panel-new/ChangeLog	Fri Mar 19 16:10:18 2004
@@ -1,3 +1,13 @@
+2004-03-19  Vijaykumar Patwari <vijaykumar.patwari@wipro.com>
+
+	* panel-menu-bar.c (panel_menu_bar_load): Added callback to create 
+	"Edit Menus" menuitem and append submenus.
+	* panel-menu-button.c (panel_menu_button_load): ditto. 
+	* menu.c: (menu_bar_button_menuitem_cb)ck for each submenu item.
+	panel_menu_add_edit_menus) (create_submenus):  use to create the submenuitems  
+	* applet.[ch] (panel_applet_recreate_menu): move it to the header. 
+	Fixes bug# 129073.
+
 2004-03-18  Guntupalli Karunakar  <karunakar@freedomink.org>
 
 	* configure.in: Added "mr" for Marathi to ALL_LINGUAS.
--- gnome-panel/gnome-panel/menu.h	Thu Jul 24 15:52:31 2003
+++ gnome-panel-new/gnome-panel/menu.h	Fri Mar 19 16:12:09 2004
@@ -71,6 +71,9 @@ GdkPixbuf *	panel_make_menu_icon (const 
 				      int size,
 				      gboolean *long_operation);
 
+void 		panel_menu_add_edit_menus (AppletInfo *info,
+					   const char *name);
+
 gboolean
 menu_dummy_button_press_event (GtkWidget      *menuitem,
 			       GdkEventButton *event,
--- gnome-panel/gnome-panel/menu.c	Sat Feb 28 17:33:45 2004
+++ gnome-panel-new/gnome-panel/menu.c	Fri Mar 19 16:10:51 2004
@@ -681,6 +681,75 @@ panel_make_sure_menu_within_screen (GtkM
 }
 
 static void
+menu_bar_button_menuitem_cb (GtkWidget *menuitem,
+			     gpointer data)
+{
+	char *item_name = (char *) data;
+	GdkScreen *screen;
+	GError *error = NULL;
+
+	screen = gtk_widget_get_screen (GTK_WIDGET (menuitem));
+	gnome_url_show_on_screen (item_name, screen,  &error);
+
+	if (error) {
+		panel_error_dialog (screen,
+				    "Cannot launch nautilus",
+				    _("Cannot launch nautilus"),
+				    error->message);
+
+		g_error_free (error);
+        }
+}
+
+static void
+create_submenu (GtkWidget *menu,
+		const char *menudir)
+{
+	GSList *li;
+	GtkWidget *menuitem;
+	FileRec *fr;
+	DirRec *dr;
+
+	fr = fr_get_dir (menudir);
+	dr = (DirRec *)fr;
+
+	if (fr != NULL) {
+		for(li = dr->recs; li != NULL; li = li->next) {
+			FileRec *tfr = li->data;
+
+			if (tfr->type == FILE_REC_DIR) {
+
+				menuitem = gtk_image_menu_item_new ();
+				setup_menuitem (menuitem, GTK_ICON_SIZE_MENU, NULL,
+						_(tfr->fullname), FALSE);
+				panel_load_menu_image_deferred (menuitem,
+								panel_menu_icon_get_size(),
+								NULL, tfr->icon, NULL, FALSE);
+
+				g_signal_connect (G_OBJECT(menuitem), "activate",
+						  G_CALLBACK(menu_bar_button_menuitem_cb),
+						  tfr->name);
+
+				gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+			}
+		}
+	}
+}
+
+void
+panel_menu_add_edit_menus (AppletInfo *info,
+			   const char *name)
+{
+	AppletUserMenu *menu;
+
+	menu = panel_applet_get_callback (info->user_menu, name);
+	menu->submenu = panel_create_menu ();
+
+	create_submenu (menu->submenu, "applications:/");
+	panel_applet_recreate_menu (info);
+}
+
+static void
 reload_image_menu_items (void)
 {
 	GSList *l;
--- gnome-panel/gnome-panel/applet.h	Wed Jan 21 18:52:41 2004
+++ gnome-panel-new/gnome-panel/applet.h	Fri Mar 19 16:21:11 2004
@@ -83,10 +83,11 @@ void            panel_applet_add_callbac
 AppletUserMenu *panel_applet_get_callback    (GList       *user_menu,
 					      const gchar *name);
 
-
 void        panel_applet_save_position           (AppletInfo *applet_info,
 						  const char *id,
 						  gboolean    immediate);
+
+void        panel_applet_recreate_menu (AppletInfo  *info);
 
 int         panel_applet_get_position    (AppletInfo *applet);
 
--- gnome-panel/gnome-panel/applet.c	Tue Feb 17 01:29:42 2004
+++ gnome-panel-new/gnome-panel/applet.c	Fri Mar 19 14:41:21 2004
@@ -144,7 +144,7 @@ panel_applet_clean (AppletInfo *info)
 	}
 }
 
-static void
+void
 panel_applet_recreate_menu (AppletInfo	*info)
 {
 	GList *l;
--- gnome-panel/gnome-panel/panel-menu-bar.c	Sat Feb 28 17:33:46 2004
+++ gnome-panel-new/gnome-panel/panel-menu-bar.c	Fri Mar 19 14:29:10 2004
@@ -349,6 +349,14 @@ panel_menu_bar_load (PanelWidget *panel,
 				   _("_Help"),
 				   NULL);
 
+	panel_applet_add_callback (menubar->priv->info,
+				   "edit",
+				   NULL,
+				   _("_Edit Menus"),
+				   NULL);
+
+	panel_menu_add_edit_menus (menubar->priv->info, "edit");
+
 	panel_widget_set_applet_expandable (panel, GTK_WIDGET (menubar), FALSE, TRUE);
 }
 
--- gnome-panel/gnome-panel/panel-menu-button.c	Mon Feb 16 22:51:35 2004
+++ gnome-panel-new/gnome-panel/panel-menu-button.c	Fri Mar 19 14:28:57 2004
@@ -619,6 +619,10 @@ panel_menu_button_load (const char  *men
 	button->priv->applet_id = g_strdup (info->id);
 
 	panel_applet_add_callback (info, "help", GTK_STOCK_HELP, _("_Help"), NULL);
+	
+	panel_applet_add_callback (info, "edit", NULL, _("_Edit Menus"), NULL);
+
+	panel_menu_add_edit_menus  (info, "edit");
 
 	panel_widget_set_applet_expandable (panel, GTK_WIDGET (button), FALSE, TRUE);
 	panel_widget_set_applet_size_constrained (panel, GTK_WIDGET (button), TRUE);
