diff options
author | Richard Laager <rlaager@pidgin.im> | 2007-05-12 02:43:16 +0000 |
---|---|---|
committer | Richard Laager <rlaager@pidgin.im> | 2007-05-12 02:43:16 +0000 |
commit | 2c2e57653cc8effebcedfad399bf024abf527f4e (patch) | |
tree | 3bf016f2c282c830af9c3df5f737a6df69b54b09 | |
parent | 06920de7d44e677679108c95a1d8362a2c582934 (diff) | |
parent | e598bd0ae1d2bb69346324187cd0a3c8ee9a486b (diff) | |
download | pidgin-2c2e57653cc8effebcedfad399bf024abf527f4e.tar.gz |
merge of '11d23a81eabd603d828252e655c8891d6e0b20e4'
and 'b38e5c5c934eca25b419f2389795d6e1e2528e6c'
-rw-r--r-- | pidgin/gtkutils.c | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c index c2e5c37cac..450419186a 100644 --- a/pidgin/gtkutils.c +++ b/pidgin/gtkutils.c @@ -510,6 +510,7 @@ pidgin_protocol_option_menu_new(const char *id, GCallback cb, const char *proto_name; char buf[256]; int i, selected_index = -1; + char *gtalk_name = g_strdup(_("Google Talk")); optmenu = gtk_option_menu_new(); gtk_widget_show(optmenu); @@ -528,6 +529,29 @@ pidgin_protocol_option_menu_new(const char *id, GCallback cb, plugin = (PurplePlugin *)p->data; prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin); + if (gtalk_name && strcmp(gtalk_name, plugin->info->name) < 0) + { + GtkWidget *gtalk_item; + + filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", + "16", "google-talk.png", NULL); + pixbuf = gdk_pixbuf_new_from_file(filename, NULL); + g_free(filename); + + + if (pixbuf) + image = gtk_image_new_from_pixbuf(pixbuf); + else + image = gtk_image_new(); + + gtalk_item = pidgin_protocol_option_menu_item(menu, sg, image, gtalk_name, "prpl-fake"); + g_object_set_data(G_OBJECT(gtalk_item), "real_protocol", plugin->info->id); + i++; + + g_free(gtalk_name); + gtalk_name = NULL; + } + /* Load the image. */ proto_name = prpl_info->list_icon(NULL, NULL); g_snprintf(buf, sizeof(buf), "%s.png", proto_name); @@ -555,30 +579,16 @@ pidgin_protocol_option_menu_new(const char *id, GCallback cb, g_object_set_data(G_OBJECT(optmenu), "last_protocol", plugin->info->id); } - if (!strcmp(plugin->info->id, "prpl-jabber")) - { - GtkWidget *gtalk_item; - - filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", - "16", "google-talk.png", NULL); - pixbuf = gdk_pixbuf_new_from_file(filename, NULL); - g_free(filename); - - - if (pixbuf) - image = gtk_image_new_from_pixbuf(pixbuf); - else - image = gtk_image_new(); - - gtalk_item = pidgin_protocol_option_menu_item(menu, sg, image, _("Google Talk"), "prpl-fake"); - g_object_set_data(G_OBJECT(gtalk_item), "real_protocol", plugin->info->id); - i++; - } - if (pixbuf) g_object_unref(G_OBJECT(pixbuf)); } + /* This is only needed if Pidgin has zero prpls compiled in, but + * I'm doing it because it's proper and might make a difference + * for automated source checkers. */ + g_free(gtalk_name); + + gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); if (selected_index != -1) |