comparison src/dialogs.c @ 5563:9eb5b13fd412

[gaim-migrate @ 5965] Just a taste of what's coming. Standard "This won't compile" thing. Plugin authors, you're going to hate me, but that's okay, because I have friends too! It's really late. My brain resembles that of fish swimming in jello pudding with neon lights flying around chanting musicals. I'm not on drugs. I'm just that tired. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 30 May 2003 09:38:29 +0000
parents b7319c094153
children b07aa997ddd8
comparison
equal deleted inserted replaced
5562:3c8d34574601 5563:9eb5b13fd412
59 #define PATHSIZE 1024 59 #define PATHSIZE 1024
60 60
61 static GtkWidget *imdialog = NULL; /*I only want ONE of these :) */ 61 static GtkWidget *imdialog = NULL; /*I only want ONE of these :) */
62 static GList *dialogwindows = NULL; 62 static GList *dialogwindows = NULL;
63 static GtkWidget *importdialog; 63 static GtkWidget *importdialog;
64 static struct gaim_connection *importgc; 64 static GaimConnection *importgc;
65 static GtkWidget *icondlg; 65 static GtkWidget *icondlg;
66 static GtkWidget *alias_dialog = NULL; 66 static GtkWidget *alias_dialog = NULL;
67 static GtkWidget *rename_dialog = NULL; 67 static GtkWidget *rename_dialog = NULL;
68 static GtkWidget *rename_bud_dialog = NULL; 68 static GtkWidget *rename_bud_dialog = NULL;
69 static GtkWidget *fontseld = NULL; 69 static GtkWidget *fontseld = NULL;
73 GtkWidget *window; 73 GtkWidget *window;
74 GtkWidget *label; 74 GtkWidget *label;
75 GtkWidget *ok; 75 GtkWidget *ok;
76 GtkWidget *cancel; 76 GtkWidget *cancel;
77 char name[1024]; 77 char name[1024];
78 struct gaim_connection *gc; 78 GaimConnection *gc;
79 }; 79 };
80 80
81 struct create_away { 81 struct create_away {
82 GtkWidget *window; 82 GtkWidget *window;
83 GtkWidget *entry; 83 GtkWidget *entry;
87 87
88 struct warning { 88 struct warning {
89 GtkWidget *window; 89 GtkWidget *window;
90 GtkWidget *anon; 90 GtkWidget *anon;
91 char *who; 91 char *who;
92 struct gaim_connection *gc; 92 GaimConnection *gc;
93 }; 93 };
94 94
95 struct addbuddy { 95 struct addbuddy {
96 GtkWidget *window; 96 GtkWidget *window;
97 GtkWidget *combo; 97 GtkWidget *combo;
98 GtkWidget *entry; 98 GtkWidget *entry;
99 GtkWidget *entry_for_alias; 99 GtkWidget *entry_for_alias;
100 GtkWidget *account; 100 GtkWidget *account;
101 struct gaim_connection *gc; 101 GaimConnection *gc;
102 }; 102 };
103 103
104 struct addperm { 104 struct addperm {
105 GtkWidget *window; 105 GtkWidget *window;
106 GtkWidget *entry; 106 GtkWidget *entry;
107 struct gaim_connection *gc; 107 GaimConnection *gc;
108 gboolean permit; 108 gboolean permit;
109 }; 109 };
110 110
111 struct findbyemail { 111 struct findbyemail {
112 GtkWidget *window; 112 GtkWidget *window;
113 GtkWidget *emailentry; 113 GtkWidget *emailentry;
114 struct gaim_connection *gc; 114 GaimConnection *gc;
115 }; 115 };
116 116
117 struct findbyinfo { 117 struct findbyinfo {
118 struct gaim_connection *gc; 118 GaimConnection *gc;
119 GtkWidget *window; 119 GtkWidget *window;
120 GtkWidget *firstentry; 120 GtkWidget *firstentry;
121 GtkWidget *middleentry; 121 GtkWidget *middleentry;
122 GtkWidget *lastentry; 122 GtkWidget *lastentry;
123 GtkWidget *maidenentry; 123 GtkWidget *maidenentry;
125 GtkWidget *stateentry; 125 GtkWidget *stateentry;
126 GtkWidget *countryentry; 126 GtkWidget *countryentry;
127 }; 127 };
128 128
129 struct info_dlg { 129 struct info_dlg {
130 struct gaim_connection *gc; 130 GaimConnection *gc;
131 char *who; 131 char *who;
132 GtkWidget *window; 132 GtkWidget *window;
133 GtkWidget *text; 133 GtkWidget *text;
134 }; 134 };
135 135
136 struct getuserinfo { 136 struct getuserinfo {
137 GtkWidget *window; 137 GtkWidget *window;
138 GtkWidget *entry; 138 GtkWidget *entry;
139 GtkWidget *account; 139 GtkWidget *account;
140 struct gaim_connection *gc; 140 GaimConnection *gc;
141 }; 141 };
142 142
143 struct alias_dialog_info 143 struct alias_dialog_info
144 { 144 {
145 GtkWidget *window; 145 GtkWidget *window;
148 struct buddy *buddy; 148 struct buddy *buddy;
149 }; 149 };
150 150
151 static GSList *info_dlgs = NULL; 151 static GSList *info_dlgs = NULL;
152 152
153 static struct info_dlg *find_info_dlg(struct gaim_connection *gc, const char *who) 153 static struct info_dlg *find_info_dlg(GaimConnection *gc, const char *who)
154 { 154 {
155 GSList *i = info_dlgs; 155 GSList *i = info_dlgs;
156 while (i) { 156 while (i) {
157 struct info_dlg *d = i->data; 157 struct info_dlg *d = i->data;
158 i = i->next; 158 i = i->next;
169 } 169 }
170 170
171 struct set_info_dlg { 171 struct set_info_dlg {
172 GtkWidget *window; 172 GtkWidget *window;
173 GtkWidget *menu; 173 GtkWidget *menu;
174 struct gaim_account *account; 174 GaimAccount *account;
175 GtkWidget *text; 175 GtkWidget *text;
176 GtkWidget *save; 176 GtkWidget *save;
177 GtkWidget *cancel; 177 GtkWidget *cancel;
178 }; 178 };
179 179
180 struct set_icon_dlg { 180 struct set_icon_dlg {
181 GtkWidget *window; 181 GtkWidget *window;
182 struct gaim_account *account; 182 GaimAccount *account;
183 GtkWidget *ok; 183 GtkWidget *ok;
184 GtkWidget *cancel; 184 GtkWidget *cancel;
185 GtkWidget *entry; 185 GtkWidget *entry;
186 }; 186 };
187 187
188 struct set_dir_dlg { 188 struct set_dir_dlg {
189 struct gaim_connection *gc; 189 GaimConnection *gc;
190 GtkWidget *window; 190 GtkWidget *window;
191 GtkWidget *first; 191 GtkWidget *first;
192 GtkWidget *middle; 192 GtkWidget *middle;
193 GtkWidget *last; 193 GtkWidget *last;
194 GtkWidget *maiden; 194 GtkWidget *maiden;
216 GtkWidget *ok; 216 GtkWidget *ok;
217 GtkWidget *cancel; 217 GtkWidget *cancel;
218 GtkWidget *original; 218 GtkWidget *original;
219 GtkWidget *new1; 219 GtkWidget *new1;
220 GtkWidget *new2; 220 GtkWidget *new2;
221 struct gaim_connection *gc; 221 GaimConnection *gc;
222 }; 222 };
223 223
224 struct view_log { 224 struct view_log {
225 long offset; 225 long offset;
226 int options; 226 int options;
344 344
345 destroy_dialog(NULL, w->window); 345 destroy_dialog(NULL, w->window);
346 g_free(w); 346 g_free(w);
347 } 347 }
348 348
349 void show_warn_dialog(struct gaim_connection *gc, char *who) 349 void show_warn_dialog(GaimConnection *gc, char *who)
350 { 350 {
351 char *labeltext; 351 char *labeltext;
352 GtkWidget *hbox, *vbox; 352 GtkWidget *hbox, *vbox;
353 GtkWidget *label; 353 GtkWidget *label;
354 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); 354 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
454 } 454 }
455 gaim_blist_remove_group(g); 455 gaim_blist_remove_group(g);
456 gaim_blist_save(); 456 gaim_blist_save();
457 } 457 }
458 458
459 void show_confirm_del(struct gaim_connection *gc, gchar *name) 459 void show_confirm_del(GaimConnection *gc, gchar *name)
460 { 460 {
461 struct buddy *bd = gaim_find_buddy(gc->account, name); 461 struct buddy *bd = gaim_find_buddy(gc->account, name);
462 char *text; 462 char *text;
463 if (!bd) 463 if (!bd)
464 return; 464 return;
500 /*------------------------------------------------------------------------*/ 500 /*------------------------------------------------------------------------*/
501 static void do_im(GtkWidget *widget, int resp, struct getuserinfo *info) 501 static void do_im(GtkWidget *widget, int resp, struct getuserinfo *info)
502 { 502 {
503 const char *who; 503 const char *who;
504 struct gaim_conversation *conv; 504 struct gaim_conversation *conv;
505 struct gaim_account *account; 505 GaimAccount *account;
506 506
507 if (resp == GTK_RESPONSE_OK) { 507 if (resp == GTK_RESPONSE_OK) {
508 who = gtk_entry_get_text(GTK_ENTRY(info->entry)); 508 who = gtk_entry_get_text(GTK_ENTRY(info->entry));
509 509
510 if (!who || !*who) { 510 if (!who || !*who) {
610 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); 610 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
611 611
612 gtk_widget_show_all(window); 612 gtk_widget_show_all(window);
613 } 613 }
614 614
615 void show_info_select_account(GObject *w, struct gaim_connection *gc) 615 void show_info_select_account(GObject *w, GaimConnection *gc)
616 { 616 {
617 struct getuserinfo *info = g_object_get_data(w, "getuserinfo"); 617 struct getuserinfo *info = g_object_get_data(w, "getuserinfo");
618 info->gc = gc; 618 info->gc = gc;
619 } 619 }
620 620
627 void show_im_dialog() 627 void show_im_dialog()
628 { 628 {
629 GtkWidget *hbox, *vbox; 629 GtkWidget *hbox, *vbox;
630 GtkWidget *label; 630 GtkWidget *label;
631 GtkWidget *table, *menu, *opt; 631 GtkWidget *table, *menu, *opt;
632 GSList *g = connections; 632 GList *g = gaim_connections_get_all();
633 struct gaim_connection *c; 633 GaimConnection *c;
634 GaimAccount *account;
634 struct gaim_gtk_buddy_list *gtkblist; 635 struct gaim_gtk_buddy_list *gtkblist;
635 char buf[256]; 636 char buf[256];
636 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG); 637 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG);
637 struct getuserinfo *info = NULL; 638 struct getuserinfo *info = NULL;
638 639
639 gtkblist = GAIM_GTK_BLIST(gaim_get_blist()); 640 gtkblist = GAIM_GTK_BLIST(gaim_get_blist());
640 641
641 if (!imdialog) { 642 if (!imdialog) {
642 info = g_new0(struct getuserinfo, 1); 643 info = g_new0(struct getuserinfo, 1);
643 info->gc = connections->data; 644 info->gc = gaim_connections_get_all()->data;
644 imdialog = gtk_dialog_new_with_buttons(_("New Message"), gtkblist ? GTK_WINDOW(gtkblist->window) : NULL, 0, 645 imdialog = gtk_dialog_new_with_buttons(_("New Message"), gtkblist ? GTK_WINDOW(gtkblist->window) : NULL, 0,
645 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); 646 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
646 gtk_dialog_set_default_response (GTK_DIALOG(imdialog), GTK_RESPONSE_OK); 647 gtk_dialog_set_default_response (GTK_DIALOG(imdialog), GTK_RESPONSE_OK);
647 gtk_container_set_border_width (GTK_CONTAINER(imdialog), 6); 648 gtk_container_set_border_width (GTK_CONTAINER(imdialog), 6);
648 gtk_window_set_resizable(GTK_WINDOW(imdialog), FALSE); 649 gtk_window_set_resizable(GTK_WINDOW(imdialog), FALSE);
684 gtk_entry_set_activates_default (GTK_ENTRY(info->entry), TRUE); 685 gtk_entry_set_activates_default (GTK_ENTRY(info->entry), TRUE);
685 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(info->entry)); 686 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(info->entry));
686 g_signal_connect(G_OBJECT(info->entry), "changed", 687 g_signal_connect(G_OBJECT(info->entry), "changed",
687 G_CALLBACK(dialog_set_ok_sensitive), imdialog); 688 G_CALLBACK(dialog_set_ok_sensitive), imdialog);
688 689
689 if (connections->next) { 690 if (gaim_connections_get_all()->next) {
690 691
691 label = gtk_label_new(NULL); 692 label = gtk_label_new(NULL);
692 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); 693 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
693 gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Account:")); 694 gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Account:"));
694 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); 695 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
698 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(info->account)); 699 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(info->account));
699 700
700 menu = gtk_menu_new(); 701 menu = gtk_menu_new();
701 702
702 while (g) { 703 while (g) {
703 c = (struct gaim_connection *)g->data; 704 c = (GaimConnection *)g->data;
704 705
705 if (!GAIM_PLUGIN_PROTOCOL_INFO(c->prpl)->send_im) { 706 if (!GAIM_PLUGIN_PROTOCOL_INFO(c->prpl)->send_im) {
706 g = g->next; 707 g = g->next;
707 continue; 708 continue;
708 } 709 }
710
711 account = gaim_connection_get_account(c);
712
709 g_snprintf(buf, sizeof(buf), "%s (%s)", 713 g_snprintf(buf, sizeof(buf), "%s (%s)",
710 c->username, c->prpl->info->name); 714 gaim_account_get_username(account),
715 c->prpl->info->name);
711 opt = gtk_menu_item_new_with_label(buf); 716 opt = gtk_menu_item_new_with_label(buf);
712 g_object_set_data(G_OBJECT(opt), "getuserinfo", info); 717 g_object_set_data(G_OBJECT(opt), "getuserinfo", info);
713 718
714 g_signal_connect(G_OBJECT(opt), "activate", 719 g_signal_connect(G_OBJECT(opt), "activate",
715 G_CALLBACK(show_info_select_account), c); 720 G_CALLBACK(show_info_select_account), c);
733 { 738 {
734 GtkWidget *window, *hbox, *vbox; 739 GtkWidget *window, *hbox, *vbox;
735 GtkWidget *label; 740 GtkWidget *label;
736 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG); 741 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG);
737 GtkWidget *table, *menu, *opt; 742 GtkWidget *table, *menu, *opt;
738 GSList *g = connections; 743 GList *g = gaim_connections_get_all();
739 struct gaim_connection *c; 744 GaimConnection *c;
745 GaimAccount *account;
740 struct getuserinfo *info = g_new0(struct getuserinfo, 1); 746 struct getuserinfo *info = g_new0(struct getuserinfo, 1);
741 struct gaim_gtk_buddy_list *gtkblist; 747 struct gaim_gtk_buddy_list *gtkblist;
742 char buf[256]; 748 char buf[256];
743 749
744 gtkblist = GAIM_GTK_BLIST(gaim_get_blist()); 750 gtkblist = GAIM_GTK_BLIST(gaim_get_blist());
745 751
746 info->gc = connections->data; 752 info->gc = gaim_connections_get_all()->data;
747 753
748 window = gtk_dialog_new_with_buttons(_("Get User Info"), gtkblist->window ? GTK_WINDOW(gtkblist->window) : NULL, 0, 754 window = gtk_dialog_new_with_buttons(_("Get User Info"), gtkblist->window ? GTK_WINDOW(gtkblist->window) : NULL, 0,
749 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); 755 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
750 gtk_dialog_set_default_response (GTK_DIALOG(window), GTK_RESPONSE_OK); 756 gtk_dialog_set_default_response (GTK_DIALOG(window), GTK_RESPONSE_OK);
751 gtk_container_set_border_width (GTK_CONTAINER(window), 6); 757 gtk_container_set_border_width (GTK_CONTAINER(window), 6);
786 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(info->entry)); 792 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(info->entry));
787 793
788 g_signal_connect(G_OBJECT(info->entry), "changed", 794 g_signal_connect(G_OBJECT(info->entry), "changed",
789 G_CALLBACK(dialog_set_ok_sensitive), window); 795 G_CALLBACK(dialog_set_ok_sensitive), window);
790 796
791 if (connections->next) { 797 if (gaim_connections_get_all()->next) {
792 798
793 label = gtk_label_new(NULL); 799 label = gtk_label_new(NULL);
794 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); 800 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
795 gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Account:")); 801 gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Account:"));
796 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); 802 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
800 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(info->account)); 806 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(info->account));
801 807
802 menu = gtk_menu_new(); 808 menu = gtk_menu_new();
803 809
804 while (g) { 810 while (g) {
805 c = (struct gaim_connection *)g->data; 811 c = (GaimConnection *)g->data;
806 812
807 if (!GAIM_PLUGIN_PROTOCOL_INFO(c->prpl)->get_info) { 813 if (!GAIM_PLUGIN_PROTOCOL_INFO(c->prpl)->get_info) {
808 g = g->next; 814 g = g->next;
809 continue; 815 continue;
810 } 816 }
817
818 account = gaim_connection_get_account(c);
819
811 g_snprintf(buf, sizeof(buf), "%s (%s)", 820 g_snprintf(buf, sizeof(buf), "%s (%s)",
812 c->username, c->prpl->info->name); 821 gaim_account_get_username(account),
822 c->prpl->info->name);
813 opt = gtk_menu_item_new_with_label(buf); 823 opt = gtk_menu_item_new_with_label(buf);
814 g_object_set_data(G_OBJECT(opt), "getuserinfo", info); 824 g_object_set_data(G_OBJECT(opt), "getuserinfo", info);
815 825
816 g_signal_connect(G_OBJECT(opt), "activate", 826 g_signal_connect(G_OBJECT(opt), "activate",
817 G_CALLBACK(show_info_select_account), c); 827 G_CALLBACK(show_info_select_account), c);
887 897
888 if (resp == GTK_RESPONSE_OK) { 898 if (resp == GTK_RESPONSE_OK) {
889 grp = gtk_entry_get_text(GTK_ENTRY(a->entry)); 899 grp = gtk_entry_get_text(GTK_ENTRY(a->entry));
890 900
891 if (!a->gc) 901 if (!a->gc)
892 a->gc = connections->data; 902 a->gc = gaim_connections_get_all()->data;
893 903
894 g = gaim_group_new(grp); 904 g = gaim_group_new(grp);
895 gaim_blist_add_group (g, NULL); 905 gaim_blist_add_group (g, NULL);
896 gaim_blist_save(); 906 gaim_blist_save();
897 } 907 }
928 { 938 {
929 g_free(a); 939 g_free(a);
930 } 940 }
931 941
932 942
933 void show_add_group(struct gaim_connection *gc) 943 void show_add_group(GaimConnection *gc)
934 { 944 {
935 945
936 GtkWidget *hbox, *vbox; 946 GtkWidget *hbox, *vbox;
937 GtkWidget *label; 947 GtkWidget *label;
938 struct gaim_gtk_buddy_list *gtkblist; 948 struct gaim_gtk_buddy_list *gtkblist;
981 991
982 gtk_widget_show_all(a->window); 992 gtk_widget_show_all(a->window);
983 gtk_widget_grab_focus(GTK_WIDGET(a->entry)); 993 gtk_widget_grab_focus(GTK_WIDGET(a->entry));
984 } 994 }
985 995
986 static void addbuddy_select_account(GObject *w, struct gaim_connection *gc) 996 static void addbuddy_select_account(GObject *w, GaimConnection *gc)
987 { 997 {
988 struct addbuddy *b = g_object_get_data(w, "addbuddy"); 998 struct addbuddy *b = g_object_get_data(w, "addbuddy");
989 999
990 /* Save our account */ 1000 /* Save our account */
991 b->gc = gc; 1001 b->gc = gc;
992 } 1002 }
993 1003
994 static void create_online_user_names(struct addbuddy *b) 1004 static void create_online_user_names(struct addbuddy *b)
995 { 1005 {
996 char buf[2048]; /* Never hurts to be safe ;-) */ 1006 char buf[2048]; /* Never hurts to be safe ;-) */
997 GSList *g = connections; 1007 GList *g = gaim_connections_get_all();
998 struct gaim_connection *c; 1008 GaimConnection *c;
1009 GaimAccount *account;
999 GtkWidget *menu, *opt; 1010 GtkWidget *menu, *opt;
1000 int count = 0; 1011 int count = 0;
1001 int place = 0; 1012 int place = 0;
1002 1013
1003 menu = gtk_menu_new(); 1014 menu = gtk_menu_new();
1004 1015
1005 while (g) { 1016 while (g) {
1006 c = (struct gaim_connection *)g->data; 1017 c = (GaimConnection *)g->data;
1018
1019 account = gaim_connection_get_account(c);
1020
1007 g_snprintf(buf, sizeof(buf), "%s (%s)", 1021 g_snprintf(buf, sizeof(buf), "%s (%s)",
1008 c->username, c->prpl->info->name); 1022 gaim_account_get_username(account),
1023 c->prpl->info->name);
1009 opt = gtk_menu_item_new_with_label(buf); 1024 opt = gtk_menu_item_new_with_label(buf);
1010 g_object_set_data(G_OBJECT(opt), "addbuddy", b); 1025 g_object_set_data(G_OBJECT(opt), "addbuddy", b);
1011 g_signal_connect(G_OBJECT(opt), "activate", 1026 g_signal_connect(G_OBJECT(opt), "activate",
1012 G_CALLBACK(addbuddy_select_account), 1027 G_CALLBACK(addbuddy_select_account),
1013 c); 1028 c);
1035 gtk_widget_show(b->account); 1050 gtk_widget_show(b->account);
1036 gtk_widget_show(b->account->parent); 1051 gtk_widget_show(b->account->parent);
1037 1052
1038 } 1053 }
1039 1054
1040 void show_add_buddy(struct gaim_connection *gc, char *buddy, char *group, char *alias) 1055 void show_add_buddy(GaimConnection *gc, char *buddy, char *group, char *alias)
1041 { 1056 {
1042 GtkWidget *table; 1057 GtkWidget *table;
1043 GtkWidget *label; 1058 GtkWidget *label;
1044 GtkWidget *hbox; 1059 GtkWidget *hbox;
1045 GtkWidget *vbox; 1060 GtkWidget *vbox;
1046 struct gaim_gtk_buddy_list *gtkblist; 1061 struct gaim_gtk_buddy_list *gtkblist;
1047 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG); 1062 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG);
1048 struct addbuddy *a = g_new0(struct addbuddy, 1); 1063 struct addbuddy *a = g_new0(struct addbuddy, 1);
1049 a->gc = gc ? gc : connections->data; 1064 a->gc = gc ? gc : gaim_connections_get_all()->data;
1050 1065
1051 gtkblist = GAIM_GTK_BLIST(gaim_get_blist()); 1066 gtkblist = GAIM_GTK_BLIST(gaim_get_blist());
1052 1067
1053 GAIM_DIALOG(a->window); 1068 GAIM_DIALOG(a->window);
1054 a->window = gtk_dialog_new_with_buttons(_("Add Buddy"), gtkblist->window ? GTK_WINDOW(gtkblist->window) : NULL, 0, 1069 a->window = gtk_dialog_new_with_buttons(_("Add Buddy"), gtkblist->window ? GTK_WINDOW(gtkblist->window) : NULL, 0,
1139 if (group != NULL) 1154 if (group != NULL)
1140 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry), group); 1155 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry), group);
1141 } 1156 }
1142 1157
1143 struct addchat { 1158 struct addchat {
1144 struct gaim_account *account; 1159 GaimAccount *account;
1145 GtkWidget *window; 1160 GtkWidget *window;
1146 GtkWidget *account_menu; 1161 GtkWidget *account_menu;
1147 GtkWidget *alias_entry; 1162 GtkWidget *alias_entry;
1148 GtkWidget *group_combo; 1163 GtkWidget *group_combo;
1149 GtkWidget *entries_box; 1164 GtkWidget *entries_box;
1265 } 1280 }
1266 1281
1267 gtk_widget_show_all(ac->entries_box); 1282 gtk_widget_show_all(ac->entries_box);
1268 } 1283 }
1269 1284
1270 static void addchat_select_account(GObject *w, struct gaim_connection *gc) 1285 static void addchat_select_account(GObject *w, GaimConnection *gc)
1271 { 1286 {
1272 struct addchat *ac = g_object_get_data(w, "addchat"); 1287 struct addchat *ac = g_object_get_data(w, "addchat");
1273 1288
1274 if(ac->account->protocol == gc->account->protocol) { 1289 if(ac->account->protocol == gc->account->protocol) {
1275 ac->account = gc->account; 1290 ac->account = gc->account;
1280 } 1295 }
1281 1296
1282 static void create_online_account_menu_for_add_chat(struct addchat *ac) 1297 static void create_online_account_menu_for_add_chat(struct addchat *ac)
1283 { 1298 {
1284 char buf[2048]; /* Never hurts to be safe ;-) */ 1299 char buf[2048]; /* Never hurts to be safe ;-) */
1285 GSList *g = connections; 1300 GList *g = gaim_connections_get_all();
1286 struct gaim_connection *c; 1301 GaimConnection *c;
1302 GaimAccount *account;
1287 GtkWidget *menu, *opt; 1303 GtkWidget *menu, *opt;
1288 int count = 0; 1304 int count = 0;
1289 int place = 0; 1305 int place = 0;
1290 1306
1291 menu = gtk_menu_new(); 1307 menu = gtk_menu_new();
1292 1308
1293 while (g) { 1309 while (g) {
1294 c = (struct gaim_connection *)g->data; 1310 c = (GaimConnection *)g->data;
1311 account = gaim_connection_get_account(c);
1312
1295 if (GAIM_PLUGIN_PROTOCOL_INFO(c->prpl)->join_chat) { 1313 if (GAIM_PLUGIN_PROTOCOL_INFO(c->prpl)->join_chat) {
1296 g_snprintf(buf, sizeof(buf), "%s (%s)", 1314 g_snprintf(buf, sizeof(buf), "%s (%s)",
1297 c->username, c->prpl->info->name); 1315 gaim_account_get_username(account),
1316 c->prpl->info->name);
1298 opt = gtk_menu_item_new_with_label(buf); 1317 opt = gtk_menu_item_new_with_label(buf);
1299 g_object_set_data(G_OBJECT(opt), "addchat", ac); 1318 g_object_set_data(G_OBJECT(opt), "addchat", ac);
1300 g_signal_connect(G_OBJECT(opt), "activate", 1319 g_signal_connect(G_OBJECT(opt), "activate",
1301 G_CALLBACK(addchat_select_account), 1320 G_CALLBACK(addchat_select_account),
1302 c); 1321 c);
1321 gtk_option_menu_remove_menu(GTK_OPTION_MENU(ac->account_menu)); 1340 gtk_option_menu_remove_menu(GTK_OPTION_MENU(ac->account_menu));
1322 gtk_option_menu_set_menu(GTK_OPTION_MENU(ac->account_menu), menu); 1341 gtk_option_menu_set_menu(GTK_OPTION_MENU(ac->account_menu), menu);
1323 gtk_option_menu_set_history(GTK_OPTION_MENU(ac->account_menu), place); 1342 gtk_option_menu_set_history(GTK_OPTION_MENU(ac->account_menu), place);
1324 } 1343 }
1325 1344
1326 void show_add_chat(struct gaim_account *account, struct group *group) { 1345 void show_add_chat(GaimAccount *account, struct group *group) {
1327 struct addchat *ac = g_new0(struct addchat, 1); 1346 struct addchat *ac = g_new0(struct addchat, 1);
1328 struct gaim_gtk_buddy_list *gtkblist; 1347 struct gaim_gtk_buddy_list *gtkblist;
1329 GSList *c; 1348 GList *c;
1330 struct gaim_connection *gc; 1349 GaimConnection *gc;
1331 1350
1332 GtkWidget *label; 1351 GtkWidget *label;
1333 GtkWidget *rowbox; 1352 GtkWidget *rowbox;
1334 GtkWidget *hbox; 1353 GtkWidget *hbox;
1335 GtkWidget *vbox; 1354 GtkWidget *vbox;
1340 1359
1341 if (account) { 1360 if (account) {
1342 ac->account = account; 1361 ac->account = account;
1343 } else { 1362 } else {
1344 /* Select an account with chat capabilities */ 1363 /* Select an account with chat capabilities */
1345 for (c = connections; c != NULL; c = c->next) { 1364 for (c = gaim_connections_get_all(); c != NULL; c = c->next) {
1346 gc = c->data; 1365 gc = c->data;
1347 1366
1348 if (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->join_chat) { 1367 if (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->join_chat) {
1349 ac->account = gc->account; 1368 ac->account = gc->account;
1350 break; 1369 break;
1446 * Privacy Settings * 1465 * Privacy Settings *
1447 *------------------------------------------------------------------------*/ 1466 *------------------------------------------------------------------------*/
1448 static GtkWidget *deny_type = NULL; 1467 static GtkWidget *deny_type = NULL;
1449 static GtkWidget *deny_conn_hbox = NULL; 1468 static GtkWidget *deny_conn_hbox = NULL;
1450 static GtkWidget *deny_opt_menu = NULL; 1469 static GtkWidget *deny_opt_menu = NULL;
1451 static struct gaim_connection *current_deny_gc = NULL; 1470 static GaimConnection *current_deny_gc = NULL;
1452 static gboolean current_is_deny = FALSE; 1471 static gboolean current_is_deny = FALSE;
1453 static GtkWidget *allow_list = NULL; 1472 static GtkWidget *allow_list = NULL;
1454 static GtkWidget *block_list = NULL; 1473 static GtkWidget *block_list = NULL;
1455 1474
1456 static GtkListStore *block_store = NULL; 1475 static GtkListStore *block_store = NULL;
1460 { 1479 {
1461 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) 1480 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
1462 return; 1481 return;
1463 1482
1464 gaim_debug(GAIM_DEBUG_INFO, "privacy", "Setting deny mode %d\n", data); 1483 gaim_debug(GAIM_DEBUG_INFO, "privacy", "Setting deny mode %d\n", data);
1465 current_deny_gc->account->permdeny = data; 1484 current_deny_gc->account->perm_deny = data;
1466 serv_set_permit_deny(current_deny_gc); 1485 serv_set_permit_deny(current_deny_gc);
1467 gaim_blist_save(); 1486 gaim_blist_save();
1468 } 1487 }
1469 1488
1470 static GtkWidget *deny_opt(char *label, int which, GtkWidget *set) 1489 static GtkWidget *deny_opt(char *label, int which, GtkWidget *set)
1479 GTK_RADIO_BUTTON(set)), 1498 GTK_RADIO_BUTTON(set)),
1480 label); 1499 label);
1481 1500
1482 g_signal_connect(G_OBJECT(opt), "toggled", G_CALLBACK(set_deny_mode), (void *)which); 1501 g_signal_connect(G_OBJECT(opt), "toggled", G_CALLBACK(set_deny_mode), (void *)which);
1483 gtk_widget_show(opt); 1502 gtk_widget_show(opt);
1484 if (current_deny_gc->account->permdeny == which) 1503 if (current_deny_gc->account->perm_deny == which)
1485 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(opt), TRUE); 1504 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(opt), TRUE);
1486 1505
1487 return opt; 1506 return opt;
1488 } 1507 }
1489 1508
1504 1523
1505 static void set_deny_type() 1524 static void set_deny_type()
1506 { 1525 {
1507 GSList *bg = gtk_radio_button_get_group(GTK_RADIO_BUTTON(deny_type)); 1526 GSList *bg = gtk_radio_button_get_group(GTK_RADIO_BUTTON(deny_type));
1508 1527
1509 switch (current_deny_gc->account->permdeny) { 1528 switch (current_deny_gc->account->perm_deny) {
1510 case 5: 1529 case 5:
1511 bg = bg->next->next; 1530 bg = bg->next->next;
1512 break; 1531 break;
1513 case 4: 1532 case 4:
1514 break; 1533 break;
1571 1590
1572 d = d->next; 1591 d = d->next;
1573 } 1592 }
1574 } 1593 }
1575 1594
1576 static void deny_gc_opt(GtkWidget *opt, struct gaim_connection *gc) 1595 static void deny_gc_opt(GtkWidget *opt, GaimConnection *gc)
1577 { 1596 {
1578 current_deny_gc = gc; 1597 current_deny_gc = gc;
1579 set_deny_type(); 1598 set_deny_type();
1580 build_allow_list(); 1599 build_allow_list();
1581 build_block_list(); 1600 build_block_list();
1583 1602
1584 static void build_deny_menu() 1603 static void build_deny_menu()
1585 { 1604 {
1586 GtkWidget *menu; 1605 GtkWidget *menu;
1587 GtkWidget *opt; 1606 GtkWidget *opt;
1588 GSList *c = connections; 1607 GList *c = gaim_connections_get_all();
1589 struct gaim_connection *gc; 1608 GaimConnection *gc;
1609 GaimAccount *account;
1590 int count = 0; 1610 int count = 0;
1591 gboolean found = FALSE; 1611 gboolean found = FALSE;
1592 char buf[2048]; 1612 char buf[2048];
1593 1613
1594 if (g_slist_length(connections) == 1) { 1614 if (g_list_length(gaim_connections_get_all()) == 1) {
1595 gtk_widget_hide(deny_conn_hbox); 1615 gtk_widget_hide(deny_conn_hbox);
1596 return; 1616 return;
1597 } else 1617 } else
1598 gtk_widget_show(deny_conn_hbox); 1618 gtk_widget_show(deny_conn_hbox);
1599 1619
1600 menu = gtk_menu_new(); 1620 menu = gtk_menu_new();
1601 1621
1602 while (c) { 1622 while (c) {
1603 gc = (struct gaim_connection *)c->data; 1623 gc = (GaimConnection *)c->data;
1604 c = c->next; 1624 c = c->next;
1605 1625
1606 if (!GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->set_permit_deny) 1626 if (!GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->set_permit_deny)
1607 continue; 1627 continue;
1608 1628
1629 account = gaim_connection_get_account(gc);
1630
1609 g_snprintf(buf, sizeof buf, "%s (%s)", 1631 g_snprintf(buf, sizeof buf, "%s (%s)",
1610 gc->username, gc->prpl->info->name); 1632 gaim_account_get_username(account), gc->prpl->info->name);
1611 opt = gtk_menu_item_new_with_label(buf); 1633 opt = gtk_menu_item_new_with_label(buf);
1612 g_signal_connect(G_OBJECT(opt), "activate", G_CALLBACK(deny_gc_opt), gc); 1634 g_signal_connect(G_OBJECT(opt), "activate", G_CALLBACK(deny_gc_opt), gc);
1613 gtk_widget_show(opt); 1635 gtk_widget_show(opt);
1614 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); 1636 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt);
1615 if (gc == current_deny_gc) 1637 if (gc == current_deny_gc)
1617 else if (!found) 1639 else if (!found)
1618 count++; 1640 count++;
1619 } 1641 }
1620 1642
1621 if (!found) { 1643 if (!found) {
1622 current_deny_gc = connections->data; 1644 current_deny_gc = gaim_connections_get_all()->data;
1623 count = 0; 1645 count = 0;
1624 } 1646 }
1625 1647
1626 gtk_option_menu_remove_menu(GTK_OPTION_MENU(deny_opt_menu)); 1648 gtk_option_menu_remove_menu(GTK_OPTION_MENU(deny_opt_menu));
1627 gtk_option_menu_set_menu(GTK_OPTION_MENU(deny_opt_menu), menu); 1649 gtk_option_menu_set_menu(GTK_OPTION_MENU(deny_opt_menu), menu);
1698 } 1720 }
1699 1721
1700 gaim_blist_save(); 1722 gaim_blist_save();
1701 } 1723 }
1702 1724
1703 GtkWidget *privacy_win; 1725 static GtkWidget *privacy_win;
1726
1704 void update_privacy_connections() { /* This is a slightly better name */ 1727 void update_privacy_connections() { /* This is a slightly better name */
1705 gboolean needdeny = FALSE; 1728 gboolean needdeny = FALSE;
1706 GSList *c = connections; 1729 GList *c = gaim_connections_get_all();
1707 struct gaim_connection *gc = NULL; 1730 GaimConnection *gc = NULL;
1708 1731
1709 if (!privacy_win) 1732 if (!privacy_win)
1710 return; 1733 return;
1711 1734
1712 while (c) { 1735 while (c) {
1747 GtkSizeGroup *sg2 = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); 1770 GtkSizeGroup *sg2 = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
1748 GtkCellRenderer *rend; 1771 GtkCellRenderer *rend;
1749 GtkTreeViewColumn *col; 1772 GtkTreeViewColumn *col;
1750 GtkWidget *table; 1773 GtkWidget *table;
1751 1774
1752 current_deny_gc = connections->data; /* this is safe because this screen will only be 1775 current_deny_gc = gaim_connections_get_all()->data; /* this is safe because this screen will only be
1753 available when there are connections */ 1776 available when there are gaim_connections_get_all() */
1754 current_is_deny = TRUE; 1777 current_is_deny = TRUE;
1755 1778
1756 privacy_win = pwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); 1779 privacy_win = pwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
1757 gtk_window_set_resizable(GTK_WINDOW(pwin), FALSE); 1780 gtk_window_set_resizable(GTK_WINDOW(pwin), FALSE);
1758 gtk_window_set_role(GTK_WINDOW(pwin), "privacy"); 1781 gtk_window_set_role(GTK_WINDOW(pwin), "privacy");
1904 /*------------------------------------------------------------------------*/ 1927 /*------------------------------------------------------------------------*/
1905 1928
1906 void do_save_info(GtkWidget *widget, struct set_info_dlg *b) 1929 void do_save_info(GtkWidget *widget, struct set_info_dlg *b)
1907 { 1930 {
1908 gchar *junk; 1931 gchar *junk;
1909 struct gaim_connection *gc; 1932 GaimConnection *gc;
1910 1933
1911 junk = gtk_text_view_get_text(GTK_TEXT_VIEW(b->text), FALSE); 1934 junk = gtk_text_view_get_text(GTK_TEXT_VIEW(b->text), FALSE);
1912 1935
1913 if (b->account) { 1936 if (b->account) {
1914 strncpy_withhtml(b->account->user_info, junk, sizeof b->account->user_info); 1937 strncpy_withhtml(b->account->user_info, junk, sizeof b->account->user_info);
1939 1962
1940 destroy_dialog(NULL, b->window); 1963 destroy_dialog(NULL, b->window);
1941 g_free(b); 1964 g_free(b);
1942 } 1965 }
1943 1966
1944 void show_set_dir(struct gaim_connection *gc) 1967 void show_set_dir(GaimConnection *gc)
1945 { 1968 {
1969 GaimAccount *account;
1946 GtkWidget *label; 1970 GtkWidget *label;
1947 GtkWidget *bot; 1971 GtkWidget *bot;
1948 GtkWidget *vbox; 1972 GtkWidget *vbox;
1949 GtkWidget *hbox; 1973 GtkWidget *hbox;
1950 GtkWidget *frame; 1974 GtkWidget *frame;
1951 GtkWidget *fbox; 1975 GtkWidget *fbox;
1952 char buf[256]; 1976 char buf[256];
1953 1977
1954 struct set_dir_dlg *b = g_new0(struct set_dir_dlg, 1); 1978 struct set_dir_dlg *b = g_new0(struct set_dir_dlg, 1);
1979
1955 b->gc = gc; 1980 b->gc = gc;
1981
1982 account = gaim_connection_get_account(gc);
1956 1983
1957 GAIM_DIALOG(b->window); 1984 GAIM_DIALOG(b->window);
1958 dialogwindows = g_list_prepend(dialogwindows, b->window); 1985 dialogwindows = g_list_prepend(dialogwindows, b->window);
1959 gtk_window_set_role(GTK_WINDOW(b->window), "set_dir"); 1986 gtk_window_set_role(GTK_WINDOW(b->window), "set_dir");
1960 gtk_window_set_resizable(GTK_WINDOW(b->window), TRUE); 1987 gtk_window_set_resizable(GTK_WINDOW(b->window), TRUE);
1974 vbox = gtk_vbox_new(FALSE, 5); 2001 vbox = gtk_vbox_new(FALSE, 5);
1975 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); 2002 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
1976 gtk_container_add(GTK_CONTAINER(frame), vbox); 2003 gtk_container_add(GTK_CONTAINER(frame), vbox);
1977 gtk_widget_show(vbox); 2004 gtk_widget_show(vbox);
1978 2005
1979 g_snprintf(buf, sizeof(buf), _("Setting Dir Info for %s:"), gc->username); 2006 g_snprintf(buf, sizeof(buf), _("Setting Dir Info for %s:"),
2007 gaim_account_get_username(account));
1980 label = gtk_label_new(buf); 2008 label = gtk_label_new(buf);
1981 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); 2009 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
1982 gtk_widget_show(label); 2010 gtk_widget_show(label);
1983 2011
1984 b->first = gtk_entry_new(); 2012 b->first = gtk_entry_new();
2128 2156
2129 destroy_dialog(NULL, b->window); 2157 destroy_dialog(NULL, b->window);
2130 g_free(b); 2158 g_free(b);
2131 } 2159 }
2132 2160
2133 void show_change_passwd(struct gaim_connection *gc) 2161 void show_change_passwd(GaimConnection *gc)
2134 { 2162 {
2163 GaimAccount *account;
2135 GtkWidget *hbox; 2164 GtkWidget *hbox;
2136 GtkWidget *label; 2165 GtkWidget *label;
2137 GtkWidget *vbox; 2166 GtkWidget *vbox;
2138 GtkWidget *fbox; 2167 GtkWidget *fbox;
2139 GtkWidget *frame; 2168 GtkWidget *frame;
2140 char buf[256]; 2169 char buf[256];
2141 2170
2142 struct passwddlg *b = g_new0(struct passwddlg, 1); 2171 struct passwddlg *b = g_new0(struct passwddlg, 1);
2143 b->gc = gc; 2172 b->gc = gc;
2173
2174 account = gaim_connection_get_account(gc);
2144 2175
2145 GAIM_DIALOG(b->window); 2176 GAIM_DIALOG(b->window);
2146 gtk_window_set_resizable(GTK_WINDOW(b->window), TRUE); 2177 gtk_window_set_resizable(GTK_WINDOW(b->window), TRUE);
2147 gtk_window_set_role(GTK_WINDOW(b->window), "change_passwd"); 2178 gtk_window_set_role(GTK_WINDOW(b->window), "change_passwd");
2148 gtk_window_set_title(GTK_WINDOW(b->window), _("Change Password")); 2179 gtk_window_set_title(GTK_WINDOW(b->window), _("Change Password"));
2159 2190
2160 vbox = gtk_vbox_new(FALSE, 5); 2191 vbox = gtk_vbox_new(FALSE, 5);
2161 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); 2192 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2162 gtk_container_add(GTK_CONTAINER(frame), vbox); 2193 gtk_container_add(GTK_CONTAINER(frame), vbox);
2163 2194
2164 g_snprintf(buf, sizeof(buf), _("Changing password for %s:"), gc->username); 2195 g_snprintf(buf, sizeof(buf), _("Changing password for %s:"), gaim_account_get_username(account));
2165 label = gtk_label_new(buf); 2196 label = gtk_label_new(buf);
2166 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); 2197 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
2167 2198
2168 /* First Line */ 2199 /* First Line */
2169 hbox = gtk_hbox_new(FALSE, 5); 2200 hbox = gtk_hbox_new(FALSE, 5);
2211 g_signal_connect(G_OBJECT(b->cancel), "clicked", G_CALLBACK(destroy_dialog), b->window); 2242 g_signal_connect(G_OBJECT(b->cancel), "clicked", G_CALLBACK(destroy_dialog), b->window);
2212 2243
2213 gtk_widget_show_all(b->window); 2244 gtk_widget_show_all(b->window);
2214 } 2245 }
2215 2246
2216 void show_set_info(struct gaim_connection *gc) 2247 void show_set_info(GaimConnection *gc)
2217 { 2248 {
2218 GtkWidget *buttons; 2249 GtkWidget *buttons;
2219 GtkWidget *label; 2250 GtkWidget *label;
2220 GtkWidget *vbox; 2251 GtkWidget *vbox;
2221 GtkTextBuffer *buffer; 2252 GtkTextBuffer *buffer;
2222 GtkWidget *frame; 2253 GtkWidget *frame;
2223 gchar *buf; 2254 gchar *buf;
2224 struct gaim_account *account; 2255 GaimAccount *account;
2225 2256
2226 struct set_info_dlg *b = g_new0(struct set_info_dlg, 1); 2257 struct set_info_dlg *b = g_new0(struct set_info_dlg, 1);
2227 account = gc->account; 2258 account = gc->account;
2228 b->account = account; 2259 b->account = account;
2229 2260
2237 vbox = gtk_vbox_new(FALSE, 5); 2268 vbox = gtk_vbox_new(FALSE, 5);
2238 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); 2269 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2239 gtk_container_add(GTK_CONTAINER(b->window), vbox); 2270 gtk_container_add(GTK_CONTAINER(b->window), vbox);
2240 2271
2241 buf = g_malloc(256); 2272 buf = g_malloc(256);
2242 g_snprintf(buf, 256, _("Changing info for %s:"), account->username); 2273 g_snprintf(buf, 256, _("Changing info for %s:"),
2274 gaim_account_get_username(account));
2243 label = gtk_label_new(buf); 2275 label = gtk_label_new(buf);
2244 g_free(buf); 2276 g_free(buf);
2245 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); 2277 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
2246 2278
2247 frame = gtk_frame_new(NULL); 2279 frame = gtk_frame_new(NULL);
2289 * 1, don't show if regular info isn't shown 2321 * 1, don't show if regular info isn't shown
2290 * 2, show regardless but don't try to get away message 2322 * 2, show regardless but don't try to get away message
2291 * 2323 *
2292 * i wish this were my client. if i were i wouldn't have to deal with this shit. 2324 * i wish this were my client. if i were i wouldn't have to deal with this shit.
2293 */ 2325 */
2294 void g_show_info_text(struct gaim_connection *gc, const char *who, int away, const char *info, ...) 2326 void g_show_info_text(GaimConnection *gc, const char *who, int away, const char *info, ...)
2295 { 2327 {
2296 GtkWidget *ok; 2328 GtkWidget *ok;
2297 GtkWidget *label; 2329 GtkWidget *label;
2298 GtkWidget *text; 2330 GtkWidget *text;
2299 GtkWidget *bbox; 2331 GtkWidget *bbox;
2401 destroy_dialog(NULL, p->window); 2433 destroy_dialog(NULL, p->window);
2402 } 2434 }
2403 2435
2404 2436
2405 2437
2406 void show_add_perm(struct gaim_connection *gc, char *who, gboolean permit) 2438 void show_add_perm(GaimConnection *gc, char *who, gboolean permit)
2407 { 2439 {
2408 GtkWidget *cancel; 2440 GtkWidget *cancel;
2409 GtkWidget *add; 2441 GtkWidget *add;
2410 GtkWidget *label; 2442 GtkWidget *label;
2411 GtkWidget *bbox; 2443 GtkWidget *bbox;
2593 serv_dir_search(b->gc, "", "", "", "", "", "", "", email); 2625 serv_dir_search(b->gc, "", "", "", "", "", "", "", email);
2594 2626
2595 destroy_dialog(NULL, b->window); 2627 destroy_dialog(NULL, b->window);
2596 } 2628 }
2597 2629
2598 void show_find_info(struct gaim_connection *gc) 2630 void show_find_info(GaimConnection *gc)
2599 { 2631 {
2600 GtkWidget *cancel; 2632 GtkWidget *cancel;
2601 GtkWidget *ok; 2633 GtkWidget *ok;
2602 GtkWidget *label; 2634 GtkWidget *label;
2603 GtkWidget *bbox; 2635 GtkWidget *bbox;
2721 gtk_widget_realize(b->window); 2753 gtk_widget_realize(b->window);
2722 2754
2723 gtk_widget_show_all(b->window); 2755 gtk_widget_show_all(b->window);
2724 } 2756 }
2725 2757
2726 void show_find_email(struct gaim_connection *gc) 2758 void show_find_email(GaimConnection *gc)
2727 { 2759 {
2728 GtkWidget *label; 2760 GtkWidget *label;
2729 GtkWidget *bbox; 2761 GtkWidget *bbox;
2730 GtkWidget *vbox; 2762 GtkWidget *vbox;
2731 GtkWidget *frame; 2763 GtkWidget *frame;
2732 GtkWidget *topbox; 2764 GtkWidget *topbox;
2733 GtkWidget *button; 2765 GtkWidget *button;
2734 2766
2735 struct findbyemail *b = g_new0(struct findbyemail, 1); 2767 struct findbyemail *b = g_new0(struct findbyemail, 1);
2736 if (g_slist_find(connections, gc)) 2768 if (g_list_find(gaim_connections_get_all(), gc))
2737 b->gc = gc; 2769 b->gc = gc;
2738 GAIM_DIALOG(b->window); 2770 GAIM_DIALOG(b->window);
2739 gtk_window_set_resizable(GTK_WINDOW(b->window), TRUE); 2771 gtk_window_set_resizable(GTK_WINDOW(b->window), TRUE);
2740 gtk_window_set_role(GTK_WINDOW(b->window), "find_email"); 2772 gtk_window_set_role(GTK_WINDOW(b->window), "find_email");
2741 gtk_widget_realize(b->window); 2773 gtk_widget_realize(b->window);
4340 struct buddy *b; 4372 struct buddy *b;
4341 4373
4342 new_name = gtk_entry_get_text(GTK_ENTRY(entry)); 4374 new_name = gtk_entry_get_text(GTK_ENTRY(entry));
4343 b = g_object_get_data(obj, "buddy"); 4375 b = g_object_get_data(obj, "buddy");
4344 4376
4345 if (!g_slist_find(connections, b->account->gc)) { 4377 if (!g_list_find(gaim_connections_get_all(), b->account->gc)) {
4346 destroy_dialog(rename_bud_dialog, rename_bud_dialog); 4378 destroy_dialog(rename_bud_dialog, rename_bud_dialog);
4347 return; 4379 return;
4348 } 4380 }
4349 4381
4350 if (new_name && (strlen(new_name) != 0) && strcmp(new_name, b->name)) { 4382 if (new_name && (strlen(new_name) != 0) && strcmp(new_name, b->name)) {
5007 * formatter and save the user info data. 5039 * formatter and save the user info data.
5008 */ 5040 */
5009 void set_vcard_dialog_ok_clicked(GtkWidget *widget, gpointer data) 5041 void set_vcard_dialog_ok_clicked(GtkWidget *widget, gpointer data)
5010 { 5042 {
5011 MultiEntryDlg *b = (MultiEntryDlg *) data; 5043 MultiEntryDlg *b = (MultiEntryDlg *) data;
5012 struct gaim_connection *gc; 5044 GaimConnection *gc;
5013 gchar *tmp; 5045 gchar *tmp;
5014 GSList *list; 5046 GSList *list;
5015 5047
5016 for(list = b->multi_entry_items; list != NULL; list = list->next) { 5048 for(list = b->multi_entry_items; list != NULL; list = list->next) {
5017 if(((MultiEntryData *) list->data)->text != NULL) { 5049 if(((MultiEntryData *) list->data)->text != NULL) {