Mercurial > pidgin
comparison src/protocols/yahoo/yay.c @ 2154:cff133e0ec0c
[gaim-migrate @ 2164]
part 2 of this. first was removing mail notifications; this is moving proto_opt stuff to multi.c and just having prpls say what they want. next it's on to the buddy right-click menu.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 22 Aug 2001 22:05:56 +0000 |
parents | 0befa2d2e540 |
children | a464da684307 |
comparison
equal
deleted
inserted
replaced
2153:0befa2d2e540 | 2154:cff133e0ec0c |
---|---|
44 #include "proxy.h" | 44 #include "proxy.h" |
45 | 45 |
46 #include "pixmaps/status-away.xpm" | 46 #include "pixmaps/status-away.xpm" |
47 #include "pixmaps/status-here.xpm" | 47 #include "pixmaps/status-here.xpm" |
48 #include "pixmaps/status-idle.xpm" | 48 #include "pixmaps/status-idle.xpm" |
49 | |
50 #include "pixmaps/cancel.xpm" | |
51 | 49 |
52 #define USEROPT_MAIL 0 | 50 #define USEROPT_MAIL 0 |
53 | 51 |
54 #define USEROPT_AUTHHOST 1 | 52 #define USEROPT_AUTHHOST 1 |
55 #define USEROPT_AUTHPORT 2 | 53 #define USEROPT_AUTHPORT 2 |
655 m = g_list_append(m, "Activate ID"); | 653 m = g_list_append(m, "Activate ID"); |
656 | 654 |
657 return m; | 655 return m; |
658 } | 656 } |
659 | 657 |
660 static void yahoo_print_option(GtkEntry *entry, struct aim_user *user) { | 658 static GList *yahoo_user_opts() |
661 int entrynum; | |
662 | |
663 entrynum = (int) gtk_object_get_user_data(GTK_OBJECT(entry)); | |
664 | |
665 if (entrynum == USEROPT_AUTHHOST) { | |
666 g_snprintf(user->proto_opt[USEROPT_AUTHHOST], | |
667 sizeof(user->proto_opt[USEROPT_AUTHHOST]), | |
668 "%s", gtk_entry_get_text(entry)); | |
669 } else if (entrynum == USEROPT_AUTHPORT) { | |
670 g_snprintf(user->proto_opt[USEROPT_AUTHPORT], | |
671 sizeof(user->proto_opt[USEROPT_AUTHPORT]), | |
672 "%s", gtk_entry_get_text(entry)); | |
673 } else if (entrynum == USEROPT_PAGERHOST) { | |
674 g_snprintf(user->proto_opt[USEROPT_PAGERHOST], | |
675 sizeof(user->proto_opt[USEROPT_PAGERHOST]), | |
676 "%s", gtk_entry_get_text(entry)); | |
677 } else if (entrynum == USEROPT_PAGERPORT) { | |
678 g_snprintf(user->proto_opt[USEROPT_PAGERPORT], | |
679 sizeof(user->proto_opt[USEROPT_PAGERPORT]), | |
680 "%s", gtk_entry_get_text(entry)); | |
681 } | |
682 } | |
683 | |
684 static void yahoo_user_opts(GtkWidget *book, struct aim_user *user) | |
685 { | 659 { |
686 GtkWidget *vbox; | 660 GList *m = NULL; |
687 GtkWidget *hbox; | 661 struct proto_user_opt *puo; |
688 GtkWidget *label; | 662 |
689 GtkWidget *entry; | 663 puo = g_new0(struct proto_user_opt, 1); |
690 | 664 puo->label = "Auth Host:"; |
691 vbox = gtk_vbox_new(FALSE, 5); | 665 puo->def = YAHOO_AUTH_HOST; |
692 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | 666 puo->pos = USEROPT_AUTHHOST; |
693 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, gtk_label_new("Yahoo Options")); | 667 m = g_list_append(m, puo); |
694 gtk_widget_show(vbox); | 668 |
695 | 669 puo = g_new0(struct proto_user_opt, 1); |
696 hbox = gtk_hbox_new(FALSE, 5); | 670 puo->label = "Auth Port:"; |
697 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | 671 puo->def = "80"; |
698 gtk_widget_show(hbox); | 672 puo->pos = USEROPT_AUTHPORT; |
699 | 673 m = g_list_append(m, puo); |
700 label = gtk_label_new("Yahoo Auth Host:"); | 674 |
701 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | 675 puo = g_new0(struct proto_user_opt, 1); |
702 gtk_widget_show(label); | 676 puo->label = "Pager Host:"; |
703 | 677 puo->def = YAHOO_PAGER_HOST; |
704 entry = gtk_entry_new(); | 678 puo->pos = USEROPT_PAGERHOST; |
705 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); | 679 m = g_list_append(m, puo); |
706 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_AUTHHOST); | 680 |
707 gtk_signal_connect(GTK_OBJECT(entry), "changed", | 681 puo = g_new0(struct proto_user_opt, 1); |
708 GTK_SIGNAL_FUNC(yahoo_print_option), user); | 682 puo->label = "Pager Port:"; |
709 if (user->proto_opt[USEROPT_AUTHHOST][0]) { | 683 puo->def = "5050"; |
710 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTHHOST]); | 684 puo->pos = USEROPT_PAGERHOST; |
711 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTHHOST]); | 685 m = g_list_append(m, puo); |
712 } else { | 686 |
713 gtk_entry_set_text(GTK_ENTRY(entry), YAHOO_AUTH_HOST); | 687 return m; |
714 } | |
715 gtk_widget_show(entry); | |
716 | |
717 hbox = gtk_hbox_new(FALSE, 5); | |
718 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
719 gtk_widget_show(hbox); | |
720 | |
721 label = gtk_label_new("Yahoo Auth Port:"); | |
722 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
723 gtk_widget_show(label); | |
724 | |
725 entry = gtk_entry_new(); | |
726 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); | |
727 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_AUTHPORT); | |
728 gtk_signal_connect(GTK_OBJECT(entry), "changed", | |
729 GTK_SIGNAL_FUNC(yahoo_print_option), user); | |
730 if (user->proto_opt[USEROPT_AUTHPORT][0]) { | |
731 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTHPORT]); | |
732 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTHPORT]); | |
733 } else { | |
734 g_snprintf(user->proto_opt[USEROPT_AUTHPORT], sizeof(user->proto_opt[USEROPT_AUTHPORT]), | |
735 "%d", YAHOO_AUTH_PORT); | |
736 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTHPORT]); | |
737 } | |
738 gtk_widget_show(entry); | |
739 | |
740 hbox = gtk_hbox_new(FALSE, 5); | |
741 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
742 gtk_widget_show(hbox); | |
743 | |
744 label = gtk_label_new("Yahoo Pager Host:"); | |
745 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
746 gtk_widget_show(label); | |
747 | |
748 entry = gtk_entry_new(); | |
749 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); | |
750 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_PAGERHOST); | |
751 gtk_signal_connect(GTK_OBJECT(entry), "changed", | |
752 GTK_SIGNAL_FUNC(yahoo_print_option), user); | |
753 if (user->proto_opt[USEROPT_PAGERHOST][0]) { | |
754 debug_printf("setting text %s\n", user->proto_opt[USEROPT_PAGERHOST]); | |
755 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_PAGERHOST]); | |
756 } else { | |
757 gtk_entry_set_text(GTK_ENTRY(entry), YAHOO_PAGER_HOST); | |
758 } | |
759 gtk_widget_show(entry); | |
760 | |
761 hbox = gtk_hbox_new(FALSE, 5); | |
762 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
763 gtk_widget_show(hbox); | |
764 | |
765 label = gtk_label_new("Yahoo Pager Port:"); | |
766 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
767 gtk_widget_show(label); | |
768 | |
769 entry = gtk_entry_new(); | |
770 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); | |
771 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_PAGERPORT); | |
772 gtk_signal_connect(GTK_OBJECT(entry), "changed", | |
773 GTK_SIGNAL_FUNC(yahoo_print_option), user); | |
774 if (user->proto_opt[USEROPT_PAGERPORT][0]) { | |
775 debug_printf("setting text %s\n", user->proto_opt[USEROPT_PAGERPORT]); | |
776 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_PAGERPORT]); | |
777 } else { | |
778 g_snprintf(user->proto_opt[USEROPT_PAGERPORT], sizeof(user->proto_opt[USEROPT_PAGERPORT]), | |
779 "%d", YAHOO_PAGER_PORT); | |
780 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_PAGERPORT]); | |
781 } | |
782 gtk_widget_show(entry); | |
783 } | 688 } |
784 | 689 |
785 static void toggle_offline(GtkToggleButton *button, struct conversation *c) | 690 static void toggle_offline(GtkToggleButton *button, struct conversation *c) |
786 { | 691 { |
787 struct gaim_connection *gc = gtk_object_get_user_data(GTK_OBJECT(button)); | 692 struct gaim_connection *gc = gtk_object_get_user_data(GTK_OBJECT(button)); |