comparison src/multi.c @ 2203:14100685c95f

[gaim-migrate @ 2213] Robert McQueen pointed this out committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 31 Aug 2001 17:09:24 +0000
parents 53981aae4f8b
children 5014b802eb41
comparison
equal deleted inserted replaced
2202:6b68fbbac337 2203:14100685c95f
483 /* page 0 is general, keep it. page 1 is options for our 483 /* page 0 is general, keep it. page 1 is options for our
484 * particular protocol, so clear it out and make a new one. */ 484 * particular protocol, so clear it out and make a new one. */
485 485
486 gtk_notebook_remove_page(GTK_NOTEBOOK(book), 1); 486 gtk_notebook_remove_page(GTK_NOTEBOOK(book), 1);
487 487
488 if (!p)
489 return;
490
488 if (u && u->opt_entries) { 491 if (u && u->opt_entries) {
489 g_list_free(u->opt_entries); 492 g_list_free(u->opt_entries);
490 u->opt_entries = NULL; 493 u->opt_entries = NULL;
491 } else if (!u && tmpusr.opt_entries) { 494 } else if (!u && tmpusr.opt_entries) {
492 g_list_free(tmpusr.opt_entries); 495 g_list_free(tmpusr.opt_entries);
493 tmpusr.opt_entries = NULL; 496 tmpusr.opt_entries = NULL;
494 } 497 }
495 498
496 if (p && p->user_opts) { 499 if (p->user_opts) {
497 GList *op = (*p->user_opts)(); 500 GList *op = (*p->user_opts)();
498 GList *tmp = op; 501 GList *tmp = op;
499 502
500 GtkWidget *vbox; 503 GtkWidget *vbox;
501 GtkWidget *hbox; 504 GtkWidget *hbox;
582 gtk_container_add(GTK_CONTAINER(mod), box); 585 gtk_container_add(GTK_CONTAINER(mod), box);
583 586
584 book = gtk_notebook_new(); 587 book = gtk_notebook_new();
585 gtk_box_pack_start(GTK_BOX(box), book, FALSE, FALSE, 0); 588 gtk_box_pack_start(GTK_BOX(box), book, FALSE, FALSE, 0);
586 589
587 if (u) 590 if (u) {
588 u->tmp_protocol = u->protocol; 591 if (find_prpl(u->protocol))
589 else 592 u->tmp_protocol = u->protocol;
590 tmpusr.tmp_protocol = tmpusr.protocol; 593 else if (protocols)
594 u->tmp_protocol = ((struct prpl *)protocols->data)->protocol;
595 else
596 u->tmp_protocol = -1;
597 } else {
598 if (find_prpl(tmpusr.protocol))
599 tmpusr.tmp_protocol = tmpusr.protocol;
600 else if (protocols)
601 tmpusr.tmp_protocol = ((struct prpl *)protocols->data)->protocol;
602 else
603 tmpusr.tmp_protocol = -1;
604 }
591 generate_general_options(u, book); 605 generate_general_options(u, book);
592 generate_prpl_options(u, book); 606 generate_prpl_options(u, book);
593 607
594 hbox = gtk_hbox_new(FALSE, 5); 608 hbox = gtk_hbox_new(FALSE, 5);
595 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0); 609 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 0);
613 627
614 gtk_widget_show_all(mod); 628 gtk_widget_show_all(mod);
615 629
616 if (u) { 630 if (u) {
617 p = find_prpl(u->tmp_protocol); 631 p = find_prpl(u->tmp_protocol);
618 if (p->options & OPT_PROTO_NO_PASSWORD) { 632 if (p && (p->options & OPT_PROTO_NO_PASSWORD)) {
619 gtk_widget_hide(u->pwdbox); 633 gtk_widget_hide(u->pwdbox);
620 gtk_widget_hide(u->rempass); 634 gtk_widget_hide(u->rempass);
621 } 635 }
622 if (!(p->options & OPT_PROTO_MAIL_CHECK)) 636 if (p && (!(p->options & OPT_PROTO_MAIL_CHECK)))
623 gtk_widget_hide(u->checkmail); 637 gtk_widget_hide(u->checkmail);
624 } else { 638 } else {
625 p = find_prpl(tmpusr.tmp_protocol); 639 p = find_prpl(tmpusr.tmp_protocol);
626 if (p->options & OPT_PROTO_NO_PASSWORD) { 640 if (p && (p->options & OPT_PROTO_NO_PASSWORD)) {
627 gtk_widget_hide(tmpusr.pwdbox); 641 gtk_widget_hide(tmpusr.pwdbox);
628 gtk_widget_hide(tmpusr.rempass); 642 gtk_widget_hide(tmpusr.rempass);
629 } 643 }
630 if (!(p->options & OPT_PROTO_MAIL_CHECK)) 644 if (p && (!(p->options & OPT_PROTO_MAIL_CHECK)))
631 gtk_widget_hide(tmpusr.checkmail); 645 gtk_widget_hide(tmpusr.checkmail);
632 } 646 }
633 } 647 }
634 648
635 static void add_acct(GtkWidget *w, gpointer d) 649 static void add_acct(GtkWidget *w, gpointer d)