Mercurial > pidgin
comparison src/protocols/trepia/trepia.c @ 5847:54513d0bfb83
[gaim-migrate @ 6278]
Changed the ordering of the Trepia Profile dialog.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Fri, 13 Jun 2003 08:34:06 +0000 |
parents | b1fc288ffcb4 |
children | 8331918af110 |
comparison
equal
deleted
inserted
replaced
5846:4676b498ff4b | 5847:54513d0bfb83 |
---|---|
160 #endif | 160 #endif |
161 | 161 |
162 /************************************************************************** | 162 /************************************************************************** |
163 * Callbacks | 163 * Callbacks |
164 **************************************************************************/ | 164 **************************************************************************/ |
165 #define SET_STRING_FIELD(tag, id) \ | |
166 if ((value = gaim_request_fields_get_string(fields, (id))) != NULL) { \ | |
167 buf = g_strdup_printf("%s<%s>%s</%s>", temp, (tag), value, (tag)); \ | |
168 g_free(temp); \ | |
169 temp = buf; \ | |
170 } | |
171 | |
172 #define SET_INT_FIELD(tag, id) \ | |
173 int_val = gaim_request_fields_get_integer(fields, (id)); \ | |
174 buf = g_strdup_printf("%s<%s>%d</%s>", temp, (tag), int_val, (tag)); \ | |
175 g_free(temp); \ | |
176 temp = buf; | |
177 | |
165 static void | 178 static void |
166 save_profile_cb(GaimConnection *gc, GaimRequestFields *fields) | 179 save_profile_cb(GaimConnection *gc, GaimRequestFields *fields) |
167 { | 180 { |
181 const char *value; | |
168 char *buf, *temp; | 182 char *buf, *temp; |
183 int int_val; | |
169 | 184 |
170 buf = g_strdup("<K>"); | 185 buf = g_strdup("<K>"); |
171 temp = buf; | 186 temp = buf; |
187 | |
188 SET_STRING_FIELD("b", "email"); | |
189 SET_STRING_FIELD("c", "homepage"); | |
190 SET_STRING_FIELD("d", "firstname"); | |
191 SET_STRING_FIELD("e", "lastname"); | |
192 SET_STRING_FIELD("f", "icq"); | |
193 SET_STRING_FIELD("g", "aim"); | |
194 SET_STRING_FIELD("h", "msn"); | |
195 SET_STRING_FIELD("i", "yahoo"); | |
196 SET_INT_FIELD( "j", "age"); | |
197 | |
198 int_val = gaim_request_fields_get_choice(fields, "gender"); | |
199 | |
200 buf = g_strdup_printf("%s<k>%c</k>", temp, (int_val == 1 ? 'F' : 'M')); | |
201 g_free(temp); | |
202 temp = buf; | |
203 | |
204 SET_STRING_FIELD("l", "profile"); | |
205 SET_STRING_FIELD("n", "country"); | |
206 SET_STRING_FIELD("o", "state"); | |
207 SET_STRING_FIELD("p", "city"); | |
208 SET_STRING_FIELD("o", "state"); | |
209 | |
210 buf = g_strdup_printf("%s</K>", temp); | |
172 | 211 |
173 gaim_debug(GAIM_DEBUG_MISC, "trepia", "Setting profile: {%s}\n", | 212 gaim_debug(GAIM_DEBUG_MISC, "trepia", "Setting profile: {%s}\n", |
174 buf); | 213 buf); |
175 } | 214 } |
176 | 215 |
189 | 228 |
190 /* First Name */ | 229 /* First Name */ |
191 field = gaim_request_field_string_new("firstname", _("First Name"), NULL, | 230 field = gaim_request_field_string_new("firstname", _("First Name"), NULL, |
192 FALSE); | 231 FALSE); |
193 gaim_request_field_group_add_field(group, field); | 232 gaim_request_field_group_add_field(group, field); |
233 gaim_debug(GAIM_DEBUG_MISC, "trepia", "feld type = %d\n", | |
234 field->type); | |
194 | 235 |
195 /* Last Name */ | 236 /* Last Name */ |
196 field = gaim_request_field_string_new("lastname", _("Last Name"), NULL, | 237 field = gaim_request_field_string_new("lastname", _("Last Name"), NULL, |
197 FALSE); | 238 FALSE); |
198 gaim_request_field_group_add_field(group, field); | 239 gaim_request_field_group_add_field(group, field); |
247 | 288 |
248 /* I'm From */ | 289 /* I'm From */ |
249 group = gaim_request_field_group_new(_("I'm From")); | 290 group = gaim_request_field_group_new(_("I'm From")); |
250 gaim_request_fields_add_group(fields, group); | 291 gaim_request_fields_add_group(fields, group); |
251 | 292 |
293 /* City */ | |
294 field = gaim_request_field_string_new("city", _("City"), NULL, FALSE); | |
295 gaim_request_field_group_add_field(group, field); | |
296 | |
297 /* State */ | |
298 field = gaim_request_field_string_new("state", _("State"), NULL, FALSE); | |
299 gaim_request_field_group_add_field(group, field); | |
300 | |
252 /* Country */ | 301 /* Country */ |
253 field = gaim_request_field_string_new("country", _("Country"), NULL, FALSE); | 302 field = gaim_request_field_string_new("country", _("Country"), NULL, FALSE); |
254 gaim_request_field_group_add_field(group, field); | |
255 | |
256 /* State */ | |
257 field = gaim_request_field_string_new("state", _("State"), NULL, FALSE); | |
258 gaim_request_field_group_add_field(group, field); | |
259 | |
260 /* City */ | |
261 field = gaim_request_field_string_new("city", _("City"), NULL, FALSE); | |
262 gaim_request_field_group_add_field(group, field); | 303 gaim_request_field_group_add_field(group, field); |
263 | 304 |
264 | 305 |
265 /* Call the dialog. */ | 306 /* Call the dialog. */ |
266 gaim_request_fields(gc, NULL, _("Set your Trepia profile data."), | 307 gaim_request_fields(gc, NULL, _("Set your Trepia profile data."), |