Mercurial > pidgin
comparison src/dialogs.c @ 1137:5b5d03dfa48a
[gaim-migrate @ 1147]
Started setting up the new Buddy Pounce code.
The UI needs a little more work as it is a little cluttered right now.
The .gaimrc file is now in revision 4. It properly saves buddy pounces
between v3 and v4 and converts them.
Actual functionality will be commited soon. I remembered that I didnt commit
so I woke up to do so just incase :D
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Sun, 26 Nov 2000 10:45:49 +0000 |
parents | c8118e7ec981 |
children | ce935e673907 |
comparison
equal
deleted
inserted
replaced
1136:c8615d023aaf | 1137:5b5d03dfa48a |
---|---|
114 GtkWidget *window; | 114 GtkWidget *window; |
115 GtkWidget *nameentry; | 115 GtkWidget *nameentry; |
116 GtkWidget *messentry; | 116 GtkWidget *messentry; |
117 GtkWidget *sendim; | 117 GtkWidget *sendim; |
118 GtkWidget *openwindow; | 118 GtkWidget *openwindow; |
119 GtkWidget *p_signon; | |
120 GtkWidget *p_unaway; | |
121 GtkWidget *p_unidle; | |
122 GtkWidget *menu; | |
119 }; | 123 }; |
120 | 124 |
121 struct findbyemail { | 125 struct findbyemail { |
122 GtkWidget *window; | 126 GtkWidget *window; |
123 GtkWidget *emailentry; | 127 GtkWidget *emailentry; |
1038 | 1042 |
1039 if (GTK_TOGGLE_BUTTON(b->sendim)->active) | 1043 if (GTK_TOGGLE_BUTTON(b->sendim)->active) |
1040 bp->sendim = 1; | 1044 bp->sendim = 1; |
1041 else | 1045 else |
1042 bp->sendim = 0; | 1046 bp->sendim = 0; |
1047 | |
1048 if (GTK_TOGGLE_BUTTON(b->p_signon)->active) | |
1049 bp->signon = 1; | |
1050 else | |
1051 bp->signon = 0; | |
1052 | |
1053 if (GTK_TOGGLE_BUTTON(b->p_unaway)->active) | |
1054 bp->unaway = 1; | |
1055 else | |
1056 bp->unaway = 0; | |
1057 | |
1058 if (GTK_TOGGLE_BUTTON(b->p_unidle)->active) | |
1059 bp->unidle = 1; | |
1060 else | |
1061 bp->unidle = 0; | |
1043 | 1062 |
1044 buddy_pounces = g_list_append(buddy_pounces, bp); | 1063 buddy_pounces = g_list_append(buddy_pounces, bp); |
1045 | 1064 |
1046 do_bp_menu(); | 1065 do_bp_menu(); |
1047 | 1066 |
1048 destroy_dialog(NULL, b->window); | 1067 destroy_dialog(NULL, b->window); |
1068 | |
1049 save_prefs(); | 1069 save_prefs(); |
1050 g_free(b); | 1070 g_free(b); |
1071 } | |
1072 | |
1073 static void pounce_user_menu(struct addbp *b, GtkWidget *box) | |
1074 { | |
1075 GtkWidget *hbox; | |
1076 GtkWidget *label; | |
1077 GtkWidget *optmenu; | |
1078 GtkWidget *menu; | |
1079 GtkWidget *opt; | |
1080 GList *u = aim_users; | |
1081 struct aim_user *a; | |
1082 | |
1083 hbox = gtk_hbox_new(FALSE, 5); | |
1084 gtk_box_pack_start(GTK_BOX(box), hbox, FALSE, FALSE, 5); | |
1085 gtk_widget_show(hbox); | |
1086 | |
1087 label = gtk_label_new(_("Pounce buddy as:")); | |
1088 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
1089 gtk_widget_show(label); | |
1090 | |
1091 optmenu = gtk_option_menu_new(); | |
1092 gtk_box_pack_start(GTK_BOX(hbox), optmenu, FALSE, FALSE, 5); | |
1093 gtk_widget_show(optmenu); | |
1094 | |
1095 menu = gtk_menu_new(); | |
1096 | |
1097 while (u) { | |
1098 a = (struct aim_user *)u->data; | |
1099 opt = gtk_menu_item_new_with_label(a->username); | |
1100 gtk_object_set_user_data(GTK_OBJECT(opt), a); | |
1101 gtk_menu_append(GTK_MENU(menu), opt); | |
1102 gtk_widget_show(opt); | |
1103 u = u->next; | |
1104 } | |
1105 | |
1106 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); | |
1107 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), 0); | |
1108 | |
1109 b->menu = optmenu; | |
1051 } | 1110 } |
1052 | 1111 |
1053 | 1112 |
1054 void show_new_bp(char *name) | 1113 void show_new_bp(char *name) |
1055 { | 1114 { |
1080 button = picture_button(b->window, _("Cancel"), cancel_xpm); | 1139 button = picture_button(b->window, _("Cancel"), cancel_xpm); |
1081 gtk_signal_connect(GTK_OBJECT(button), "clicked", | 1140 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
1082 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | 1141 GTK_SIGNAL_FUNC(destroy_dialog), b->window); |
1083 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); | 1142 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); |
1084 | 1143 |
1144 /* Pounce as menu */ | |
1145 pounce_user_menu(b, vbox); | |
1146 | |
1085 /* Put the buttons in the box */ | 1147 /* Put the buttons in the box */ |
1086 label = gtk_label_new(_("Buddy To Pounce:")); | 1148 label = gtk_label_new(_("Buddy To Pounce:")); |
1087 gtk_widget_show(label); | 1149 gtk_widget_show(label); |
1088 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | 1150 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); |
1089 gtk_box_pack_start(GTK_BOX(vbox), b->nameentry, FALSE, FALSE, 0); | 1151 gtk_box_pack_start(GTK_BOX(vbox), b->nameentry, FALSE, FALSE, 0); |
1090 | 1152 |
1091 b->openwindow = gtk_check_button_new_with_label(_("Open IM Window on Buddy Logon")); | 1153 /* Set up the different options */ |
1154 b->p_signon = gtk_check_button_new_with_label(_("Sign On")); | |
1155 b->p_unaway = gtk_check_button_new_with_label(_("Return from away")); | |
1156 b->p_unidle = gtk_check_button_new_with_label(_("Return from idle")); | |
1157 | |
1158 /* Show them */ | |
1159 gtk_widget_show(b->p_signon); | |
1160 gtk_widget_show(b->p_unaway); | |
1161 gtk_widget_show(b->p_unidle); | |
1162 | |
1163 /* And pack'em */ | |
1164 gtk_box_pack_start(GTK_BOX(vbox), b->p_signon, FALSE, FALSE, 0); | |
1165 gtk_box_pack_start(GTK_BOX(vbox), b->p_unaway, FALSE, FALSE, 0); | |
1166 gtk_box_pack_start(GTK_BOX(vbox), b->p_unidle, FALSE, FALSE, 0); | |
1167 | |
1168 /* And now the other stuff */ | |
1169 b->openwindow = gtk_check_button_new_with_label(_("Open IM window on pounce")); | |
1092 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->openwindow), FALSE); | 1170 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->openwindow), FALSE); |
1093 | 1171 |
1094 b->sendim = gtk_check_button_new_with_label(_("Send IM on Buddy Logon")); | 1172 b->sendim = gtk_check_button_new_with_label(_("Send IM on pounce")); |
1095 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->sendim), TRUE); | 1173 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->sendim), TRUE); |
1096 | 1174 |
1097 gtk_widget_show(b->openwindow); | 1175 gtk_widget_show(b->openwindow); |
1098 gtk_widget_show(b->sendim); | 1176 gtk_widget_show(b->sendim); |
1099 gtk_box_pack_start(GTK_BOX(vbox), b->openwindow, FALSE, FALSE, 0); | 1177 gtk_box_pack_start(GTK_BOX(vbox), b->openwindow, FALSE, FALSE, 0); |