gnome-panel refresh



Hello, I have just subscribed to this list.

I have coded something and it has become a patch which enables a
'Refresh Panel' function, "because I don't know what 'killall
gnome-panel' means", which can be used when new software is installed,
for example.

By now the code is really ugly (it's REALLY a g_spawn* who calls
killall), but if nobody's working at that I could try to implement
something that keeps the menu up-to-date each time a new entry is added
by installing new software.

Anyway, the patch is attached.

Marco
diff -Naur gnome-panel-2.11.4-old/gnome-panel/panel-context-menu.c gnome-panel-2.11.4/gnome-panel/panel-context-menu.c
--- gnome-panel-2.11.4-old/gnome-panel/panel-context-menu.c	2005-06-11 11:56:58.000000000 +0200
+++ gnome-panel-2.11.4/gnome-panel/panel-context-menu.c	2005-07-11 12:50:55.000000000 +0200
@@ -150,6 +150,17 @@
 	panel_profile_create_toplevel (gtk_widget_get_screen (menuitem));
 }
 
+
+/* mc patch START */
+
+static void
+panel_context_menu_refresh_panel (GtkWidget *menuitem)
+{
+        g_spawn_command_line_async ("killall gnome-panel", NULL);
+}
+
+/* mc patch END */
+
 static void
 panel_context_menu_remove_panel (GtkWidget *menuitem,
 				 gpointer data)
@@ -267,6 +278,23 @@
 			  G_CALLBACK (panel_context_menu_setup_remove_panel_item),
 			  menuitem);
 
+	/* mc patch START */
+
+	menuitem = gtk_image_menu_item_new ();
+	setup_menuitem (menuitem, 
+			GTK_ICON_SIZE_MENU,
+			gtk_image_new_from_stock (GTK_STOCK_REFRESH,
+						  GTK_ICON_SIZE_MENU),
+			_("_Refresh Panel"),
+			FALSE);
+
+	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+	g_signal_connect (G_OBJECT (menuitem), "activate",
+			  G_CALLBACK (panel_context_menu_refresh_panel),
+			  NULL);
+
+	/* mc patch END */
+
 	add_menu_separator (menu);
 
 	menuitem = gtk_image_menu_item_new ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]