Mercurial > pidgin
comparison src/multi.c @ 2956:b68c648618a3
[gaim-migrate @ 2969]
I Love Rock & Roll....
committer: Tailor Script <tailor@pidgin.im>
| author | Rob Flynn <gaim@robflynn.com> |
|---|---|
| date | Sun, 17 Feb 2002 18:08:12 +0000 |
| parents | f3c094e78609 |
| children | 626729653436 |
comparison
equal
deleted
inserted
replaced
| 2955:8b03506b8c1e | 2956:b68c648618a3 |
|---|---|
| 236 { | 236 { |
| 237 GList *tmp; | 237 GList *tmp; |
| 238 const char *txt; | 238 const char *txt; |
| 239 int i; | 239 int i; |
| 240 struct aim_user *a; | 240 struct aim_user *a; |
| 241 struct prpl *p; | |
| 241 | 242 |
| 242 if (!u->user) { | 243 if (!u->user) { |
| 243 txt = gtk_entry_get_text(GTK_ENTRY(u->name)); | 244 txt = gtk_entry_get_text(GTK_ENTRY(u->name)); |
| 244 u->user = new_user(txt, u->protocol, u->options); | 245 u->user = new_user(txt, u->protocol, u->options); |
| 245 } | 246 } |
| 276 g_snprintf(a->iconfile, sizeof(a->iconfile), "%s", u->iconfile); | 277 g_snprintf(a->iconfile, sizeof(a->iconfile), "%s", u->iconfile); |
| 277 if (u->icondlg) | 278 if (u->icondlg) |
| 278 gtk_widget_destroy(u->icondlg); | 279 gtk_widget_destroy(u->icondlg); |
| 279 u->icondlg = NULL; | 280 u->icondlg = NULL; |
| 280 | 281 |
| 282 /* | |
| 283 * See if user registration is supported/required | |
| 284 */ | |
| 285 if((p = find_prpl(u->protocol)) == NULL) { | |
| 286 /* TBD: error dialog here! (This should never happen, you know...) */ | |
| 287 fprintf(stderr, "dbg: couldn't find protocol for protocol number %d!\n", u->protocol); | |
| 288 fflush(stderr); | |
| 289 } else { | |
| 290 if(p->register_user != NULL && | |
| 291 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(u->register_user)) == TRUE) { | |
| 292 | |
| 293 p->register_user(a); | |
| 294 } | |
| 295 } | |
| 296 | |
| 297 save_prefs(); | |
| 298 | |
| 281 gtk_widget_destroy(u->mod); | 299 gtk_widget_destroy(u->mod); |
| 282 | |
| 283 save_prefs(); | |
| 284 } | 300 } |
| 285 | 301 |
| 286 static void cancel_mod(GtkWidget *w, struct mod_user *u) | 302 static void cancel_mod(GtkWidget *w, struct mod_user *u) |
| 287 { | 303 { |
| 288 if (u->opt_entries) | 304 if (u->opt_entries) |
| 646 u->opt_entries = g_list_append(u->opt_entries, entry); | 662 u->opt_entries = g_list_append(u->opt_entries, entry); |
| 647 | 663 |
| 648 g_free(puo); | 664 g_free(puo); |
| 649 op = op->next; | 665 op = op->next; |
| 650 } | 666 } |
| 667 | |
| 668 if(p->register_user != NULL) { | |
| 669 u->register_user = gtk_check_button_new_with_label("Register with server"); | |
| 670 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(u->register_user), FALSE); | |
| 671 gtk_box_pack_start(GTK_BOX(vbox), u->register_user, FALSE, FALSE, 0); | |
| 672 gtk_widget_show(u->register_user); | |
| 673 } | |
| 674 | |
| 651 g_list_free(tmp); | 675 g_list_free(tmp); |
| 652 } | 676 } |
| 653 | 677 |
| 654 static void show_acct_mod(struct aim_user *a) | 678 static void show_acct_mod(struct aim_user *a) |
| 655 { | 679 { |
| 1216 { | 1240 { |
| 1217 kicks = g_slist_remove(kicks, k); | 1241 kicks = g_slist_remove(kicks, k); |
| 1218 g_free(k); | 1242 g_free(k); |
| 1219 } | 1243 } |
| 1220 | 1244 |
| 1221 void hide_login_progress(struct gaim_connection *gc, char *why) | 1245 /* |
| 1246 * Common code for hide_login_progress(), and hide_login_progress_info() | |
| 1247 */ | |
| 1248 static void hide_login_progress_common(struct gaim_connection *gc, | |
| 1249 char *details, | |
| 1250 char *title, | |
| 1251 char *prologue) | |
| 1222 { | 1252 { |
| 1223 char buf[2048]; | 1253 char buf[2048]; |
| 1224 struct kick_dlg *k = find_kick_dlg(gc->user); | 1254 struct kick_dlg *k = find_kick_dlg(gc->user); |
| 1225 struct signon_meter *meter = find_signon_meter(gc); | 1255 struct signon_meter *meter = find_signon_meter(gc); |
| 1226 sprintf(buf, _("%s\n%s was unable to sign on: %s"), full_date(), gc->username, why); | 1256 sprintf(buf, _("%s\n%s: %s"), full_date(), prologue, details); |
| 1227 if (k) | 1257 if (k) |
| 1228 gtk_widget_destroy(k->dlg); | 1258 gtk_widget_destroy(k->dlg); |
| 1229 k = g_new0(struct kick_dlg, 1); | 1259 k = g_new0(struct kick_dlg, 1); |
| 1230 k->user = gc->user; | 1260 k->user = gc->user; |
| 1231 k->dlg = do_error_dialog(buf, _("Signon Error")); | 1261 k->dlg = do_error_dialog(buf, title); |
| 1232 kicks = g_slist_append(kicks, k); | 1262 kicks = g_slist_append(kicks, k); |
| 1233 gtk_signal_connect(GTK_OBJECT(k->dlg), "destroy", GTK_SIGNAL_FUNC(set_kick_null), k); | 1263 gtk_signal_connect(GTK_OBJECT(k->dlg), "destroy", GTK_SIGNAL_FUNC(set_kick_null), k); |
| 1234 if (meter) { | 1264 if (meter) { |
| 1235 gtk_widget_destroy(meter->window); | 1265 gtk_widget_destroy(meter->window); |
| 1236 meters = g_slist_remove(meters, meter); | 1266 meters = g_slist_remove(meters, meter); |
| 1237 g_free(meter); | 1267 g_free(meter); |
| 1238 } | 1268 } |
| 1269 } | |
| 1270 | |
| 1271 void hide_login_progress(struct gaim_connection *gc, char *why) | |
| 1272 { | |
| 1273 char buf[2048]; | |
| 1274 | |
| 1275 sprintf(buf, _("%s was unable to sign on"), gc->username); | |
| 1276 hide_login_progress_common(gc, why, _("Signon Error"), buf); | |
| 1277 } | |
| 1278 | |
| 1279 /* | |
| 1280 * Like hide_login_progress(), but for informational, not error/warning, | |
| 1281 * messages. | |
| 1282 * | |
| 1283 */ | |
| 1284 void hide_login_progress_notice(struct gaim_connection *gc, char *why) | |
| 1285 { | |
| 1286 hide_login_progress_common(gc, why, _("Notice"), gc->username); | |
| 1239 } | 1287 } |
| 1240 | 1288 |
| 1241 void signoff_all() | 1289 void signoff_all() |
| 1242 { | 1290 { |
| 1243 GSList *c = connections; | 1291 GSList *c = connections; |
