| 1021 g_snprintf(user->proto_opt[USEROPT_AUTH], |
1012 g_snprintf(user->proto_opt[USEROPT_AUTH], |
| 1022 sizeof(user->proto_opt[USEROPT_AUTH]), "%s", gtk_entry_get_text(entry)); |
1013 sizeof(user->proto_opt[USEROPT_AUTH]), "%s", gtk_entry_get_text(entry)); |
| 1023 } else if (entrynum == USEROPT_AUTHPORT) { |
1014 } else if (entrynum == USEROPT_AUTHPORT) { |
| 1024 g_snprintf(user->proto_opt[USEROPT_AUTHPORT], |
1015 g_snprintf(user->proto_opt[USEROPT_AUTHPORT], |
| 1025 sizeof(user->proto_opt[USEROPT_AUTHPORT]), "%s", gtk_entry_get_text(entry)); |
1016 sizeof(user->proto_opt[USEROPT_AUTHPORT]), "%s", gtk_entry_get_text(entry)); |
| 1026 } else if (entrynum == USEROPT_PROXYHOST) { |
1017 } |
| 1027 g_snprintf(user->proto_opt[USEROPT_PROXYHOST], |
|
| 1028 sizeof(user->proto_opt[USEROPT_PROXYHOST]), "%s", gtk_entry_get_text(entry)); |
|
| 1029 } else if (entrynum == USEROPT_PROXYPORT) { |
|
| 1030 g_snprintf(user->proto_opt[USEROPT_PROXYPORT], |
|
| 1031 sizeof(user->proto_opt[USEROPT_PROXYPORT]), "%s", gtk_entry_get_text(entry)); |
|
| 1032 } else if (entrynum == USEROPT_USER) { |
|
| 1033 g_snprintf(user->proto_opt[USEROPT_USER], |
|
| 1034 sizeof(user->proto_opt[USEROPT_USER]), "%s", gtk_entry_get_text(entry)); |
|
| 1035 } else if (entrynum == USEROPT_PASS) { |
|
| 1036 g_snprintf(user->proto_opt[USEROPT_PASS], |
|
| 1037 sizeof(user->proto_opt[USEROPT_PASS]), "%s", gtk_entry_get_text(entry)); |
|
| 1038 } |
|
| 1039 } |
|
| 1040 |
|
| 1041 static void toc_print_optionrad(GtkRadioButton * entry, struct aim_user *user) |
|
| 1042 { |
|
| 1043 int entrynum; |
|
| 1044 |
|
| 1045 entrynum = (int)gtk_object_get_user_data(GTK_OBJECT(entry)); |
|
| 1046 |
|
| 1047 g_snprintf(user->proto_opt[USEROPT_PROXYTYPE], |
|
| 1048 sizeof(user->proto_opt[USEROPT_PROXYTYPE]), "%d", entrynum); |
|
| 1049 } |
1018 } |
| 1050 |
1019 |
| 1051 static void toc_user_opts(GtkWidget *book, struct aim_user *user) |
1020 static void toc_user_opts(GtkWidget *book, struct aim_user *user) |
| 1052 { |
1021 { |
| 1053 /* so here, we create the new notebook page */ |
1022 /* so here, we create the new notebook page */ |
| 1054 GtkWidget *vbox; |
1023 GtkWidget *vbox; |
| 1055 GtkWidget *hbox; |
1024 GtkWidget *hbox; |
| 1056 GtkWidget *label; |
1025 GtkWidget *label; |
| 1057 GtkWidget *entry; |
1026 GtkWidget *entry; |
| 1058 GtkWidget *first, *opt; |
|
| 1059 |
1027 |
| 1060 vbox = gtk_vbox_new(FALSE, 5); |
1028 vbox = gtk_vbox_new(FALSE, 5); |
| 1061 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
1029 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
| 1062 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, gtk_label_new("TOC Options")); |
1030 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, gtk_label_new("TOC Options")); |
| 1063 gtk_widget_show(vbox); |
1031 gtk_widget_show(vbox); |
| 1097 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTHPORT]); |
1065 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTHPORT]); |
| 1098 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTHPORT]); |
1066 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTHPORT]); |
| 1099 } else |
1067 } else |
| 1100 gtk_entry_set_text(GTK_ENTRY(entry), "9898"); |
1068 gtk_entry_set_text(GTK_ENTRY(entry), "9898"); |
| 1101 |
1069 |
| 1102 gtk_widget_show(entry); |
|
| 1103 |
|
| 1104 hbox = gtk_hbox_new(TRUE, 0); |
|
| 1105 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
| 1106 gtk_widget_show(hbox); |
|
| 1107 |
|
| 1108 first = gtk_radio_button_new_with_label(NULL, "No proxy"); |
|
| 1109 gtk_box_pack_start(GTK_BOX(hbox), first, FALSE, FALSE, 0); |
|
| 1110 gtk_object_set_user_data(GTK_OBJECT(first), (void *)PROXY_NONE); |
|
| 1111 gtk_signal_connect(GTK_OBJECT(first), "clicked", GTK_SIGNAL_FUNC(toc_print_optionrad), user); |
|
| 1112 gtk_widget_show(first); |
|
| 1113 if (atoi(user->proto_opt[USEROPT_PROXYTYPE]) == PROXY_NONE) |
|
| 1114 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(first), TRUE); |
|
| 1115 |
|
| 1116 opt = |
|
| 1117 gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(first)), "SOCKS 4"); |
|
| 1118 gtk_box_pack_start(GTK_BOX(hbox), opt, FALSE, FALSE, 0); |
|
| 1119 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)PROXY_SOCKS4); |
|
| 1120 gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(toc_print_optionrad), user); |
|
| 1121 gtk_widget_show(opt); |
|
| 1122 if (atoi(user->proto_opt[USEROPT_PROXYTYPE]) == PROXY_SOCKS4) |
|
| 1123 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); |
|
| 1124 |
|
| 1125 hbox = gtk_hbox_new(TRUE, 0); |
|
| 1126 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
| 1127 gtk_widget_show(hbox); |
|
| 1128 |
|
| 1129 opt = |
|
| 1130 gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(first)), "SOCKS 5"); |
|
| 1131 gtk_box_pack_start(GTK_BOX(hbox), opt, FALSE, FALSE, 0); |
|
| 1132 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)PROXY_SOCKS5); |
|
| 1133 gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(toc_print_optionrad), user); |
|
| 1134 gtk_widget_show(opt); |
|
| 1135 if (atoi(user->proto_opt[USEROPT_PROXYTYPE]) == PROXY_SOCKS5) |
|
| 1136 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); |
|
| 1137 |
|
| 1138 opt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(first)), "HTTP"); |
|
| 1139 gtk_box_pack_start(GTK_BOX(hbox), opt, FALSE, FALSE, 0); |
|
| 1140 gtk_object_set_user_data(GTK_OBJECT(opt), (void *)PROXY_HTTP); |
|
| 1141 gtk_signal_connect(GTK_OBJECT(opt), "clicked", GTK_SIGNAL_FUNC(toc_print_optionrad), user); |
|
| 1142 gtk_widget_show(opt); |
|
| 1143 if (atoi(user->proto_opt[USEROPT_PROXYTYPE]) == PROXY_HTTP) |
|
| 1144 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); |
|
| 1145 |
|
| 1146 hbox = gtk_hbox_new(FALSE, 0); |
|
| 1147 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
| 1148 gtk_widget_show(hbox); |
|
| 1149 |
|
| 1150 label = gtk_label_new("Proxy Host:"); |
|
| 1151 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
| 1152 gtk_widget_show(label); |
|
| 1153 |
|
| 1154 entry = gtk_entry_new(); |
|
| 1155 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
|
| 1156 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_PROXYHOST); |
|
| 1157 gtk_signal_connect(GTK_OBJECT(entry), "changed", GTK_SIGNAL_FUNC(toc_print_option), user); |
|
| 1158 if (user->proto_opt[USEROPT_PROXYHOST][0]) { |
|
| 1159 debug_printf("setting text %s\n", user->proto_opt[USEROPT_PROXYHOST]); |
|
| 1160 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_PROXYHOST]); |
|
| 1161 } |
|
| 1162 gtk_widget_show(entry); |
|
| 1163 |
|
| 1164 hbox = gtk_hbox_new(FALSE, 0); |
|
| 1165 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
| 1166 gtk_widget_show(hbox); |
|
| 1167 |
|
| 1168 label = gtk_label_new("Proxy Port:"); |
|
| 1169 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
| 1170 gtk_widget_show(label); |
|
| 1171 |
|
| 1172 entry = gtk_entry_new(); |
|
| 1173 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
|
| 1174 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_PROXYPORT); |
|
| 1175 gtk_signal_connect(GTK_OBJECT(entry), "changed", GTK_SIGNAL_FUNC(toc_print_option), user); |
|
| 1176 if (user->proto_opt[USEROPT_PROXYPORT][0]) { |
|
| 1177 debug_printf("setting text %s\n", user->proto_opt[USEROPT_PROXYPORT]); |
|
| 1178 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_PROXYPORT]); |
|
| 1179 } |
|
| 1180 gtk_widget_show(entry); |
|
| 1181 |
|
| 1182 hbox = gtk_hbox_new(FALSE, 0); |
|
| 1183 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
| 1184 gtk_widget_show(hbox); |
|
| 1185 |
|
| 1186 label = gtk_label_new("Proxy User:"); |
|
| 1187 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
| 1188 gtk_widget_show(label); |
|
| 1189 |
|
| 1190 entry = gtk_entry_new(); |
|
| 1191 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
|
| 1192 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_USER); |
|
| 1193 gtk_signal_connect(GTK_OBJECT(entry), "changed", GTK_SIGNAL_FUNC(toc_print_option), user); |
|
| 1194 if (user->proto_opt[USEROPT_USER][0]) { |
|
| 1195 debug_printf("setting text %s\n", user->proto_opt[USEROPT_USER]); |
|
| 1196 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_USER]); |
|
| 1197 } |
|
| 1198 gtk_widget_show(entry); |
|
| 1199 |
|
| 1200 hbox = gtk_hbox_new(FALSE, 5); |
|
| 1201 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
| 1202 gtk_widget_show(hbox); |
|
| 1203 |
|
| 1204 label = gtk_label_new("Proxy Password:"); |
|
| 1205 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
| 1206 gtk_widget_show(label); |
|
| 1207 |
|
| 1208 entry = gtk_entry_new(); |
|
| 1209 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0); |
|
| 1210 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
|
| 1211 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_PASS); |
|
| 1212 gtk_signal_connect(GTK_OBJECT(entry), "changed", GTK_SIGNAL_FUNC(toc_print_option), user); |
|
| 1213 if (user->proto_opt[USEROPT_PASS][0]) { |
|
| 1214 debug_printf("setting text %s\n", user->proto_opt[USEROPT_PASS]); |
|
| 1215 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_PASS]); |
|
| 1216 } |
|
| 1217 gtk_widget_show(entry); |
1070 gtk_widget_show(entry); |
| 1218 } |
1071 } |
| 1219 |
1072 |
| 1220 static void toc_add_permit(struct gaim_connection *gc, char *who) |
1073 static void toc_add_permit(struct gaim_connection *gc, char *who) |
| 1221 { |
1074 { |