Mercurial > pidgin.yaz
diff pidgin/gtkblist.c @ 25011:ae544623840b
propagate from branch 'im.pidgin.pidgin' (head f018e11a7ea08e07f22667e6daca2ec7e64f9710)
to branch 'org.darkrain42.pidgin.buddy-add' (head e4fae922272cfd510a1f55595c374c2b9f665767)
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Fri, 02 Jan 2009 19:27:02 +0000 |
parents | 6eecd6ba2862 289227f729ec |
children | 7bfaa0b61a83 |
line wrap: on
line diff
--- a/pidgin/gtkblist.c Mon Dec 22 19:40:05 2008 +0000 +++ b/pidgin/gtkblist.c Fri Jan 02 19:27:02 2009 +0000 @@ -602,7 +602,7 @@ break; case PURPLE_BLIST_GROUP_NODE: dest = purple_find_group(arg2); - if (dest != NULL && strcmp(arg2, ((PurpleGroup*) node)->name)) { + if (dest != NULL && purple_utf8_strcasecmp(arg2, ((PurpleGroup*) node)->name)) { pidgin_dialogs_merge_groups((PurpleGroup*) node, arg2); } else purple_blist_rename_group((PurpleGroup*)node, arg2); @@ -7668,6 +7668,7 @@ GtkAccelGroup *accel_group = NULL; GList *l = NULL, *accounts = NULL; gboolean disabled_accounts = FALSE; + gboolean enabled_accounts = FALSE; if (accountmenu == NULL) return; @@ -7721,10 +7722,16 @@ G_CALLBACK(enable_account_cb), account); gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); gtk_widget_show(menuitem); + } else { + enabled_accounts = TRUE; } } + if (!enabled_accounts) + return; + pidgin_separator(accountmenu); + accel_group = gtk_menu_get_accel_group(GTK_MENU(accountmenu)); for (accounts = purple_accounts_get_all(); accounts; accounts = accounts->next) { char *buf = NULL; @@ -7736,67 +7743,63 @@ PurplePlugin *plugin = NULL; account = accounts->data; - accel_group = gtk_menu_get_accel_group(GTK_MENU(accountmenu)); - - if(purple_account_get_enabled(account, PIDGIN_UI)) { - buf = g_strconcat(purple_account_get_username(account), " (", - purple_account_get_protocol_name(account), ")", NULL); - menuitem = gtk_image_menu_item_new_with_label(buf); - accel_path_buf = g_strconcat(N_("<PurpleMain>/Accounts/"), buf, NULL); - 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); - } - gtk_menu_shell_append(GTK_MENU_SHELL(accountmenu), menuitem); + + if (!purple_account_get_enabled(account, PIDGIN_UI)) + continue; + + buf = g_strconcat(purple_account_get_username(account), " (", + purple_account_get_protocol_name(account), ")", NULL); + menuitem = gtk_image_menu_item_new_with_label(buf); + accel_path_buf = g_strconcat(N_("<PurpleMain>/Accounts/"), buf, NULL); + 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); + } + 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), accel_path_buf); + g_free(accel_path_buf); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); + gtk_widget_show(submenu); + + + menuitem = gtk_menu_item_new_with_mnemonic(_("_Edit Account")); + g_signal_connect(G_OBJECT(menuitem), "activate", + G_CALLBACK(modify_account_cb), account); + gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); + gtk_widget_show(menuitem); + + pidgin_separator(submenu); + + gc = purple_account_get_connection(account); + plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL; + if (plugin && PURPLE_PLUGIN_HAS_ACTIONS(plugin)) { + build_plugin_actions(submenu, plugin, gc); + } else { + menuitem = gtk_menu_item_new_with_label(_("No actions available")); + gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); + gtk_widget_set_sensitive(menuitem, FALSE); 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), accel_path_buf); - g_free(accel_path_buf); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); - gtk_widget_show(submenu); - - - menuitem = gtk_menu_item_new_with_mnemonic(_("_Edit Account")); - g_signal_connect(G_OBJECT(menuitem), "activate", - G_CALLBACK(modify_account_cb), account); - gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); - gtk_widget_show(menuitem); - - pidgin_separator(submenu); - - gc = purple_account_get_connection(account); - plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL; - if (plugin && PURPLE_PLUGIN_HAS_ACTIONS(plugin)) { - build_plugin_actions(submenu, plugin, gc); - } else { - menuitem = gtk_menu_item_new_with_label(_("No actions available")); - gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); - gtk_widget_set_sensitive(menuitem, FALSE); - gtk_widget_show(menuitem); - } - - pidgin_separator(submenu); - - menuitem = gtk_menu_item_new_with_mnemonic(_("_Disable")); - g_signal_connect(G_OBJECT(menuitem), "activate", - G_CALLBACK(disable_account_cb), account); - gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); - gtk_widget_show(menuitem); - } else { - disabled_accounts = TRUE; } - } - + + pidgin_separator(submenu); + + menuitem = gtk_menu_item_new_with_mnemonic(_("_Disable")); + g_signal_connect(G_OBJECT(menuitem), "activate", + G_CALLBACK(disable_account_cb), account); + gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem); + gtk_widget_show(menuitem); + } } static GList *plugin_submenus = NULL;