Mercurial > pidgin
comparison src/dialogs.c @ 2564:552a56d334ec
[gaim-migrate @ 2577]
Once upon a midnight dreary, robbie coded weak and weary...
committer: Tailor Script <tailor@pidgin.im>
| author | Rob Flynn <gaim@robflynn.com> |
|---|---|
| date | Sun, 21 Oct 2001 00:15:55 +0000 |
| parents | f9bdfca15404 |
| children | 075011d08d1d |
comparison
equal
deleted
inserted
replaced
| 2563:29d09f9ce85f | 2564:552a56d334ec |
|---|---|
| 1024 { | 1024 { |
| 1025 struct aim_user *u = gtk_object_get_user_data(GTK_OBJECT(opt)); | 1025 struct aim_user *u = gtk_object_get_user_data(GTK_OBJECT(opt)); |
| 1026 b->user = u; | 1026 b->user = u; |
| 1027 } | 1027 } |
| 1028 | 1028 |
| 1029 static GtkWidget *pounce_user_menu(struct addbp *b) | 1029 static GtkWidget *pounce_user_menu(struct addbp *b, struct gaim_connection *gc) |
| 1030 { | 1030 { |
| 1031 GtkWidget *optmenu; | 1031 GtkWidget *optmenu; |
| 1032 GtkWidget *menu; | 1032 GtkWidget *menu; |
| 1033 GtkWidget *opt; | 1033 GtkWidget *opt; |
| 1034 GSList *u = aim_users; | 1034 GSList *u = aim_users; |
| 1035 struct aim_user *a; | 1035 struct aim_user *a; |
| 1036 int count = 0; | |
| 1037 int place = 0; | |
| 1036 | 1038 |
| 1037 optmenu = gtk_option_menu_new(); | 1039 optmenu = gtk_option_menu_new(); |
| 1038 | 1040 |
| 1039 menu = gtk_menu_new(); | 1041 menu = gtk_menu_new(); |
| 1040 | 1042 |
| 1049 opt = gtk_menu_item_new_with_label(a->username); | 1051 opt = gtk_menu_item_new_with_label(a->username); |
| 1050 gtk_object_set_user_data(GTK_OBJECT(opt), a); | 1052 gtk_object_set_user_data(GTK_OBJECT(opt), a); |
| 1051 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(pounce_choose), b); | 1053 gtk_signal_connect(GTK_OBJECT(opt), "activate", GTK_SIGNAL_FUNC(pounce_choose), b); |
| 1052 gtk_menu_append(GTK_MENU(menu), opt); | 1054 gtk_menu_append(GTK_MENU(menu), opt); |
| 1053 gtk_widget_show(opt); | 1055 gtk_widget_show(opt); |
| 1056 | |
| 1057 if (a->gc == gc) { | |
| 1058 gtk_menu_item_activate(GTK_MENU_ITEM(opt)); | |
| 1059 place = count; | |
| 1060 } | |
| 1061 | |
| 1062 count++; | |
| 1063 | |
| 1054 u = u->next; | 1064 u = u->next; |
| 1055 } | 1065 } |
| 1056 | 1066 |
| 1057 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); | 1067 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); |
| 1058 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), | 1068 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), place); |
| 1059 g_slist_index(aim_users, | |
| 1060 ((struct gaim_connection *)connections->data)->user)); | |
| 1061 b->user = ((struct gaim_connection *)connections->data)->user; | 1069 b->user = ((struct gaim_connection *)connections->data)->user; |
| 1062 | 1070 |
| 1063 b->menu = optmenu; | 1071 b->menu = optmenu; |
| 1064 | 1072 |
| 1065 return optmenu; | 1073 return optmenu; |
| 1066 } | 1074 } |
| 1067 | 1075 |
| 1068 | 1076 |
| 1069 void show_new_bp(char *name) | 1077 void show_new_bp(char *name, struct gaim_connection *gc, int idle, int away) |
| 1070 { | 1078 { |
| 1071 GtkWidget *label; | 1079 GtkWidget *label; |
| 1072 GtkWidget *bbox; | 1080 GtkWidget *bbox; |
| 1073 GtkWidget *vbox; | 1081 GtkWidget *vbox; |
| 1074 GtkWidget *button; | 1082 GtkWidget *button; |
| 1107 label = gtk_label_new(_("Account")); | 1115 label = gtk_label_new(_("Account")); |
| 1108 gtk_misc_set_alignment(GTK_MISC(label), 0, .5); | 1116 gtk_misc_set_alignment(GTK_MISC(label), 0, .5); |
| 1109 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | 1117 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); |
| 1110 gtk_widget_show(label); | 1118 gtk_widget_show(label); |
| 1111 | 1119 |
| 1112 optmenu = pounce_user_menu(b); | 1120 optmenu = pounce_user_menu(b, gc); |
| 1113 gtk_table_attach(GTK_TABLE(table), optmenu, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0); | 1121 gtk_table_attach(GTK_TABLE(table), optmenu, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0); |
| 1114 gtk_widget_show(optmenu); | 1122 gtk_widget_show(optmenu); |
| 1115 | 1123 |
| 1116 label = gtk_label_new(_("Buddy")); | 1124 label = gtk_label_new(_("Buddy")); |
| 1117 gtk_misc_set_alignment(GTK_MISC(label), 0, .5); | 1125 gtk_misc_set_alignment(GTK_MISC(label), 0, .5); |
| 1142 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->p_signon), TRUE); | 1150 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->p_signon), TRUE); |
| 1143 gtk_table_attach(GTK_TABLE(table), b->p_signon, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); | 1151 gtk_table_attach(GTK_TABLE(table), b->p_signon, 0, 1, 0, 1, GTK_FILL, 0, 0, 0); |
| 1144 gtk_widget_show(b->p_signon); | 1152 gtk_widget_show(b->p_signon); |
| 1145 | 1153 |
| 1146 b->p_unaway = gtk_check_button_new_with_label(_("Pounce on return from away")); | 1154 b->p_unaway = gtk_check_button_new_with_label(_("Pounce on return from away")); |
| 1155 if (away) | |
| 1156 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->p_unaway), TRUE); | |
| 1147 gtk_table_attach(GTK_TABLE(table), b->p_unaway, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0); | 1157 gtk_table_attach(GTK_TABLE(table), b->p_unaway, 1, 2, 0, 1, GTK_FILL | GTK_EXPAND, 0, 0, 0); |
| 1148 gtk_widget_show(b->p_unaway); | 1158 gtk_widget_show(b->p_unaway); |
| 1149 | 1159 |
| 1150 b->p_unidle = gtk_check_button_new_with_label(_("Pounce on return from idle")); | 1160 b->p_unidle = gtk_check_button_new_with_label(_("Pounce on return from idle")); |
| 1161 if (idle) | |
| 1162 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->p_unidle), TRUE); | |
| 1151 gtk_table_attach(GTK_TABLE(table), b->p_unidle, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); | 1163 gtk_table_attach(GTK_TABLE(table), b->p_unidle, 0, 1, 1, 2, GTK_FILL, 0, 0, 0); |
| 1152 gtk_widget_show(b->p_unidle); | 1164 gtk_widget_show(b->p_unidle); |
| 1153 | 1165 |
| 1154 label = gtk_label_new(NULL); | 1166 label = gtk_label_new(NULL); |
| 1155 gtk_table_attach(GTK_TABLE(table), label, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0); | 1167 gtk_table_attach(GTK_TABLE(table), label, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, 0, 0, 0); |
