Mercurial > pidgin
comparison src/multi.c @ 2008:6f049002d963
[gaim-migrate @ 2018]
i'm not sure i like this yet. i think we need better pixmaps or something.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 13 Jun 2001 07:26:16 +0000 |
parents | 948a67a691a6 |
children | 424a40f12a6c |
comparison
equal
deleted
inserted
replaced
2007:948a67a691a6 | 2008:6f049002d963 |
---|---|
31 #include "pixmaps/gnome_preferences.xpm" | 31 #include "pixmaps/gnome_preferences.xpm" |
32 #include "pixmaps/join.xpm" | 32 #include "pixmaps/join.xpm" |
33 #include "pixmaps/gnome_remove.xpm" | 33 #include "pixmaps/gnome_remove.xpm" |
34 #include "pixmaps/cancel.xpm" | 34 #include "pixmaps/cancel.xpm" |
35 #include "pixmaps/ok.xpm" | 35 #include "pixmaps/ok.xpm" |
36 #include "pixmaps/tb_redo.xpm" | |
37 #include "pixmaps/tb_undo.xpm" | |
38 #include "pixmaps/tb_refresh.xpm" | |
36 | 39 |
37 #define LOGIN_STEPS 5 | 40 #define LOGIN_STEPS 5 |
38 | 41 |
39 GSList *connections; | 42 GSList *connections; |
40 | 43 |
162 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(win), GTK_POLICY_AUTOMATIC, | 165 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(win), GTK_POLICY_AUTOMATIC, |
163 GTK_POLICY_ALWAYS); | 166 GTK_POLICY_ALWAYS); |
164 | 167 |
165 list = gtk_clist_new_with_titles(4, titles); | 168 list = gtk_clist_new_with_titles(4, titles); |
166 gtk_clist_set_column_width(GTK_CLIST(list), 0, 90); | 169 gtk_clist_set_column_width(GTK_CLIST(list), 0, 90); |
167 gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_BROWSE); | 170 gtk_clist_set_selection_mode(GTK_CLIST(list), GTK_SELECTION_MULTIPLE); |
168 gtk_clist_column_titles_passive(GTK_CLIST(list)); | 171 gtk_clist_column_titles_passive(GTK_CLIST(list)); |
169 gtk_container_add(GTK_CONTAINER(win), list); | 172 gtk_container_add(GTK_CONTAINER(win), list); |
170 gtk_widget_show(list); | 173 gtk_widget_show(list); |
171 | 174 |
172 while (u) { | 175 while (u) { |
498 show_acct_mod(NULL); | 501 show_acct_mod(NULL); |
499 } | 502 } |
500 | 503 |
501 static void mod_acct(GtkWidget *w, gpointer d) | 504 static void mod_acct(GtkWidget *w, gpointer d) |
502 { | 505 { |
506 GList *l = GTK_CLIST(list)->selection; | |
503 int row = -1; | 507 int row = -1; |
504 struct aim_user *u; | 508 struct aim_user *u; |
505 if (GTK_CLIST(list)->selection) | 509 while (l) { |
506 row = (int)GTK_CLIST(list)->selection->data; | 510 row = (int)l->data; |
507 if (row != -1) { | 511 if (row != -1) { |
508 u = g_list_nth_data(aim_users, row); | 512 u = g_list_nth_data(aim_users, row); |
509 if (u) | 513 if (u) |
510 show_acct_mod(u); | 514 show_acct_mod(u); |
515 } | |
516 l = l->next; | |
511 } | 517 } |
512 } | 518 } |
513 | 519 |
514 static void pass_des(GtkWidget *w, struct aim_user *u) | 520 static void pass_des(GtkWidget *w, struct aim_user *u) |
515 { | 521 { |
595 gtk_widget_show(u->passprmt); | 601 gtk_widget_show(u->passprmt); |
596 } | 602 } |
597 | 603 |
598 static void acct_signin(GtkWidget *w, gpointer d) | 604 static void acct_signin(GtkWidget *w, gpointer d) |
599 { | 605 { |
606 GList *l = GTK_CLIST(list)->selection; | |
600 int row = -1; | 607 int row = -1; |
601 struct aim_user *u; | 608 struct aim_user *u; |
602 if (GTK_CLIST(list)->selection) | 609 while (l) { |
603 row = (int)GTK_CLIST(list)->selection->data; | 610 row = (int)l->data; |
604 if (row != -1) { | |
605 u = g_list_nth_data(aim_users, row); | 611 u = g_list_nth_data(aim_users, row); |
606 if (!u->gc) { | 612 if (!u->gc) { |
607 if (!u->password[0]) { | 613 if (!u->password[0]) { |
608 do_pass_dlg(u); | 614 do_pass_dlg(u); |
609 } else { | 615 } else { |
615 } | 621 } |
616 } else { | 622 } else { |
617 u->gc->wants_to_die = TRUE; | 623 u->gc->wants_to_die = TRUE; |
618 signoff(u->gc); | 624 signoff(u->gc); |
619 } | 625 } |
626 l = l->next; | |
620 } | 627 } |
621 } | 628 } |
622 | 629 |
623 static void do_del_acct(gpointer w, struct aim_user *u) | 630 static void do_del_acct(gpointer w, struct aim_user *u) |
624 { | 631 { |
631 save_prefs(); | 638 save_prefs(); |
632 } | 639 } |
633 | 640 |
634 static void del_acct(GtkWidget *w, gpointer d) | 641 static void del_acct(GtkWidget *w, gpointer d) |
635 { | 642 { |
643 GList *l = GTK_CLIST(list)->selection; | |
636 char buf[8192]; | 644 char buf[8192]; |
637 int row = -1; | 645 int row = -1; |
638 struct aim_user *u; | 646 struct aim_user *u; |
639 if (GTK_CLIST(list)->selection) | 647 while (l) { |
640 row = (int)GTK_CLIST(list)->selection->data; | 648 row = (int)l->data; |
641 if (row == -1) | 649 u = g_list_nth_data(aim_users, row); |
642 return; | 650 if (!u) |
643 | 651 return; |
644 u = g_list_nth_data(aim_users, row); | 652 |
645 if (!u) | 653 g_snprintf(buf, sizeof(buf), _("Are you sure you want to delete %s?"), u->username); |
646 return; | 654 do_ask_dialog(buf, u, do_del_acct, NULL); |
647 | 655 l = l->next; |
648 g_snprintf(buf, sizeof(buf), _("Are you sure you want to delete %s?"), u->username); | 656 } |
649 do_ask_dialog(buf, u, do_del_acct, NULL); | 657 } |
658 | |
659 static void sel_auto(gpointer w, gpointer d) | |
660 { | |
661 GList *l = aim_users; | |
662 struct aim_user *u; | |
663 int i = 0; /* faster than doing g_list_index each time */ | |
664 while (l) { | |
665 u = l->data; | |
666 l = l->next; | |
667 if (u->options & OPT_USR_AUTO) | |
668 gtk_clist_select_row(GTK_CLIST(list), i, -1); | |
669 else | |
670 gtk_clist_unselect_row(GTK_CLIST(list), i, -1); | |
671 i++; | |
672 } | |
650 } | 673 } |
651 | 674 |
652 void account_editor(GtkWidget *w, GtkWidget *W) | 675 void account_editor(GtkWidget *w, GtkWidget *W) |
653 { | 676 { |
654 /* please kill me */ | 677 /* please kill me */ |
655 GtkWidget *vbox; | 678 GtkWidget *vbox; |
656 GtkWidget *hbox; | 679 GtkWidget *hbox; |
657 GtkWidget *list; | 680 GtkWidget *vbox2; |
681 GtkWidget *sw; | |
658 GtkWidget *button; /* used for many things */ | 682 GtkWidget *button; /* used for many things */ |
659 | 683 |
660 if (acctedit) { | 684 if (acctedit) { |
661 gtk_widget_show(acctedit); | 685 gtk_widget_show(acctedit); |
662 return; | 686 return; |
672 | 696 |
673 vbox = gtk_vbox_new(FALSE, 5); | 697 vbox = gtk_vbox_new(FALSE, 5); |
674 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); | 698 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); |
675 gtk_container_add(GTK_CONTAINER(acctedit), vbox); | 699 gtk_container_add(GTK_CONTAINER(acctedit), vbox); |
676 | 700 |
677 list = generate_list(); | 701 hbox = gtk_hbox_new(FALSE, 5); |
678 gtk_box_pack_start(GTK_BOX(vbox), list, TRUE, TRUE, 0); | 702 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); |
703 | |
704 sw = generate_list(); | |
705 | |
706 vbox2 = gtk_vbox_new(TRUE, 5); | |
707 gtk_box_pack_start(GTK_BOX(hbox), vbox2, FALSE, FALSE, 0); | |
708 | |
709 button = picture_button2(acctedit, _("Select All"), tb_refresh_xpm, 2); | |
710 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0); | |
711 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", | |
712 GTK_SIGNAL_FUNC(gtk_clist_select_all), GTK_OBJECT(list)); | |
713 | |
714 button = picture_button2(acctedit, _("Select Autos"), tb_redo_xpm, 2); | |
715 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0); | |
716 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(sel_auto), NULL); | |
717 | |
718 button = picture_button2(acctedit, _("Select None"), tb_undo_xpm, 2); | |
719 gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0); | |
720 gtk_signal_connect_object(GTK_OBJECT(button), "clicked", | |
721 GTK_SIGNAL_FUNC(gtk_clist_unselect_all), GTK_OBJECT(list)); | |
722 | |
723 gtk_box_pack_start(GTK_BOX(hbox), sw, TRUE, TRUE, 0); | |
679 | 724 |
680 hbox = gtk_hbox_new(TRUE, 5); | 725 hbox = gtk_hbox_new(TRUE, 5); |
681 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | 726 gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
682 | 727 |
683 button = picture_button(acctedit, _("Add"), gnome_add_xpm); | 728 button = picture_button(acctedit, _("Add"), gnome_add_xpm); |