[gnome-panel/wip/3.0-freeze-break: 12/32] panel, libpanel-applet: Put Move before Remove in applet menu



commit adef8eaace38c54d6d68f37a3944bda1c40e252f
Author: Vincent Untz <vuntz gnome org>
Date:   Wed Mar 23 11:53:27 2011 +0100

    panel, libpanel-applet: Put Move before Remove in applet menu
    
    It's better to put a non-destructive action first.

 gnome-panel/applet.c           |   21 +++++++--------------
 gnome-panel/applet.h           |    1 -
 libpanel-applet/panel-applet.c |    2 +-
 3 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index 9379ed0..f8bf4db 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -492,6 +492,13 @@ panel_applet_get_edit_menu (AppletInfo *info)
 	movable = panel_applet_can_freely_move (info);
 	removable = panel_profile_id_lists_are_writable ();
 
+	menuitem = gtk_menu_item_new_with_mnemonic (_("_Move"));
+	g_signal_connect (menuitem, "activate",
+			  G_CALLBACK (move_applet_callback), info);
+	gtk_widget_show (menuitem);
+	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+	gtk_widget_set_sensitive (menuitem, movable);
+
 	menuitem = gtk_image_menu_item_new_with_mnemonic (_("_Remove From Panel"));
 	image = gtk_image_new_from_stock (GTK_STOCK_REMOVE,
 					  GTK_ICON_SIZE_MENU);
@@ -503,19 +510,6 @@ panel_applet_get_edit_menu (AppletInfo *info)
 	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
 	gtk_widget_set_sensitive (menuitem, removable);
 
-	menuitem = gtk_menu_item_new_with_mnemonic (_("_Move"));
-	g_signal_connect (menuitem, "activate",
-			  G_CALLBACK (move_applet_callback), info);
-	gtk_widget_show (menuitem);
-	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
-	gtk_widget_set_sensitive (menuitem, movable);
-
-	g_assert (info->move_item == NULL);
-
-	info->move_item = menuitem;
-	g_object_add_weak_pointer (G_OBJECT (menuitem),
-				   (gpointer *) &info->move_item);
-
 	info->edit_menu = menu;
 
 	return info->edit_menu;
@@ -1247,7 +1241,6 @@ panel_applet_register (GtkWidget       *applet,
 	info->data         = data;
 	info->data_destroy = data_destroy;
 	info->user_menu    = NULL;
-	info->move_item    = NULL;
 	info->id           = g_strdup (id);
 
 	g_object_set_data (G_OBJECT (applet), "applet_info", info);
diff --git a/gnome-panel/applet.h b/gnome-panel/applet.h
index a38b056..d3f6e9a 100644
--- a/gnome-panel/applet.h
+++ b/gnome-panel/applet.h
@@ -20,7 +20,6 @@ typedef struct {
 
 	GtkWidget       *menu;
 	GtkWidget       *edit_menu;
-	GtkWidget       *move_item;
 	GList           *user_menu;
 
 	gpointer         data;
diff --git a/libpanel-applet/panel-applet.c b/libpanel-applet/panel-applet.c
index 679100b..bda9bcc 100644
--- a/libpanel-applet/panel-applet.c
+++ b/libpanel-applet/panel-applet.c
@@ -152,8 +152,8 @@ static const gchar panel_menu_ui[] =
 	"    <placeholder name=\"AppletItems\"/>\n"
 	"  </popup>\n"
 	"  <popup name=\"PanelAppletEditPopup\" action=\"PopupEditAction\">\n"
-	"    <menuitem name=\"RemoveItem\" action=\"Remove\"/>\n"
 	"    <menuitem name=\"MoveItem\" action=\"Move\"/>\n"
+	"    <menuitem name=\"RemoveItem\" action=\"Remove\"/>\n"
 	"  </popup>\n"
 	"</ui>\n";
 



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