Mercurial > pidgin
changeset 23344:e96502c0262e
Moved "Enable Account" to the top with "Manage Accounts", and always put a
separator after them
Also re-sorted Tools->Smiley to after Tools->Privacy
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Tue, 10 Jun 2008 06:23:35 +0000 |
parents | 9a7520e489f8 |
children | dd146aa7d74d |
files | pidgin/gtkblist.c |
diffstat | 1 files changed, 47 insertions(+), 46 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkblist.c Mon Jun 09 19:34:25 2008 +0000 +++ b/pidgin/gtkblist.c Tue Jun 10 06:23:35 2008 +0000 @@ -3265,10 +3265,10 @@ { N_("/_Tools"), NULL, NULL, 0, "<Branch>", NULL }, { N_("/Tools/Buddy _Pounces"), NULL, pidgin_pounces_manager_show, 1, "<Item>", NULL }, { N_("/Tools/_Certificates"), NULL, pidgin_certmgr_show, 0, "<Item>", NULL }, - { N_("/Tools/Smile_y"), "<CTL>Y", pidgin_smiley_manager_show, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_SMILEY }, { N_("/Tools/Plu_gins"), "<CTL>U", pidgin_plugin_dialog_show, 2, "<StockItem>", PIDGIN_STOCK_TOOLBAR_PLUGINS }, { N_("/Tools/Pr_eferences"), "<CTL>P", pidgin_prefs_show, 0, "<StockItem>", GTK_STOCK_PREFERENCES }, { N_("/Tools/Pr_ivacy"), NULL, pidgin_privacy_dialog_show, 0, "<Item>", NULL }, + { N_("/Tools/Smile_y"), "<CTL>Y", pidgin_smiley_manager_show, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_SMILEY }, { "/Tools/sep2", NULL, NULL, 0, "<Separator>", NULL }, { N_("/Tools/_File Transfers"), "<CTL>T", pidgin_xfer_dialog_show, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_TRANSFER }, { N_("/Tools/R_oom List"), NULL, pidgin_roomlist_dialog_show, 0, "<Item>", NULL }, @@ -7619,6 +7619,52 @@ for (accounts = purple_accounts_get_all(); accounts; accounts = accounts->next) { char *buf = NULL; + GtkWidget *image = NULL; + PurpleAccount *account = NULL; + GdkPixbuf *pixbuf = NULL; + + account = accounts->data; + + if(!purple_account_get_enabled(account, PIDGIN_UI)) { + if (!disabled_accounts) { + menuitem = gtk_menu_item_new_with_label(_("Enable Account")); + gtk_menu_shell_append(GTK_MENU_SHELL(accountmenu), menuitem); + gtk_widget_show(menuitem); + + submenu = gtk_menu_new(); + gtk_menu_set_accel_group(GTK_MENU(submenu), accel_group); + gtk_menu_set_accel_path(GTK_MENU(submenu), N_("<PurpleMain>/Accounts/Enable Account")); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); + gtk_widget_show(submenu); + + disabled_accounts = TRUE; + } + + buf = g_strconcat(purple_account_get_username(account), " (", + purple_account_get_protocol_name(account), ")", NULL); + menuitem = gtk_image_menu_item_new_with_label(buf); + g_free(buf); + pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); + if (pixbuf != NULL) + { + if (!purple_account_is_connected(account)) + gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); + image = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(G_OBJECT(pixbuf)); + gtk_widget_show(image); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image); + } + g_signal_connect(G_OBJECT(menuitem), "activate", + G_CALLBACK(enable_account_cb), account); + gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); + gtk_widget_show(menuitem); + } + } + + pidgin_separator(accountmenu); + + for (accounts = purple_accounts_get_all(); accounts; accounts = accounts->next) { + char *buf = NULL; char *accel_path_buf = NULL; GtkWidget *image = NULL; PurpleConnection *gc = NULL; @@ -7688,51 +7734,6 @@ } } - if(disabled_accounts) { - pidgin_separator(accountmenu); - menuitem = gtk_menu_item_new_with_label(_("Enable Account")); - gtk_menu_shell_append(GTK_MENU_SHELL(accountmenu), menuitem); - gtk_widget_show(menuitem); - - submenu = gtk_menu_new(); - gtk_menu_set_accel_group(GTK_MENU(submenu), accel_group); - gtk_menu_set_accel_path(GTK_MENU(submenu), N_("<PurpleMain>/Accounts/Enable Account")); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); - gtk_widget_show(submenu); - - for (accounts = purple_accounts_get_all(); accounts; accounts = accounts->next) { - char *buf = NULL; - GtkWidget *image = NULL; - PurpleAccount *account = NULL; - GdkPixbuf *pixbuf = NULL; - - account = accounts->data; - - if(!purple_account_get_enabled(account, PIDGIN_UI)) { - - disabled_accounts = TRUE; - - buf = g_strconcat(purple_account_get_username(account), " (", - purple_account_get_protocol_name(account), ")", NULL); - menuitem = gtk_image_menu_item_new_with_label(buf); - g_free(buf); - pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); - if (pixbuf != NULL) - { - if (!purple_account_is_connected(account)) - gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); - image = gtk_image_new_from_pixbuf(pixbuf); - g_object_unref(G_OBJECT(pixbuf)); - gtk_widget_show(image); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem), image); - } - g_signal_connect(G_OBJECT(menuitem), "activate", - G_CALLBACK(enable_account_cb), account); - gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); - gtk_widget_show(menuitem); - } - } - } } static GList *plugin_submenus = NULL;