Mercurial > pidgin.yaz
comparison gtk/gtkblist.c @ 15002:ff4514c11cbc
[gaim-migrate @ 17781]
SF Patch #1597271 from Ryan Barrett
"this patch enables GTK menu accelerators in the account-specific and Enable Account submenus of the Accounts menu.
other menus have the same code - for example, the plugin action menu in gaim_gtk_blist_update_plugin_actions(), right below the patched function - so i'm guessing it was just missing, and not an intentional design decision."
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 19 Nov 2006 07:37:48 +0000 |
parents | 33ac3c591b4a |
children | 36cfa2e714b7 |
comparison
equal
deleted
inserted
replaced
15001:89ae31668a9c | 15002:ff4514c11cbc |
---|---|
5946 | 5946 |
5947 void | 5947 void |
5948 gaim_gtk_blist_update_accounts_menu(void) | 5948 gaim_gtk_blist_update_accounts_menu(void) |
5949 { | 5949 { |
5950 GtkWidget *menuitem = NULL, *submenu = NULL; | 5950 GtkWidget *menuitem = NULL, *submenu = NULL; |
5951 GtkAccelGroup *accel_group = NULL; | |
5951 GList *l = NULL, *accounts = NULL; | 5952 GList *l = NULL, *accounts = NULL; |
5952 gboolean disabled_accounts = FALSE; | 5953 gboolean disabled_accounts = FALSE; |
5953 | 5954 |
5954 if (accountmenu == NULL) | 5955 if (accountmenu == NULL) |
5955 return; | 5956 return; |
5962 gtk_widget_destroy(menuitem); | 5963 gtk_widget_destroy(menuitem); |
5963 } | 5964 } |
5964 | 5965 |
5965 for (accounts = gaim_accounts_get_all(); accounts; accounts = accounts->next) { | 5966 for (accounts = gaim_accounts_get_all(); accounts; accounts = accounts->next) { |
5966 char *buf = NULL; | 5967 char *buf = NULL; |
5968 char *accel_path_buf = NULL; | |
5967 GtkWidget *image = NULL; | 5969 GtkWidget *image = NULL; |
5968 GaimConnection *gc = NULL; | 5970 GaimConnection *gc = NULL; |
5969 GaimAccount *account = NULL; | 5971 GaimAccount *account = NULL; |
5970 GaimStatus *status = NULL; | 5972 GaimStatus *status = NULL; |
5971 GdkPixbuf *pixbuf = NULL; | 5973 GdkPixbuf *pixbuf = NULL; |
5972 | 5974 |
5973 account = accounts->data; | 5975 account = accounts->data; |
5976 accel_group = gtk_menu_get_accel_group(GTK_MENU(accountmenu)); | |
5974 | 5977 |
5975 if(gaim_account_get_enabled(account, GAIM_GTK_UI)) { | 5978 if(gaim_account_get_enabled(account, GAIM_GTK_UI)) { |
5976 buf = g_strconcat(gaim_account_get_username(account), " (", | 5979 buf = g_strconcat(gaim_account_get_username(account), " (", |
5977 gaim_account_get_protocol_name(account), ")", NULL); | 5980 gaim_account_get_protocol_name(account), ")", NULL); |
5978 menuitem = gtk_image_menu_item_new_with_label(buf); | 5981 menuitem = gtk_image_menu_item_new_with_label(buf); |
5982 accel_path_buf = g_strconcat(N_("<GaimMain>/Accounts/"), buf, NULL); | |
5979 g_free(buf); | 5983 g_free(buf); |
5980 status = gaim_account_get_active_status(account); | 5984 status = gaim_account_get_active_status(account); |
5981 pixbuf = gaim_gtk_create_prpl_icon_with_status(account, gaim_status_get_type(status), 0.5); | 5985 pixbuf = gaim_gtk_create_prpl_icon_with_status(account, gaim_status_get_type(status), 0.5); |
5982 if (pixbuf != NULL) | 5986 if (pixbuf != NULL) |
5983 { | 5987 { |
5991 } | 5995 } |
5992 gtk_menu_shell_append(GTK_MENU_SHELL(accountmenu), menuitem); | 5996 gtk_menu_shell_append(GTK_MENU_SHELL(accountmenu), menuitem); |
5993 gtk_widget_show(menuitem); | 5997 gtk_widget_show(menuitem); |
5994 | 5998 |
5995 submenu = gtk_menu_new(); | 5999 submenu = gtk_menu_new(); |
6000 gtk_menu_set_accel_group(GTK_MENU(submenu), accel_group); | |
6001 gtk_menu_set_accel_path(GTK_MENU(submenu), accel_path_buf); | |
6002 g_free(accel_path_buf); | |
5996 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); | 6003 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); |
5997 gtk_widget_show(submenu); | 6004 gtk_widget_show(submenu); |
5998 | 6005 |
5999 | 6006 |
6000 menuitem = gtk_menu_item_new_with_mnemonic(_("_Edit Account")); | 6007 menuitem = gtk_menu_item_new_with_mnemonic(_("_Edit Account")); |
6059 menuitem = gtk_menu_item_new_with_label(_("Enable Account")); | 6066 menuitem = gtk_menu_item_new_with_label(_("Enable Account")); |
6060 gtk_menu_shell_append(GTK_MENU_SHELL(accountmenu), menuitem); | 6067 gtk_menu_shell_append(GTK_MENU_SHELL(accountmenu), menuitem); |
6061 gtk_widget_show(menuitem); | 6068 gtk_widget_show(menuitem); |
6062 | 6069 |
6063 submenu = gtk_menu_new(); | 6070 submenu = gtk_menu_new(); |
6071 gtk_menu_set_accel_group(GTK_MENU(submenu), accel_group); | |
6072 gtk_menu_set_accel_path(GTK_MENU(submenu), N_("<GaimMain>/Accounts/Enable Account")); | |
6064 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); | 6073 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); |
6065 gtk_widget_show(submenu); | 6074 gtk_widget_show(submenu); |
6066 | 6075 |
6067 for (accounts = gaim_accounts_get_all(); accounts; accounts = accounts->next) { | 6076 for (accounts = gaim_accounts_get_all(); accounts; accounts = accounts->next) { |
6068 char *buf = NULL; | 6077 char *buf = NULL; |