Mercurial > pidgin.yaz
comparison pidgin/gtkutils.c @ 17526:8bc2b7ec45c1
Make sure if some plugin used pidgin_protocol_option_menu_new, they continue
to work. Also, fix the google-talk selection.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sun, 27 May 2007 18:31:40 +0000 |
parents | 8fe927fa0220 |
children | e91e2b450e5d |
comparison
equal
deleted
inserted
replaced
17525:be7e6375ce7e | 17526:8bc2b7ec45c1 |
---|---|
458 ((void (*)(GtkWidget *, gpointer, gpointer))cb)(item, per_item_data, g_object_get_data(G_OBJECT(optmenu), "user_data")); | 458 ((void (*)(GtkWidget *, gpointer, gpointer))cb)(item, per_item_data, g_object_get_data(G_OBJECT(optmenu), "user_data")); |
459 } | 459 } |
460 } | 460 } |
461 | 461 |
462 static GtkWidget * | 462 static GtkWidget * |
463 aop_menu_item_new(GtkSizeGroup *sg, GdkPixbuf *pixbuf, const char *lbl, gpointer per_item_data) | 463 aop_menu_item_new(GtkSizeGroup *sg, GdkPixbuf *pixbuf, const char *lbl, gpointer per_item_data, const char *data) |
464 { | 464 { |
465 GtkWidget *item; | 465 GtkWidget *item; |
466 GtkWidget *hbox; | 466 GtkWidget *hbox; |
467 GtkWidget *image; | 467 GtkWidget *image; |
468 GtkWidget *label; | 468 GtkWidget *label; |
491 | 491 |
492 gtk_container_add(GTK_CONTAINER(item), hbox); | 492 gtk_container_add(GTK_CONTAINER(item), hbox); |
493 gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); | 493 gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); |
494 gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); | 494 gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); |
495 | 495 |
496 g_object_set_data(G_OBJECT (item), data, per_item_data); | |
496 g_object_set_data(G_OBJECT (item), "aop_per_item_data", per_item_data); | 497 g_object_set_data(G_OBJECT (item), "aop_per_item_data", per_item_data); |
497 | 498 |
498 pidgin_set_accessible_label(item, label); | 499 pidgin_set_accessible_label(item, label); |
499 | 500 |
500 return item; | 501 return item; |
612 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin); | 613 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin); |
613 | 614 |
614 if (gtalk_name && strcmp(gtalk_name, plugin->info->name) < 0) { | 615 if (gtalk_name && strcmp(gtalk_name, plugin->info->name) < 0) { |
615 char *filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", | 616 char *filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", |
616 "16", "google-talk.png", NULL); | 617 "16", "google-talk.png", NULL); |
618 GtkWidget *item; | |
619 | |
617 pixbuf = gdk_pixbuf_new_from_file(filename, NULL); | 620 pixbuf = gdk_pixbuf_new_from_file(filename, NULL); |
618 g_free(filename); | 621 g_free(filename); |
619 | 622 |
620 gtk_menu_shell_append(GTK_MENU_SHELL(aop_menu->menu), | 623 gtk_menu_shell_append(GTK_MENU_SHELL(aop_menu->menu), |
621 aop_menu_item_new(sg, pixbuf, gtalk_name, "prpl-jabber")); | 624 item = aop_menu_item_new(sg, pixbuf, gtalk_name, "prpl-jabber", "protocol")); |
625 g_object_set_data(G_OBJECT(item), "fake", GINT_TO_POINTER(1)); | |
622 | 626 |
623 if (pixbuf) | 627 if (pixbuf) |
624 g_object_unref(pixbuf); | 628 g_object_unref(pixbuf); |
625 | 629 |
626 gtalk_name = NULL; | 630 gtalk_name = NULL; |
627 } | 631 } |
628 | 632 |
629 pixbuf = pidgin_create_prpl_icon_from_prpl(plugin, PIDGIN_PRPL_ICON_SMALL, NULL); | 633 pixbuf = pidgin_create_prpl_icon_from_prpl(plugin, PIDGIN_PRPL_ICON_SMALL, NULL); |
630 | 634 |
631 gtk_menu_shell_append(GTK_MENU_SHELL(aop_menu->menu), | 635 gtk_menu_shell_append(GTK_MENU_SHELL(aop_menu->menu), |
632 aop_menu_item_new(sg, pixbuf, plugin->info->name, plugin->info->id)); | 636 aop_menu_item_new(sg, pixbuf, plugin->info->name, plugin->info->id, "protocol")); |
633 | 637 |
634 if (pixbuf) | 638 if (pixbuf) |
635 g_object_unref(pixbuf); | 639 g_object_unref(pixbuf); |
636 | 640 |
637 if (default_proto_id != NULL && !strcmp(plugin->info->id, default_proto_id)) | 641 if (default_proto_id != NULL && !strcmp(plugin->info->id, default_proto_id)) |
716 purple_account_get_username(account), | 720 purple_account_get_username(account), |
717 purple_account_get_protocol_name(account)); | 721 purple_account_get_protocol_name(account)); |
718 } | 722 } |
719 | 723 |
720 gtk_menu_shell_append(GTK_MENU_SHELL(aop_menu->menu), | 724 gtk_menu_shell_append(GTK_MENU_SHELL(aop_menu->menu), |
721 aop_menu_item_new(sg, pixbuf, buf, account)); | 725 aop_menu_item_new(sg, pixbuf, buf, account, "account")); |
722 | 726 |
723 if (pixbuf) | 727 if (pixbuf) |
724 g_object_unref(pixbuf); | 728 g_object_unref(pixbuf); |
725 | 729 |
726 if (default_account && account == default_account) | 730 if (default_account && account == default_account) |