[patch] add mnemonics to the menu items.
- From: Robert Love <rml novell com>
- To: networkmanager-list gnome org
- Subject: [patch] add mnemonics to the menu items.
- Date: Mon, 20 Jun 2005 17:33:57 -0400
Yo,
Attached patch adds mnemonics to the menu items of the applet.
Mnemonics make life easy and its just a matter of using one Gtk API over
another.
May I apply? / Please apply.
Robert Love
applet/applet.c | 17 ++++++++---------
applet/menu-items.c | 4 ++--
2 files changed, 10 insertions(+), 11 deletions(-)
Index: gnome/applet/applet.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/gnome/applet/applet.c,v
retrieving revision 1.14
diff -u -u -r1.14 applet.c
--- gnome/applet/applet.c 17 Jun 2005 10:59:56 -0000 1.14
+++ gnome/applet/applet.c 20 Jun 2005 20:29:18 -0000
@@ -161,7 +161,7 @@
void nmwa_about_cb (NMWirelessApplet *applet)
-{
+{
GdkPixbuf *pixbuf;
char *file;
GtkWidget *about_dialog;
@@ -223,7 +223,6 @@
#endif
}
-
typedef struct DialogCBData
{
char *msg;
@@ -1330,7 +1329,7 @@
GtkWidget *label;
menu_item = gtk_menu_item_new ();
- label = gtk_label_new (_("Connect to Other Wireless Network..."));
+ label = gtk_label_new_with_mnemonic (_("_Connect to Other Wireless Network..."));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_container_add (GTK_CONTAINER (menu_item), label);
gtk_widget_show_all (menu_item);
@@ -1351,7 +1350,7 @@
GtkWidget *label;
menu_item = gtk_menu_item_new ();
- label = gtk_label_new (_("Create New Wireless Network..."));
+ label = gtk_label_new_with_mnemonic (_("Create _New Wireless Network..."));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_container_add (GTK_CONTAINER (menu_item), label);
gtk_widget_show_all (menu_item);
@@ -1766,12 +1765,12 @@
if (applet->wireless_enabled)
{
- applet->stop_wireless_item = gtk_image_menu_item_new_with_label (_("Stop All Wireless Devices"));
+ applet->stop_wireless_item = gtk_image_menu_item_new_with_mnemonic (_("_Stop All Wireless Devices"));
image = gtk_image_new_from_stock (GTK_STOCK_STOP, GTK_ICON_SIZE_MENU);
}
else
{
- applet->stop_wireless_item = gtk_image_menu_item_new_with_label (_("Start All Wireless Devices"));
+ applet->stop_wireless_item = gtk_image_menu_item_new_with_mnemonic (_("_Start All Wireless Devices"));
image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_MENU);
}
g_signal_connect (G_OBJECT (applet->stop_wireless_item), "activate", G_CALLBACK (nmwa_set_wireless_enabled_cb), applet);
@@ -1802,7 +1801,7 @@
/* Construct the wireless scanning submenu */
applet->scan_method = nmwa_gconf_get_wireless_scan_method (applet);
- applet->scanning_item = gtk_menu_item_new_with_label (_("Wireless Network Discovery"));
+ applet->scanning_item = gtk_menu_item_new_with_mnemonic (_("_Wireless Network Discovery"));
applet->scanning_menu = gtk_menu_new ();
scanning_subitem = GTK_WIDGET (gtk_check_menu_item_new_with_label (_("Always Search")));
@@ -1838,14 +1837,14 @@
nmwa_menu_add_separator_item (menu);
- menu_item = gtk_image_menu_item_new_with_label (_("Help"));
+ menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Help"));
/* g_signal_connect (G_OBJECT (menu_item), "activate", G_CALLBACK (nmwa_help_cb), applet); */
image = gtk_image_new_from_stock (GTK_STOCK_HELP, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
gtk_widget_set_sensitive (GTK_WIDGET (menu_item), FALSE);
- menu_item = gtk_image_menu_item_new_with_label (_("About"));
+ menu_item = gtk_image_menu_item_new_with_mnemonic (_("_About"));
g_signal_connect (G_OBJECT (menu_item), "activate", G_CALLBACK (nmwa_about_cb), applet);
image = gtk_image_new_from_stock (GTK_STOCK_ABOUT, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image);
Index: gnome/applet/menu-items.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/gnome/applet/menu-items.c,v
retrieving revision 1.4
diff -u -u -r1.4 menu-items.c
--- gnome/applet/menu-items.c 17 Jun 2005 00:47:50 -0000 1.4
+++ gnome/applet/menu-items.c 20 Jun 2005 20:29:18 -0000
@@ -85,9 +85,9 @@
if (n_devices > 1)
text = g_strdup_printf (_("Wired Network (%s)"), dev_name);
else
- text = g_strdup (_("Wired Network"));
+ text = g_strdup (_("_Wired Network"));
- gtk_label_set_text (GTK_LABEL (item->label), text);
+ gtk_label_set_text_with_mnemonic (GTK_LABEL (item->label), text);
/* Only dim the item if the device supports carrier detection AND
* we know it doesn't have a link.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]