Adding "Edit Menu" to the Actions menu



I wrote up a small patch that adds an Edit Menu launcher to the Actions menu. My thinking was that menu editing isn't very discoverable in its current implementation of right-clicking. This launcher just opens up the nautilus applications: URI where people have the Edit->Cut/Copy/Paste and File->New Launcher commands readily available. I have a screenshot up at:

http://dropline.net/gnome/optical/menu_edit_and_shadow.png

Right now the patch is against gnome-panel-2.2.0, but if there's any interest in actually using it, I'll port it over to HEAD instead.


Todd
--- gnome-panel/foobar-widget.c	2002-10-17 23:26:53.000000000 -0400
+++ gnome-panel/foobar-widget.c.new	2003-02-25 01:05:34.000000000 -0500
@@ -206,6 +206,25 @@
 	}
 
 	panel_recent_append_documents_menu (menu);
+	
+	/* make menu editing easier to discover */
+	
+	item = gtk_separator_menu_item_new ();
+	gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
+	if (panel_is_program_in_path ("nautilus")) {
+		item = stock_menu_item_new (_("Edit Menu..."),
+					    NULL,
+					    FALSE);
+		gtk_tooltips_set_tip (panel_tooltips, item,
+			      	      _("Add or remove programs in the Applications menu"),
+			              NULL);
+		gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+        	g_signal_connect (item, "activate",
+			  	  G_CALLBACK (panel_action_editmenu), NULL);	 
+		setup_internal_applet_drag (item, "ACTION:editmenu:NEW");
+	}
+	
 	item = gtk_separator_menu_item_new ();
 	gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
 
--- gnome-panel/panel-action-button.h	2003-01-20 00:36:32.000000000 -0500
+++ gnome-panel/panel-action-button.h.new	2003-02-25 01:05:47.000000000 -0500
@@ -50,6 +50,7 @@
 	PANEL_ACTION_SEARCH,
 	PANEL_ACTION_SCREENSHOT,
 	PANEL_ACTION_SHOW_DESKTOP,
+	PANEL_ACTION_EDITMENU,
 	PANEL_ACTION_LAST
 } PanelActionButtonType;
 
@@ -98,6 +99,7 @@
 void       panel_action_run_program (GtkWidget *widget);
 void       panel_action_search      (GtkWidget *widget);
 void       panel_action_screenshot  (GtkWidget *widget);
+void       panel_action_editmenu    (GtkWidget *widget);
 
 G_END_DECLS
 
--- gnome-panel/panel-action-button.c	2003-01-20 01:17:54.000000000 -0500
+++ gnome-panel/panel-action-button.c.new	2003-02-25 01:05:59.000000000 -0500
@@ -67,6 +67,7 @@
 	{ PANEL_ACTION_RUN,          "run"          },
 	{ PANEL_ACTION_SEARCH,       "search"       },
 	{ PANEL_ACTION_SCREENSHOT,   "screenshot"   },
+	{ PANEL_ACTION_EDITMENU,     "editmenu"     },
 };
 
 /* Lock Screen
@@ -171,6 +172,22 @@
 				    _("Cannot execute gnome-panel-screenshot"));
 }
 
+/* Edit menu
+ */
+void
+panel_action_editmenu (GtkWidget *widget)
+{
+	GdkScreen *screen;
+	char      *argv [3] = {"nautilus", "applications:", NULL};
+
+	screen = gtk_widget_get_screen (widget);
+
+	if (egg_screen_execute_async (screen, g_get_home_dir (), 2, argv) < 0)
+		panel_error_dialog (screen,
+				    "cannot_exec_nautilus",
+				    _("Cannot execute Nautilus"));
+}
+
 typedef struct {
 	PanelActionButtonType   type;
 	char                   *stock_icon;


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