Mercurial > pidgin
annotate src/dialogs.c @ 657:4bbc103a3294
[gaim-migrate @ 667]
merge buddy lists instead of overwrite them
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 10 Aug 2000 08:14:00 +0000 |
parents | ea811c6dd3e0 |
children | 71ea550c22ac |
rev | line source |
---|---|
1 | 1 /* |
2 * gaim | |
3 * | |
4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
19 * | |
20 */ | |
21 | |
349
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
23 #include "../config.h" |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
24 #endif |
1 | 25 #include <string.h> |
26 #include <stdio.h> | |
27 #include <stdlib.h> | |
28 #include <time.h> | |
29 #include <sys/types.h> | |
30 #include <sys/stat.h> | |
31 #include <fcntl.h> | |
32 #include <sys/socket.h> | |
33 #include <netdb.h> | |
34 #include <netinet/in.h> | |
35 #include <unistd.h> | |
36 #include <netinet/in.h> | |
37 #include <arpa/inet.h> | |
38 | |
39 #include <gtk/gtk.h> | |
40 #include "gaim.h" | |
41 #include "gtkhtml.h" | |
42 | |
441 | 43 #include "pixmaps/cancel.xpm" |
44 #include "pixmaps/save.xpm" | |
443 | 45 #include "pixmaps/ok.xpm" |
459 | 46 #include "pixmaps/add.xpm" |
467 | 47 #include "pixmaps/warn.xpm" |
654
ea811c6dd3e0
[gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
653
diff
changeset
|
48 #include "pixmaps/gnome_remove.xpm" |
441 | 49 |
555 | 50 #include "pixmaps/angel.xpm" |
51 #include "pixmaps/bigsmile.xpm" | |
52 #include "pixmaps/burp.xpm" | |
53 #include "pixmaps/crossedlips.xpm" | |
54 #include "pixmaps/cry.xpm" | |
55 #include "pixmaps/embarrassed.xpm" | |
56 #include "pixmaps/kiss.xpm" | |
57 #include "pixmaps/moneymouth.xpm" | |
58 #include "pixmaps/sad.xpm" | |
59 #include "pixmaps/scream.xpm" | |
60 #include "pixmaps/smile.xpm" | |
61 #include "pixmaps/smile8.xpm" | |
62 #include "pixmaps/think.xpm" | |
63 #include "pixmaps/tongue.xpm" | |
64 #include "pixmaps/wink.xpm" | |
65 #include "pixmaps/yell.xpm" | |
66 | |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
67 #define DEFAULT_FONT_NAME "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1" |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
68 |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
69 char *fontface; |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
70 char *fontname; |
555 | 71 int smiley_array[FACE_TOTAL]; |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
72 |
1 | 73 static GtkWidget *imdialog = NULL; /*I only want ONE of these :) */ |
74 static GList *dialogwindows = NULL; | |
608 | 75 static GtkWidget *exportdialog, *importdialog; |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
76 |
1 | 77 struct create_away { |
78 GtkWidget *window; | |
79 GtkWidget *entry; | |
80 GtkWidget *text; | |
81 GtkWidget *checkbx; | |
82 }; | |
83 | |
84 | |
85 struct warning { | |
86 GtkWidget *window; | |
87 GtkWidget *anon; | |
88 char *who; | |
89 }; | |
90 | |
91 struct addbuddy { | |
92 GtkWidget *window; | |
93 GtkWidget *combo; | |
94 GtkWidget *entry; | |
95 }; | |
96 | |
97 struct addperm { | |
98 GtkWidget *window; | |
99 GSList *buttons; | |
100 GtkWidget *entry; | |
101 }; | |
102 | |
103 struct addbp { | |
104 GtkWidget *window; | |
105 GtkWidget *nameentry; | |
106 GtkWidget *messentry; | |
107 GtkWidget *sendim; | |
108 GtkWidget *openwindow; | |
109 }; | |
110 | |
111 struct findbyemail { | |
112 GtkWidget *window; | |
113 GtkWidget *emailentry; | |
114 }; | |
115 | |
116 struct findbyinfo { | |
117 GtkWidget *window; | |
118 GtkWidget *firstentry; | |
119 GtkWidget *middleentry; | |
120 GtkWidget *lastentry; | |
121 GtkWidget *maidenentry; | |
122 GtkWidget *cityentry; | |
123 GtkWidget *stateentry; | |
124 GtkWidget *countryentry; | |
125 }; | |
126 | |
127 struct registerdlg { | |
128 GtkWidget *window; | |
129 GtkWidget *name; | |
130 GtkWidget *email; | |
131 GtkWidget *uname; | |
132 GtkWidget *sname; | |
133 GtkWidget *country; | |
134 }; | |
135 | |
136 struct info_dlg { | |
137 GtkWidget *window; | |
138 GtkWidget *text; | |
139 GtkWidget *close; | |
140 }; | |
141 | |
142 | |
143 struct set_info_dlg { | |
144 GtkWidget *window; | |
145 GtkWidget *text; | |
146 GtkWidget *save; | |
147 GtkWidget *cancel; | |
148 }; | |
149 | |
150 struct set_dir_dlg { | |
151 GtkWidget *window; | |
152 GtkWidget *first; | |
153 GtkWidget *middle; | |
154 GtkWidget *last; | |
155 GtkWidget *maiden; | |
156 GtkWidget *city; | |
157 GtkWidget *state; | |
158 GtkWidget *country; | |
159 GtkWidget *web; | |
160 GtkWidget *cancel; | |
161 GtkWidget *save; | |
162 }; | |
163 | |
164 struct linkdlg { | |
165 GtkWidget *ok; | |
166 GtkWidget *cancel; | |
167 GtkWidget *window; | |
168 GtkWidget *url; | |
169 GtkWidget *text; | |
170 GtkWidget *toggle; | |
171 GtkWidget *entry; | |
172 }; | |
173 | |
146 | 174 struct passwddlg { |
175 GtkWidget *window; | |
176 GtkWidget *ok; | |
177 GtkWidget *cancel; | |
178 GtkWidget *original; | |
179 GtkWidget *new1; | |
180 GtkWidget *new2; | |
181 }; | |
1 | 182 |
183 /*------------------------------------------------------------------------*/ | |
184 /* Function to Send an Email */ | |
185 /*------------------------------------------------------------------------*/ | |
186 | |
187 static int g_sendemail(char *name, char *email, int uname, int sname, char *country) | |
188 { | |
189 static char email_data[2000]; | |
190 int sock; | |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
191 struct in_addr *host; |
1 | 192 /* char data[3]; */ |
193 FILE *sockfile; | |
194 char uname_output; | |
195 FILE *tmpfile; | |
196 char filename[128]; | |
197 char buf[256]; | |
198 int i=0, tmpfd=-1; | |
199 | |
200 while (i<10000 && tmpfd < 0) { | |
201 g_snprintf(filename, 128, "/tmp/gaim_%s%d.tmp", current_user->username, i++); | |
202 | |
203 tmpfd = open(filename, O_RDWR|O_CREAT|O_EXCL, 0600); | |
204 } | |
205 | |
206 if(tmpfd < 0) { | |
207 return -1; | |
208 } | |
209 | |
210 | |
211 if (uname) | |
212 { | |
213 g_snprintf(buf, sizeof(buf), "uname -a > %s", filename); | |
214 system(buf); | |
215 } | |
216 | |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
217 host = (struct in_addr *)get_address(REG_SRVR); |
1 | 218 if (!host) |
219 { | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
220 printf(_("Error Resolving Mail Server.\n")); |
1 | 221 return -1; |
222 } | |
223 | |
253
5b28ef2b550e
[gaim-migrate @ 263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
247
diff
changeset
|
224 if ((sock = connect_address(host->s_addr, REG_PORT)) < 0) |
1 | 225 { |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
226 printf(_("Error Connecting to Socket.\n")); |
1 | 227 return -1; |
228 } | |
229 | |
230 sockfile = fdopen(sock, "r+"); | |
231 | |
232 g_snprintf(email_data, sizeof(email_data), "mail from: %s\n", REG_EMAIL_ADDR); | |
233 fputs(email_data, sockfile); | |
234 | |
235 g_snprintf(email_data, sizeof(email_data), "rcpt to: %s\n", REG_EMAIL_ADDR); | |
236 fputs(email_data, sockfile); | |
237 | |
238 g_snprintf(email_data, sizeof(email_data), "data\n"); | |
239 fputs(email_data, sockfile); | |
240 g_snprintf(email_data, sizeof(email_data), "Subject: Registration Information\n\nBelow is the submitted Registration Information\n----------------------------------\nName: %s\nEmail: %s\nCountry: %s\nSName: %s\nGAIM: v%s\nUname: ", name, email, country, sname ? current_user->username : "N/A", VERSION); | |
241 fputs(email_data, sockfile); | |
242 | |
243 if (uname) | |
244 { | |
245 tmpfile = fopen(filename, "r"); | |
246 while (!feof(tmpfile)) | |
247 { | |
248 uname_output = fgetc(tmpfile); | |
249 if (!feof(tmpfile)) | |
250 fputc(uname_output, sockfile); | |
251 } | |
252 fclose(tmpfile); | |
253 } | |
254 | |
255 unlink(filename); | |
256 | |
257 g_snprintf(email_data, sizeof(email_data), "\n.\nquit\n\n"); | |
258 fputs(email_data, sockfile); | |
259 | |
260 /* while (fgets(data, 2, sockfile)) { | |
261 } | |
262 */ | |
263 /* I don't think the above is necessary... */ | |
264 | |
265 close(sock); | |
266 | |
267 return 1; | |
268 } | |
269 | |
270 /*------------------------------------------------------------------------*/ | |
271 /* Destroys */ | |
272 /*------------------------------------------------------------------------*/ | |
273 | |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
274 static gint delete_event_dialog(GtkWidget *w, GdkEventAny *e, struct conversation *c) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
275 { |
605 | 276 gchar *object_data; |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
277 dialogwindows = g_list_remove(dialogwindows, w); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
278 gtk_widget_destroy(w); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
279 |
605 | 280 object_data = gtk_object_get_user_data(GTK_OBJECT(w)); |
281 | |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
282 if (GTK_IS_COLOR_SELECTION_DIALOG(w)) |
605 | 283 { |
284 set_state_lock(1); | |
285 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->palette), FALSE); | |
286 set_state_lock(0); | |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
287 c->color_dialog = NULL; |
605 | 288 } |
289 else if (GTK_IS_FONT_SELECTION_DIALOG(w)) | |
290 { | |
291 set_state_lock(1); | |
292 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->font), FALSE); | |
293 set_state_lock(0); | |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
294 c->font_dialog = NULL; |
605 | 295 } |
296 else if (!g_strcasecmp(object_data, "smiley dialog")) | |
297 { | |
298 set_state_lock(1); | |
299 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->smiley), FALSE); | |
300 set_state_lock(0); | |
301 c->smiley_dialog = NULL; | |
302 } | |
608 | 303 else if (!g_strcasecmp(object_data, "log dialog")) |
304 { | |
305 set_state_lock(1); | |
306 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->wood), FALSE); | |
307 set_state_lock(0); | |
308 c->log_dialog = NULL; | |
309 } | |
605 | 310 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
311 return FALSE; |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
312 } |
1 | 313 |
314 static void destroy_dialog(GtkWidget *w, GtkWidget *w2) | |
315 { | |
316 GtkWidget *dest; | |
317 | |
318 if (!GTK_IS_WIDGET(w2)) | |
319 dest = w; | |
320 else | |
321 dest = w2; | |
322 | |
323 if (dest == imdialog) | |
324 imdialog = NULL; | |
325 | |
326 if (dest == exportdialog) | |
327 exportdialog = NULL; | |
328 | |
329 if (dest == importdialog) | |
330 importdialog = NULL; | |
331 | |
332 dialogwindows = g_list_remove(dialogwindows, dest); | |
333 gtk_widget_destroy(dest); | |
334 | |
335 } | |
336 | |
337 | |
338 void destroy_all_dialogs() | |
339 { | |
340 GList *d = dialogwindows; | |
341 | |
342 while(d) { | |
343 destroy_dialog(NULL, d->data); | |
344 d = d->next; | |
345 } | |
346 | |
347 g_list_free(dialogwindows); | |
348 dialogwindows = NULL; | |
349 | |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
350 if (awaymessage) |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
351 do_im_back(NULL, NULL); |
84 | 352 |
1 | 353 if (imdialog) { |
354 destroy_dialog(NULL, imdialog); | |
355 imdialog = NULL; | |
356 } | |
357 | |
358 if (exportdialog) { | |
359 destroy_dialog(NULL, exportdialog); | |
360 exportdialog = NULL; | |
361 } | |
362 | |
363 if (importdialog) { | |
607
01a9c6998719
[gaim-migrate @ 617]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
605
diff
changeset
|
364 destroy_dialog(NULL, importdialog); |
1 | 365 importdialog = NULL; |
366 } | |
367 } | |
368 | |
369 static void do_warn(GtkWidget *widget, struct warning *w) | |
370 { | |
371 serv_warn(w->who, (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w->anon))) ? | |
372 1 : 0); | |
373 | |
374 destroy_dialog(NULL, w->window); | |
375 } | |
376 | |
377 | |
378 void show_warn_dialog(char *who) | |
379 { | |
380 GtkWidget *cancel; | |
381 GtkWidget *warn; | |
382 GtkWidget *label; | |
383 GtkWidget *vbox; | |
384 GtkWidget *bbox; | |
467 | 385 GtkWidget *frame; |
386 GtkWidget *fbox; | |
441 | 387 |
1 | 388 struct warning *w = g_new0(struct warning, 1); |
389 | |
390 char *buf = g_malloc(128); | |
391 w->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
467 | 392 gtk_window_set_policy(GTK_WINDOW(w->window), FALSE, FALSE, TRUE); |
393 gtk_widget_show(w->window); | |
394 dialogwindows = g_list_prepend(dialogwindows, w->window); | |
1 | 395 bbox = gtk_hbox_new(TRUE, 10); |
396 vbox = gtk_vbox_new(FALSE, 5); | |
467 | 397 fbox = gtk_vbox_new(FALSE, 5); |
398 | |
399 frame = gtk_frame_new(_("Warn")); | |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
400 |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
401 warn = picture_button(w->window, _("Warn"), warn_xpm); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
402 |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
403 cancel = picture_button(w->window, _("Cancel"), cancel_xpm); |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
404 |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
405 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
406 { |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
407 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
408 gtk_button_set_relief(GTK_BUTTON(warn), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
409 } |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
410 |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
411 /* Put the buttons in the box */ |
467 | 412 |
485 | 413 gtk_box_pack_start(GTK_BOX(bbox), warn, FALSE, FALSE, 5); |
414 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5); | |
1 | 415 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
416 g_snprintf(buf, 127, _("Do you really want to warn %s?"), who); |
1 | 417 label = gtk_label_new(buf); |
467 | 418 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 5); |
1 | 419 gtk_widget_show(label); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
420 w->anon = gtk_check_button_new_with_label(_("Warn anonymously?")); |
467 | 421 gtk_box_pack_start(GTK_BOX(vbox), w->anon, TRUE, TRUE, 5); |
1 | 422 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
423 label = gtk_label_new(_("Anonymous warnings are less harsh.")); |
467 | 424 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 5); |
1 | 425 gtk_widget_show(label); |
426 | |
427 w->who = who; | |
467 | 428 |
429 gtk_container_add(GTK_CONTAINER(frame), vbox); | |
430 | |
431 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5); | |
432 gtk_box_pack_start(GTK_BOX(fbox), bbox, FALSE, FALSE, 5); | |
1 | 433 |
434 /* Handle closes right */ | |
435 gtk_signal_connect(GTK_OBJECT(w->window), "delete_event", | |
436 GTK_SIGNAL_FUNC(destroy_dialog), w->window); | |
437 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", | |
438 GTK_SIGNAL_FUNC(destroy_dialog), w->window); | |
439 gtk_signal_connect(GTK_OBJECT(warn), "clicked", | |
440 GTK_SIGNAL_FUNC(do_warn), w); | |
441 /* Finish up */ | |
442 gtk_widget_show(w->anon); | |
443 gtk_widget_show(bbox); | |
444 gtk_widget_show(vbox); | |
467 | 445 gtk_widget_show(frame); |
446 gtk_widget_show(fbox); | |
447 | |
448 gtk_window_set_title(GTK_WINDOW(w->window), _("Gaim - Warn user?")); | |
449 gtk_container_add(GTK_CONTAINER(w->window), fbox); | |
450 gtk_container_set_border_width(GTK_CONTAINER(w->window), 5); | |
451 gtk_widget_realize(w->window); | |
1 | 452 aol_icon(w->window->window); |
453 | |
454 gtk_widget_show(w->window); | |
25 | 455 g_free(buf); |
1 | 456 } |
457 | |
458 | |
459 /*------------------------------------------------------------------------*/ | |
460 /* The dialog for getting an error */ | |
461 /*------------------------------------------------------------------------*/ | |
462 | |
463 void | |
464 do_error_dialog(char *message, char *title) | |
465 { | |
466 GtkWidget *d; | |
467 GtkWidget *label; | |
468 GtkWidget *close; | |
469 | |
470 | |
471 d = gtk_dialog_new(); | |
463 | 472 gtk_window_set_policy(GTK_WINDOW(d), FALSE, FALSE, TRUE); |
471
4d0b703a094c
[gaim-migrate @ 481]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
470
diff
changeset
|
473 gtk_widget_realize(d); |
1 | 474 label = gtk_label_new(message); |
475 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
476 gtk_widget_show(label); | |
477 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->vbox), | |
478 label, FALSE, FALSE, 5); | |
463 | 479 |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
480 close = picture_button(d, _("Close"), cancel_xpm); |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
481 |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
482 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
483 gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
484 |
1 | 485 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(d)->action_area), |
486 close, FALSE, FALSE, 5); | |
463 | 487 |
488 gtk_container_set_border_width(GTK_CONTAINER(d), 5); | |
1 | 489 gtk_window_set_title(GTK_WINDOW(d), title); |
490 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), d); | |
491 aol_icon(d->window); | |
492 | |
493 gtk_widget_show(d); | |
494 } | |
495 | |
496 | |
497 | |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
498 void show_error_dialog(char *d) |
1 | 499 { |
500 | |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
501 int no = atoi(d); |
423
0d4e80bdb96b
[gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
502 char *w; |
1 | 503 char buf[256]; |
504 char buf2[32]; | |
423
0d4e80bdb96b
[gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
505 |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
506 #ifdef GAIM_PLUGINS |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
507 GList *c = callbacks; |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
508 struct gaim_callback *g; |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
509 void (*function)(int, void *); |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
510 while (c) { |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
511 g = (struct gaim_callback *)c->data; |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
512 if (g->event == event_error && g->function != NULL) { |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
513 function = g->function; |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
514 (*function)(no, g->data); |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
515 } |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
516 c = c->next; |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
517 } |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
518 #endif |
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
350
diff
changeset
|
519 |
423
0d4e80bdb96b
[gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
520 if (USE_OSCAR) |
0d4e80bdb96b
[gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
521 w = d + 4; |
0d4e80bdb96b
[gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
522 else |
0d4e80bdb96b
[gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
523 w = strtok(NULL, ":"); |
0d4e80bdb96b
[gaim-migrate @ 433]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
524 |
1 | 525 |
526 switch(no) { | |
527 case 69: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
528 g_snprintf(buf, sizeof(buf), _("Unable to write file %s."), w); |
1 | 529 break; |
530 case 169: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
531 g_snprintf(buf, sizeof(buf), _("Unable to read file %s."), w); |
1 | 532 break; |
533 case 269: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
534 g_snprintf(buf, sizeof(buf), _("Message too long, last %s bytes truncated."), w); |
1 | 535 break; |
536 case 901: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
537 g_snprintf(buf, sizeof(buf), _("%s not currently logged in."), w); |
1 | 538 break; |
539 case 902: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
540 g_snprintf(buf, sizeof(buf), _("Warning of %s not allowed."), w); |
1 | 541 break; |
542 case 903: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
543 g_snprintf(buf, sizeof(buf), _("A message has been dropped, you are exceeding the server speed limit.")); |
1 | 544 break; |
545 case 950: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
546 g_snprintf(buf, sizeof(buf), _("Chat in %s is not available."), w); |
1 | 547 break; |
548 case 960: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
549 g_snprintf(buf, sizeof(buf), _("You are sending messages too fast to %s."), w); |
1 | 550 break; |
551 case 961: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
552 g_snprintf(buf, sizeof(buf), _("You missed an IM from %s because it was too big."), w); |
1 | 553 break; |
554 case 962: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
555 g_snprintf(buf, sizeof(buf), _("You missed an IM from %s because it was sent too fast."), w); |
1 | 556 break; |
557 case 970: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
558 g_snprintf(buf, sizeof(buf), _("Failure.")); |
1 | 559 break; |
560 case 971: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
561 g_snprintf(buf, sizeof(buf), _("Too many matches.")); |
1 | 562 break; |
563 case 972: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
564 g_snprintf(buf, sizeof(buf), _("Need more qualifiers.")); |
1 | 565 break; |
566 case 973: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
567 g_snprintf(buf, sizeof(buf), _("Dir service temporarily unavailable.")); |
1 | 568 break; |
569 case 974: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
570 g_snprintf(buf, sizeof(buf), _("Email lookup restricted.")); |
1 | 571 break; |
572 case 975: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
573 g_snprintf(buf, sizeof(buf), _("Keyword ignored.")); |
1 | 574 break; |
575 case 976: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
576 g_snprintf(buf, sizeof(buf), _("No keywords.")); |
1 | 577 break; |
578 case 977: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
579 g_snprintf(buf, sizeof(buf), _("User has no directory information.")); |
1 | 580 /* g_snprintf(buf, sizeof(buf), "Language not supported."); */ |
581 break; | |
582 case 978: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
583 g_snprintf(buf, sizeof(buf), _("Country not supported.")); |
1 | 584 break; |
585 case 979: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
586 g_snprintf(buf, sizeof(buf), _("Failure unknown: %s."), w); |
1 | 587 break; |
588 case 980: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
589 g_snprintf(buf, sizeof(buf), _("Incorrect nickname or password.")); |
1 | 590 break; |
591 case 981: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
592 g_snprintf(buf, sizeof(buf), _("The service is temporarily unavailable.")); |
1 | 593 break; |
594 case 982: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
595 g_snprintf(buf, sizeof(buf), _("Your warning level is currently too high to log in.")); |
1 | 596 break; |
597 case 983: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
598 g_snprintf(buf, sizeof(buf), _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer.")); |
1 | 599 break; |
600 case 989: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
601 g_snprintf(buf, sizeof(buf), _("An unknown signon error has occurred: %s."), w); |
1 | 602 break; |
603 default: | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
604 g_snprintf(buf, sizeof(buf), _("An unknown error, %d, has occured. Info: %s"), no, w); |
1 | 605 } |
606 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
607 g_snprintf(buf2, sizeof(buf2), _("Gaim - Error %d"), no); |
1 | 608 |
609 | |
610 do_error_dialog(buf, buf2); | |
611 return; | |
612 } | |
613 | |
614 static void do_im(GtkWidget *widget, GtkWidget *imentry) | |
615 { | |
616 char *who; | |
617 struct conversation *c; | |
467 | 618 |
1 | 619 who = g_strdup(normalize(gtk_entry_get_text(GTK_ENTRY(imentry)))); |
620 destroy_dialog(NULL, imdialog); | |
621 imdialog = NULL; | |
622 | |
623 if (!strcasecmp(who, "")) { | |
624 g_free(who); | |
625 return; | |
626 } | |
627 | |
628 c = find_conversation(who); | |
629 | |
630 if (c == NULL) { | |
631 c = new_conversation(who); | |
632 } else { | |
633 gdk_window_raise(c->window->window); | |
634 } | |
635 g_free(who); | |
636 } | |
637 | |
638 void show_ee_dialog(int ee) | |
639 { | |
640 GtkWidget *ok; | |
641 GtkWidget *label; | |
642 GtkWidget *box; | |
643 GtkWidget *eedialog; | |
644 | |
645 eedialog = gtk_window_new(GTK_WINDOW_DIALOG); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
646 ok = gtk_button_new_with_label(_("OK")); |
1 | 647 box = gtk_vbox_new(FALSE, 10); |
648 | |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
649 |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
650 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
651 gtk_button_set_relief(GTK_BUTTON(ok), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
652 |
1 | 653 if (ee == 0) |
654 label = gtk_label_new("Amazing! Simply Amazing!"); | |
655 else if (ee == 1) | |
656 label = gtk_label_new("Pimpin\' Penguin Style! *Waddle Waddle*"); | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
657 else if (ee == 2) |
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
658 label = gtk_label_new("You should be me. I'm so cute!"); |
1 | 659 else |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
660 label = gtk_label_new("Now that's what I like!"); |
1 | 661 |
662 gtk_widget_show(label); | |
663 gtk_widget_show(ok); | |
664 | |
665 gtk_box_pack_start(GTK_BOX(box), label, TRUE, TRUE, 10); | |
666 gtk_box_pack_start(GTK_BOX(box), ok, FALSE, FALSE, 10); | |
667 | |
668 gtk_widget_show(box); | |
669 | |
670 gtk_container_add(GTK_CONTAINER(eedialog), box); | |
671 gtk_window_set_title(GTK_WINDOW(eedialog), "Gaim - SUPRISE!"); | |
672 | |
673 gtk_signal_connect(GTK_OBJECT(ok), "clicked", | |
674 GTK_SIGNAL_FUNC(destroy_dialog), eedialog); | |
675 gtk_widget_realize(eedialog); | |
676 aol_icon(eedialog->window); | |
677 | |
678 gtk_widget_show(eedialog); | |
679 } | |
680 | |
681 void show_im_dialog(GtkWidget *w, GtkWidget *w2) | |
682 { | |
455 | 683 GtkWidget *button; |
1 | 684 GtkWidget *imentry; |
685 GtkWidget *vbox; | |
686 GtkWidget *ebox; | |
687 GtkWidget *bbox; | |
688 GtkWidget *label; | |
455 | 689 GtkWidget *frame; |
690 GtkWidget *fbox; | |
1 | 691 |
692 if (!imdialog) { | |
693 | |
694 imdialog = gtk_window_new(GTK_WINDOW_DIALOG); | |
455 | 695 gtk_widget_set_usize(imdialog, 255, 105); |
696 gtk_container_border_width(GTK_CONTAINER(imdialog), 5); | |
458 | 697 gtk_window_set_policy(GTK_WINDOW(imdialog), FALSE, FALSE, TRUE); |
455 | 698 gtk_widget_show(imdialog); |
699 | |
700 bbox = gtk_hbox_new(TRUE, 10); | |
1 | 701 vbox = gtk_vbox_new(FALSE, 5); |
702 ebox = gtk_hbox_new(FALSE, 2); | |
455 | 703 fbox = gtk_vbox_new(TRUE, 10); |
704 | |
705 frame = gtk_frame_new(_("Send Instant Message")); | |
467 | 706 |
707 imentry = gtk_entry_new(); | |
455 | 708 |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
709 button = picture_button(imdialog, _("OK"), ok_xpm); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
710 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
711 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
712 GTK_SIGNAL_FUNC(do_im), imentry); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
713 |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
714 button = picture_button(imdialog, _("Cancel"), cancel_xpm); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
715 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
716 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
717 GTK_SIGNAL_FUNC(destroy_dialog), imdialog); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
718 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
719 label = gtk_label_new(_("IM who: ")); |
1 | 720 gtk_box_pack_start(GTK_BOX(ebox), label, TRUE, TRUE, 10); |
721 gtk_widget_show(label); | |
722 | |
723 gtk_box_pack_start(GTK_BOX(ebox), imentry, TRUE, TRUE, 10); | |
724 | |
725 gtk_box_pack_start(GTK_BOX(vbox), ebox, FALSE, FALSE, 5); | |
726 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); | |
727 | |
728 /* Handle closes right */ | |
729 gtk_signal_connect(GTK_OBJECT(imentry), "activate", | |
730 GTK_SIGNAL_FUNC(do_im), imentry); | |
731 gtk_signal_connect(GTK_OBJECT(imdialog), "destroy", | |
732 GTK_SIGNAL_FUNC(destroy_dialog), imdialog); | |
455 | 733 |
734 /* Finish up */ | |
1 | 735 gtk_widget_show(ebox); |
736 gtk_widget_show(imentry); | |
737 gtk_widget_show(bbox); | |
738 gtk_widget_show(vbox); | |
455 | 739 gtk_widget_show(fbox); |
740 gtk_widget_show(frame); | |
741 gtk_container_add(GTK_CONTAINER(frame), vbox); | |
742 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5); | |
743 gtk_window_set_title(GTK_WINDOW(imdialog), _("Gaim - IM user")); | |
744 gtk_container_add(GTK_CONTAINER(imdialog), fbox); | |
1 | 745 gtk_widget_grab_focus(imentry); |
746 gtk_widget_realize(imdialog); | |
455 | 747 |
748 aol_icon(imdialog->window); | |
1 | 749 |
750 } | |
751 gtk_widget_show(imdialog); | |
752 } | |
753 | |
754 | |
755 /*------------------------------------------------------------------------*/ | |
756 /* The dialog for adding buddies */ | |
757 /*------------------------------------------------------------------------*/ | |
758 | |
654
ea811c6dd3e0
[gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
653
diff
changeset
|
759 extern void add_callback(GtkWidget *, struct conversation *); |
ea811c6dd3e0
[gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
653
diff
changeset
|
760 |
1 | 761 void do_add_buddy(GtkWidget *w, struct addbuddy *a) |
762 { | |
763 char *grp, *who; | |
764 struct conversation *c; | |
765 | |
766 who = gtk_entry_get_text(GTK_ENTRY(a->entry)); | |
767 grp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry)); | |
768 | |
769 c = find_conversation(who); | |
770 | |
771 add_buddy(grp, who); | |
772 | |
654
ea811c6dd3e0
[gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
653
diff
changeset
|
773 if (c != NULL) { |
ea811c6dd3e0
[gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
653
diff
changeset
|
774 GtkWidget *parent = c->add_button->parent; |
ea811c6dd3e0
[gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
653
diff
changeset
|
775 gtk_widget_destroy(c->add_button); |
ea811c6dd3e0
[gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
653
diff
changeset
|
776 c->add_button = picture_button2(c->window, NULL, gnome_remove_xpm); |
ea811c6dd3e0
[gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
653
diff
changeset
|
777 gtk_signal_connect(GTK_OBJECT(c->add_button), "clicked", GTK_SIGNAL_FUNC(add_callback), c); |
ea811c6dd3e0
[gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
653
diff
changeset
|
778 gtk_box_pack_end(GTK_BOX(parent), c->add_button, FALSE, FALSE, 0); |
ea811c6dd3e0
[gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
653
diff
changeset
|
779 gtk_box_reorder_child(GTK_BOX(parent), c->add_button, 1); |
ea811c6dd3e0
[gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
653
diff
changeset
|
780 gtk_widget_show(c->add_button); |
ea811c6dd3e0
[gaim-migrate @ 664]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
653
diff
changeset
|
781 } |
1 | 782 |
783 build_edit_tree(); | |
784 | |
785 serv_save_config(); | |
786 | |
787 serv_add_buddy(who); | |
788 | |
228 | 789 do_export( (GtkWidget *) NULL, 0 ); |
790 | |
1 | 791 update_num_groups(); |
792 | |
793 destroy_dialog(NULL, a->window); | |
794 } | |
795 | |
577
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
796 void do_add_group(GtkWidget *w, struct addbuddy *a) |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
797 { |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
798 char *grp; |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
799 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
800 grp = gtk_entry_get_text(GTK_ENTRY(a->entry)); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
801 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
802 add_group(grp); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
803 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
804 build_edit_tree(); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
805 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
806 serv_save_config(); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
807 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
808 do_export( (GtkWidget *) NULL, 0 ); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
809 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
810 update_num_groups(); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
811 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
812 destroy_dialog(NULL, a->window); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
813 } |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
814 |
1 | 815 |
816 static GList *groups_tree() | |
817 { | |
818 GList *tmp=NULL; | |
819 char *tmp2; | |
820 struct group *g; | |
821 GList *grp = groups; | |
822 | |
823 if (!grp) { | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
824 tmp2 = g_strdup(_("Buddies")); |
1 | 825 tmp = g_list_append(tmp, tmp2); |
826 } else { | |
827 while(grp) { | |
828 g = (struct group *)grp->data; | |
829 tmp2 = g->name; | |
830 tmp=g_list_append(tmp, tmp2); | |
831 grp = grp->next; | |
832 } | |
833 } | |
834 return tmp; | |
835 } | |
836 | |
837 | |
577
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
838 void show_add_group() |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
839 { |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
840 GtkWidget *cancel; |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
841 GtkWidget *add; |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
842 GtkWidget *label; |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
843 GtkWidget *bbox; |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
844 GtkWidget *vbox; |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
845 GtkWidget *topbox; |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
846 GtkWidget *frame; |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
847 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
848 struct addbuddy *a = g_new0(struct addbuddy, 1); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
849 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
850 a->window = gtk_window_new(GTK_WINDOW_DIALOG); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
851 gtk_window_set_policy(GTK_WINDOW(a->window), FALSE, FALSE, TRUE); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
852 gtk_widget_show(a->window); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
853 dialogwindows = g_list_prepend(dialogwindows, a->window); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
854 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
855 bbox = gtk_hbox_new(TRUE, 10); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
856 topbox = gtk_hbox_new(FALSE, 5); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
857 vbox = gtk_vbox_new(FALSE, 5); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
858 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
859 a->entry = gtk_entry_new(); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
860 /* Put the buttons in the box */ |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
861 |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
862 add = picture_button(a->window, _("Add"), add_xpm); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
863 |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
864 cancel = picture_button(a->window, _("Cancel"), cancel_xpm); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
865 |
577
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
866 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
867 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
868 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
869 frame = gtk_frame_new(NULL); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
870 gtk_frame_set_label(GTK_FRAME(frame), _("Add Group")); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
871 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
872 label = gtk_label_new(_("Group")); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
873 gtk_widget_show(label); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
874 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
875 gtk_box_pack_start(GTK_BOX(topbox), a->entry, FALSE, FALSE, 5); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
876 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
877 /* And the boxes in the box */ |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
878 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
879 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
880 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
881 /* Handle closes right */ |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
882 gtk_signal_connect(GTK_OBJECT(a->window), "destroy", |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
883 GTK_SIGNAL_FUNC(destroy_dialog), a->window); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
884 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
885 GTK_SIGNAL_FUNC(destroy_dialog), a->window); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
886 gtk_signal_connect(GTK_OBJECT(add), "clicked", |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
887 GTK_SIGNAL_FUNC(do_add_group), a); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
888 gtk_signal_connect(GTK_OBJECT(a->entry), "activate", |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
889 GTK_SIGNAL_FUNC(do_add_group), a); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
890 /* Finish up */ |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
891 gtk_widget_show(add); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
892 gtk_widget_show(cancel); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
893 gtk_widget_show(a->entry); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
894 gtk_widget_show(topbox); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
895 gtk_widget_show(bbox); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
896 gtk_widget_show(vbox); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
897 gtk_widget_show(frame); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
898 gtk_window_set_title(GTK_WINDOW(a->window), _("Gaim - Add Buddy")); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
899 gtk_window_set_focus(GTK_WINDOW(a->window), a->entry); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
900 gtk_container_add(GTK_CONTAINER(frame), vbox); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
901 gtk_container_add(GTK_CONTAINER(a->window), frame); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
902 gtk_container_set_border_width(GTK_CONTAINER(a->window), 5); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
903 gtk_widget_realize(a->window); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
904 aol_icon(a->window->window); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
905 |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
906 gtk_widget_show(a->window); |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
907 } |
aa9a8bcddd80
[gaim-migrate @ 587]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
908 |
1 | 909 void show_add_buddy(char *buddy, char *group) |
910 { | |
911 GtkWidget *cancel; | |
912 GtkWidget *add; | |
913 GtkWidget *label; | |
914 GtkWidget *bbox; | |
915 GtkWidget *vbox; | |
916 GtkWidget *topbox; | |
236 | 917 GtkWidget *frame; |
918 | |
1 | 919 struct addbuddy *a = g_new0(struct addbuddy, 1); |
920 | |
921 a->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
459 | 922 gtk_widget_set_usize(a->window, 480, 105); |
923 gtk_window_set_policy(GTK_WINDOW(a->window), FALSE, FALSE, TRUE); | |
924 gtk_widget_show(a->window); | |
925 dialogwindows = g_list_prepend(dialogwindows, a->window); | |
926 | |
927 bbox = gtk_hbox_new(TRUE, 10); | |
1 | 928 topbox = gtk_hbox_new(FALSE, 5); |
929 vbox = gtk_vbox_new(FALSE, 5); | |
244 | 930 |
1 | 931 a->entry = gtk_entry_new(); |
932 a->combo = gtk_combo_new(); | |
933 /* Fix the combo box */ | |
934 gtk_combo_set_popdown_strings(GTK_COMBO(a->combo), groups_tree()); | |
935 /* Put the buttons in the box */ | |
236 | 936 |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
937 add = picture_button(a->window, _("Add"), add_xpm); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
938 cancel = picture_button(a->window, _("Cancel"), cancel_xpm); |
459 | 939 |
940 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5); | |
941 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5); | |
1 | 942 |
236 | 943 frame = gtk_frame_new(NULL); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
944 gtk_frame_set_label(GTK_FRAME(frame), _("Add Buddy")); |
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
945 |
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
946 label = gtk_label_new(_("Buddy")); |
1 | 947 gtk_widget_show(label); |
948 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); | |
949 gtk_box_pack_start(GTK_BOX(topbox), a->entry, FALSE, FALSE, 5); | |
950 if (buddy != NULL) | |
951 gtk_entry_set_text(GTK_ENTRY(a->entry), buddy); | |
952 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
953 label = gtk_label_new(_("Group")); |
1 | 954 gtk_widget_show(label); |
955 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); | |
956 gtk_box_pack_start(GTK_BOX(topbox), a->combo, FALSE, FALSE, 5); | |
957 | |
958 if (group != NULL) | |
959 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry), group); | |
960 | |
961 /* And the boxes in the box */ | |
962 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5); | |
459 | 963 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5); |
1 | 964 |
965 /* Handle closes right */ | |
966 gtk_signal_connect(GTK_OBJECT(a->window), "destroy", | |
967 GTK_SIGNAL_FUNC(destroy_dialog), a->window); | |
968 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", | |
969 GTK_SIGNAL_FUNC(destroy_dialog), a->window); | |
970 gtk_signal_connect(GTK_OBJECT(add), "clicked", | |
971 GTK_SIGNAL_FUNC(do_add_buddy), a); | |
972 gtk_signal_connect(GTK_OBJECT(a->entry), "activate", | |
973 GTK_SIGNAL_FUNC(do_add_buddy), a); | |
974 /* Finish up */ | |
975 gtk_widget_show(add); | |
976 gtk_widget_show(cancel); | |
977 gtk_widget_show(a->combo); | |
978 gtk_widget_show(a->entry); | |
979 gtk_widget_show(topbox); | |
980 gtk_widget_show(bbox); | |
981 gtk_widget_show(vbox); | |
236 | 982 gtk_widget_show(frame); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
983 gtk_window_set_title(GTK_WINDOW(a->window), _("Gaim - Add Buddy")); |
1 | 984 gtk_window_set_focus(GTK_WINDOW(a->window), a->entry); |
245 | 985 gtk_container_add(GTK_CONTAINER(frame), vbox); |
236 | 986 gtk_container_add(GTK_CONTAINER(a->window), frame); |
987 gtk_container_set_border_width(GTK_CONTAINER(a->window), 5); | |
1 | 988 gtk_widget_realize(a->window); |
989 aol_icon(a->window->window); | |
990 | |
991 gtk_widget_show(a->window); | |
992 } | |
993 | |
994 | |
995 /*------------------------------------------------------------------------*/ | |
996 /* The dialog for new buddy pounces */ | |
997 /*------------------------------------------------------------------------*/ | |
998 | |
999 | |
1000 void do_new_bp(GtkWidget *w, struct addbp *b) | |
1001 { | |
1002 struct buddy_pounce *bp = g_new0(struct buddy_pounce, 1); | |
1003 | |
26 | 1004 g_snprintf(bp->name, 80, "%s", gtk_entry_get_text(GTK_ENTRY(b->nameentry))); |
1005 g_snprintf(bp->message, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->messentry))); | |
1006 | |
1 | 1007 if (GTK_TOGGLE_BUTTON(b->openwindow)->active) |
1008 bp->popup = 1; | |
1009 else | |
1010 bp->popup = 0; | |
1011 | |
1012 if (GTK_TOGGLE_BUTTON(b->sendim)->active) | |
1013 bp->sendim = 1; | |
1014 else | |
1015 bp->sendim = 0; | |
26 | 1016 |
1 | 1017 buddy_pounces = g_list_append(buddy_pounces, bp); |
1018 | |
1019 do_bp_menu(); | |
1020 | |
1021 destroy_dialog(NULL, b->window); | |
1022 g_free(b); | |
1023 } | |
1024 | |
1025 | |
1026 void show_new_bp(char *name) | |
1027 { | |
1028 GtkWidget *label; | |
1029 GtkWidget *bbox; | |
1030 GtkWidget *vbox; | |
443 | 1031 GtkWidget *button; |
1 | 1032 |
1033 struct addbp *b = g_new0(struct addbp, 1); | |
1034 | |
1035 b->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
458 | 1036 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, FALSE, TRUE); |
443 | 1037 gtk_widget_show(b->window); |
1 | 1038 dialogwindows = g_list_prepend(dialogwindows, b->window); |
1039 bbox = gtk_hbox_new(TRUE, 10); | |
1040 vbox = gtk_vbox_new(FALSE, 5); | |
1041 b->nameentry = gtk_entry_new(); | |
1042 b->messentry = gtk_entry_new(); | |
443 | 1043 |
1044 /* Build OK Button */ | |
1045 | |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1046 button = picture_button(b->window, _("OK"), ok_xpm); |
443 | 1047 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
1048 GTK_SIGNAL_FUNC(do_new_bp), b); | |
1049 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); | |
1050 | |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1051 button = picture_button(b->window, _("Cancel"), cancel_xpm); |
443 | 1052 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
1053 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
1054 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); | |
1055 | |
1 | 1056 /* Put the buttons in the box */ |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1057 label = gtk_label_new(_("Buddy To Pounce:")); |
1 | 1058 gtk_widget_show(label); |
1059 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
1060 gtk_box_pack_start(GTK_BOX(vbox), b->nameentry, FALSE, FALSE, 0); | |
1061 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1062 b->openwindow = gtk_check_button_new_with_label(_("Open IM Window on Buddy Logon")); |
1 | 1063 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->openwindow), FALSE); |
1064 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1065 b->sendim = gtk_check_button_new_with_label(_("Send IM on Buddy Logon")); |
1 | 1066 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->sendim), TRUE); |
1067 | |
1068 gtk_widget_show(b->openwindow); | |
1069 gtk_widget_show(b->sendim); | |
1070 gtk_box_pack_start(GTK_BOX(vbox), b->openwindow, FALSE, FALSE, 0); | |
1071 gtk_box_pack_start(GTK_BOX(vbox), b->sendim, FALSE, FALSE, 0); | |
1072 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1073 label = gtk_label_new(_("Message to send:")); |
1 | 1074 gtk_widget_show(label); |
1075 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
1076 gtk_box_pack_start(GTK_BOX(vbox), b->messentry, FALSE, FALSE, 0); | |
1077 | |
1078 | |
1079 /* And the boxes in the box */ | |
1080 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); | |
1081 | |
1082 /* Handle closes right */ | |
1083 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", | |
1084 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
1085 gtk_signal_connect(GTK_OBJECT(b->messentry), "activate", | |
1086 GTK_SIGNAL_FUNC(do_new_bp), b); | |
1087 | |
1088 | |
1089 /* Finish up */ | |
1090 gtk_widget_show(b->nameentry); | |
1091 gtk_widget_show(b->messentry); | |
1092 gtk_widget_show(bbox); | |
1093 gtk_widget_show(vbox); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1094 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - New Buddy Pounce")); |
1 | 1095 if (name != NULL) { |
1096 gtk_entry_set_text(GTK_ENTRY(b->nameentry), name); | |
1097 gtk_window_set_focus(GTK_WINDOW(b->window), b->messentry); | |
1098 } else | |
1099 gtk_window_set_focus(GTK_WINDOW(b->window), b->nameentry); | |
1100 gtk_container_add(GTK_CONTAINER(b->window), vbox); | |
1101 gtk_container_border_width(GTK_CONTAINER(b->window), 10); | |
1102 gtk_widget_realize(b->window); | |
1103 aol_icon(b->window->window); | |
1104 } | |
1105 | |
1106 | |
1107 | |
1108 /*------------------------------------------------------------------------*/ | |
1109 /* The dialog for SET INFO / SET DIR INFO */ | |
1110 /*------------------------------------------------------------------------*/ | |
1111 | |
1112 void do_save_info(GtkWidget *widget, struct set_info_dlg *b) | |
1113 { | |
1114 gchar *junk; | |
1115 char *buf; | |
1116 | |
1117 junk = gtk_editable_get_chars(GTK_EDITABLE(b->text), 0, -1); | |
1118 | |
1119 g_snprintf(current_user->user_info, sizeof(current_user->user_info), "%s", junk); | |
25 | 1120 |
1 | 1121 save_prefs(); |
1122 | |
79 | 1123 buf = g_malloc(strlen(current_user->user_info) * 4); |
122
521db4bf5f28
[gaim-migrate @ 132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
84
diff
changeset
|
1124 if (!buf) { |
521db4bf5f28
[gaim-migrate @ 132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
84
diff
changeset
|
1125 buf = g_malloc(1); |
521db4bf5f28
[gaim-migrate @ 132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
84
diff
changeset
|
1126 buf[0] = 0; |
521db4bf5f28
[gaim-migrate @ 132]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
84
diff
changeset
|
1127 } |
1 | 1128 g_snprintf(buf, strlen(current_user->user_info) * 2, "%s", current_user->user_info); |
1129 escape_text(buf); | |
1130 serv_set_info(buf); | |
1131 g_free(buf); | |
25 | 1132 g_free(junk); |
1 | 1133 destroy_dialog(NULL, b->window); |
1134 g_free(b); | |
1135 } | |
1136 | |
1137 void do_set_dir(GtkWidget *widget, struct set_dir_dlg *b) | |
1138 { | |
1139 char *first = gtk_entry_get_text(GTK_ENTRY(b->first)); | |
1140 int web = GTK_TOGGLE_BUTTON(b->web)->active; | |
1141 char *middle = gtk_entry_get_text(GTK_ENTRY(b->middle)); | |
1142 char *last = gtk_entry_get_text(GTK_ENTRY(b->last)); | |
1143 char *maiden = gtk_entry_get_text(GTK_ENTRY(b->maiden)); | |
1144 char *city = gtk_entry_get_text(GTK_ENTRY(b->city)); | |
1145 char *state = gtk_entry_get_text(GTK_ENTRY(b->state)); | |
1146 char *country = gtk_entry_get_text(GTK_ENTRY(b->country)); | |
1147 | |
1148 | |
1149 serv_set_dir(first, middle, last, maiden, city, state, country, web); | |
1150 | |
1151 destroy_dialog(NULL, b->window); | |
1152 g_free(b); | |
1153 } | |
1154 | |
1155 void show_set_dir() | |
1156 { | |
1157 GtkWidget *label; | |
1158 GtkWidget *bot; | |
484 | 1159 GtkWidget *vbox; |
1160 GtkWidget *hbox; | |
1161 GtkWidget *frame; | |
1162 GtkWidget *fbox; | |
1 | 1163 |
1164 struct set_dir_dlg *b = g_new0(struct set_dir_dlg, 1); | |
1165 | |
1166 b->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
484 | 1167 gtk_widget_set_usize(b->window, 300, 320); |
1168 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, FALSE, TRUE); | |
1169 gtk_widget_show(b->window); | |
1170 | |
1 | 1171 dialogwindows = g_list_prepend(dialogwindows, b->window); |
484 | 1172 |
1173 vbox = gtk_vbox_new(FALSE, 5); | |
1174 fbox = gtk_vbox_new(FALSE, 5); | |
1175 | |
1176 frame = gtk_frame_new(_("Directory Info")); | |
1177 | |
1178 /* Build Save Button */ | |
1179 | |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1180 b->save = picture_button(b->window, _("Save"), save_xpm); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1181 |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1182 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm); |
484 | 1183 |
1 | 1184 bot = gtk_hbox_new(TRUE, 10); |
484 | 1185 |
1 | 1186 gtk_box_pack_start(GTK_BOX(bot), b->save, FALSE, FALSE, 5); |
1187 gtk_box_pack_start(GTK_BOX(bot), b->cancel, FALSE, FALSE, 5); | |
1188 | |
1189 gtk_widget_show(bot); | |
1190 | |
1191 b->first = gtk_entry_new(); | |
1192 b->middle = gtk_entry_new(); | |
1193 b->last = gtk_entry_new(); | |
1194 b->maiden = gtk_entry_new(); | |
1195 b->city = gtk_entry_new(); | |
1196 b->state = gtk_entry_new(); | |
1197 b->country = gtk_entry_new(); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1198 b->web = gtk_check_button_new_with_label(_("Allow Web Searches To Find Your Info")); |
484 | 1199 |
1200 /* Line 1 */ | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1201 label = gtk_label_new(_("First Name")); |
1 | 1202 gtk_widget_show(label); |
1203 | |
484 | 1204 hbox = gtk_hbox_new(FALSE, 5); |
1205 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); | |
1206 gtk_box_pack_end(GTK_BOX(hbox), b->first, FALSE, FALSE, 2); | |
1207 | |
1208 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); | |
1209 gtk_widget_show(hbox); | |
1210 | |
1211 /* Line 2 */ | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1212 label = gtk_label_new(_("Middle Name")); |
1 | 1213 gtk_widget_show(label); |
484 | 1214 |
1215 hbox = gtk_hbox_new(FALSE, 5); | |
1216 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); | |
1217 gtk_box_pack_end(GTK_BOX(hbox), b->middle, FALSE, FALSE, 2); | |
1218 | |
1219 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); | |
1220 gtk_widget_show(hbox); | |
1221 | |
1222 | |
1223 /* Line 3 */ | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1224 label = gtk_label_new(_("Last Name")); |
1 | 1225 gtk_widget_show(label); |
484 | 1226 |
1227 hbox = gtk_hbox_new(FALSE, 5); | |
1228 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); | |
1229 gtk_box_pack_end(GTK_BOX(hbox), b->last, FALSE, FALSE, 2); | |
1230 | |
1231 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); | |
1232 gtk_widget_show(hbox); | |
1233 | |
1234 /* Line 4 */ | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1235 label = gtk_label_new(_("Maiden Name")); |
1 | 1236 gtk_widget_show(label); |
484 | 1237 |
1238 hbox = gtk_hbox_new(FALSE, 5); | |
1239 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); | |
1240 gtk_box_pack_end(GTK_BOX(hbox), b->maiden, FALSE, FALSE, 2); | |
1241 | |
1242 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); | |
1243 gtk_widget_show(hbox); | |
1244 | |
1245 /* Line 5 */ | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1246 label = gtk_label_new(_("City")); |
1 | 1247 gtk_widget_show(label); |
484 | 1248 |
1249 hbox = gtk_hbox_new(FALSE, 5); | |
1250 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); | |
1251 gtk_box_pack_end(GTK_BOX(hbox), b->city, FALSE, FALSE, 2); | |
1252 | |
1253 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); | |
1254 gtk_widget_show(hbox); | |
1255 | |
1256 /* Line 6 */ | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1257 label = gtk_label_new(_("State")); |
1 | 1258 gtk_widget_show(label); |
484 | 1259 |
1260 hbox = gtk_hbox_new(FALSE, 5); | |
1261 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); | |
1262 gtk_box_pack_end(GTK_BOX(hbox), b->state, FALSE, FALSE, 2); | |
1263 | |
1264 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); | |
1265 gtk_widget_show(hbox); | |
1266 | |
1267 /* Line 7 */ | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1268 label = gtk_label_new(_("Country")); |
1 | 1269 gtk_widget_show(label); |
484 | 1270 |
1271 hbox = gtk_hbox_new(FALSE, 5); | |
1272 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); | |
1273 gtk_box_pack_end(GTK_BOX(hbox), b->country, FALSE, FALSE, 2); | |
1274 | |
1275 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); | |
1276 gtk_widget_show(hbox); | |
1277 | |
1278 /* Line 8 */ | |
1279 | |
1280 hbox = gtk_hbox_new(FALSE, 5); | |
1281 gtk_box_pack_start(GTK_BOX(hbox), b->web, TRUE, TRUE, 2); | |
1282 gtk_widget_show(hbox); | |
1283 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2); | |
1284 | |
1285 /* And add the buttons */ | |
1286 gtk_container_add(GTK_CONTAINER(frame), vbox); | |
1287 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 2); | |
1288 gtk_box_pack_start(GTK_BOX(fbox), bot, FALSE, FALSE, 2); | |
1289 | |
1290 | |
1291 gtk_widget_show(vbox); | |
1292 gtk_widget_show(fbox); | |
1293 | |
1294 gtk_widget_show(frame); | |
1 | 1295 gtk_widget_show(b->first); |
1296 gtk_widget_show(b->middle); | |
1297 gtk_widget_show(b->last); | |
1298 gtk_widget_show(b->maiden); | |
1299 gtk_widget_show(b->city); | |
1300 gtk_widget_show(b->state); | |
1301 gtk_widget_show(b->country); | |
1302 gtk_widget_show(b->web); | |
1303 | |
1304 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", | |
1305 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
1306 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", | |
1307 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
1308 gtk_signal_connect(GTK_OBJECT(b->save), "clicked", GTK_SIGNAL_FUNC(do_set_dir), b); | |
1309 | |
484 | 1310 gtk_container_add(GTK_CONTAINER(b->window), fbox); |
1311 gtk_container_border_width(GTK_CONTAINER(b->window), 5); | |
1312 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1313 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set Dir Info")); |
1 | 1314 gtk_window_set_focus(GTK_WINDOW(b->window), b->first); |
1315 gtk_widget_realize(b->window); | |
1316 aol_icon(b->window->window); | |
1317 | |
1318 gtk_widget_show(b->window); | |
1319 } | |
1320 | |
149 | 1321 void do_change_password(GtkWidget *widget, struct passwddlg *b) |
1322 { | |
1323 gchar *orig, *new1, *new2; | |
1324 | |
1325 orig = gtk_entry_get_text(GTK_ENTRY(b->original)); | |
1326 new1 = gtk_entry_get_text(GTK_ENTRY(b->new1)); | |
1327 new2 = gtk_entry_get_text(GTK_ENTRY(b->new2)); | |
1328 | |
1329 if (strcasecmp(new1, new2)) { | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1330 do_error_dialog(_("New Passwords Do Not Match"), _("Gaim - Change Password Error")); |
149 | 1331 return ; |
1332 } | |
1333 | |
1334 if ((strlen(orig) < 1) || (strlen(new1) < 1) || (strlen(new2) < 1)) { | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1335 do_error_dialog(_("Fill out all fields completely"), _("Gaim - Change Password Error")); |
149 | 1336 return; |
1337 } | |
1338 | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
236
diff
changeset
|
1339 serv_change_passwd(orig, new1); |
149 | 1340 |
1341 destroy_dialog(NULL, b->window); | |
1342 g_free(b); | |
1343 } | |
1344 | |
146 | 1345 void show_change_passwd() |
1346 { | |
1347 GtkWidget *hbox; | |
1348 GtkWidget *label; | |
1349 GtkWidget *vbox; | |
475 | 1350 GtkWidget *fbox; |
1351 GtkWidget *frame; | |
454 | 1352 |
146 | 1353 struct passwddlg *b = g_new0(struct passwddlg, 1); |
1354 | |
1355 b->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
476 | 1356 gtk_widget_set_usize(b->window, 325, 195); |
475 | 1357 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, FALSE, TRUE); |
1358 gtk_widget_show(b->window); | |
1359 | |
146 | 1360 dialogwindows = g_list_prepend(dialogwindows, b->window); |
149 | 1361 |
475 | 1362 frame = gtk_frame_new(_("Change Password")); |
1363 fbox = gtk_vbox_new(FALSE, 5); | |
1364 | |
1365 /* Build OK Button */ | |
1366 | |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1367 b->ok = picture_button(b->window, _("OK"), ok_xpm); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1368 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm); |
149 | 1369 |
475 | 1370 /* Create our vbox */ |
1371 vbox = gtk_vbox_new(FALSE, 5); | |
1372 | |
149 | 1373 |
475 | 1374 /* First Line */ |
1375 hbox = gtk_hbox_new(FALSE, 5); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1376 label = gtk_label_new(_("Original Password")); |
146 | 1377 gtk_widget_show(label); |
475 | 1378 |
146 | 1379 b->original = gtk_entry_new(); |
160
aaa8f0a2140e
[gaim-migrate @ 170]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
149
diff
changeset
|
1380 gtk_entry_set_visibility(GTK_ENTRY(b->original), FALSE); |
149 | 1381 gtk_widget_show(b->original); |
475 | 1382 |
1383 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
1384 gtk_box_pack_end(GTK_BOX(hbox), b->original, FALSE, FALSE, 5); | |
1385 | |
1386 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
1387 | |
1388 gtk_widget_show(hbox); | |
1389 | |
1390 /* Next Line */ | |
1391 hbox = gtk_hbox_new(FALSE, 5); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1392 label = gtk_label_new(_("New Password")); |
149 | 1393 gtk_widget_show(label); |
1394 b->new1 = gtk_entry_new(); | |
160
aaa8f0a2140e
[gaim-migrate @ 170]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
149
diff
changeset
|
1395 gtk_entry_set_visibility(GTK_ENTRY(b->new1), FALSE); |
149 | 1396 gtk_widget_show(b->new1); |
475 | 1397 |
1398 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
1399 gtk_box_pack_end(GTK_BOX(hbox), b->new1, FALSE, FALSE, 5); | |
1400 | |
1401 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
1402 gtk_widget_show(hbox); | |
1403 | |
1404 /* Next Line */ | |
1405 hbox = gtk_hbox_new(FALSE, 5); | |
1406 label = gtk_label_new(_("New Password (again)")); | |
149 | 1407 gtk_widget_show(label); |
1408 b->new2 = gtk_entry_new(); | |
160
aaa8f0a2140e
[gaim-migrate @ 170]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
149
diff
changeset
|
1409 gtk_entry_set_visibility(GTK_ENTRY(b->new2), FALSE); |
149 | 1410 gtk_widget_show(b->new2); |
475 | 1411 |
1412 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
1413 gtk_box_pack_end(GTK_BOX(hbox), b->new2, FALSE, FALSE, 5); | |
1414 | |
1415 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
1416 | |
1417 gtk_widget_show(hbox); | |
149 | 1418 |
475 | 1419 /* Now do our row of buttons */ |
149 | 1420 hbox = gtk_hbox_new(TRUE, TRUE); |
1421 gtk_box_pack_start(GTK_BOX(hbox), b->ok, FALSE, FALSE, 5); | |
1422 gtk_box_pack_start(GTK_BOX(hbox), b->cancel, FALSE, FALSE, 5); | |
475 | 1423 |
146 | 1424 gtk_widget_show(hbox); |
475 | 1425 |
1426 /* Pack our entries into a frame */ | |
1427 gtk_container_add(GTK_CONTAINER(frame), vbox); | |
1428 | |
1429 /* Add our frame to our frame box */ | |
1430 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5); | |
1431 | |
1432 /* And add our row of buttons */ | |
1433 gtk_box_pack_start(GTK_BOX(fbox), hbox, FALSE, FALSE, 5); | |
1434 | |
1435 | |
146 | 1436 gtk_widget_show(vbox); |
475 | 1437 gtk_widget_show(frame); |
1438 gtk_widget_show(fbox); | |
1439 | |
1440 gtk_container_add(GTK_CONTAINER(b->window), fbox); | |
1441 | |
1442 gtk_container_border_width(GTK_CONTAINER(b->window), 5); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1443 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Password Change")); |
149 | 1444 |
1445 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", | |
1446 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
1447 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", | |
1448 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
1449 gtk_signal_connect(GTK_OBJECT(b->ok), "clicked", | |
1450 GTK_SIGNAL_FUNC(do_change_password), b); | |
1451 | |
1452 | |
146 | 1453 } |
1454 | |
1 | 1455 void show_set_info() |
1456 { | |
1457 GtkWidget *bot; | |
1458 GtkWidget *top; | |
454 | 1459 |
1 | 1460 struct set_info_dlg *b = g_new0(struct set_info_dlg, 1); |
1461 | |
1462 b->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
1463 dialogwindows = g_list_prepend(dialogwindows, b->window); | |
454 | 1464 gtk_widget_show(b->window); |
1 | 1465 |
1466 bot = gtk_hbox_new(TRUE, 10); | |
1467 top = gtk_vbox_new(FALSE, 10); | |
1468 | |
454 | 1469 /* Build OK Button */ |
1470 | |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1471 b->save = picture_button(b->window, _("Save"), save_xpm); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1472 b->cancel = picture_button(b->window, _("Cancel"), cancel_xpm); |
1 | 1473 |
1474 gtk_box_pack_start(GTK_BOX(bot), b->save, FALSE, FALSE, 10); | |
1475 gtk_box_pack_start(GTK_BOX(bot), b->cancel, FALSE, FALSE, 10); | |
1476 | |
1477 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", | |
1478 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
1479 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", | |
1480 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
1481 gtk_signal_connect(GTK_OBJECT(b->save), "clicked", | |
1482 GTK_SIGNAL_FUNC(do_save_info), b); | |
1483 | |
1484 gtk_widget_show(bot); | |
1485 | |
1486 | |
1487 b->text = gtk_text_new(NULL, NULL); | |
1488 gtk_text_set_word_wrap(GTK_TEXT(b->text), TRUE); | |
1489 gtk_text_set_editable(GTK_TEXT(b->text), TRUE); | |
1490 gtk_widget_set_usize(b->text, 350, 100); | |
1491 gtk_text_insert(GTK_TEXT(b->text), NULL, NULL, NULL, current_user->user_info, -1); | |
1492 | |
1493 gtk_widget_show(b->text); | |
1494 | |
1495 gtk_box_pack_start(GTK_BOX(top), b->text, TRUE, TRUE, 10); | |
1496 gtk_widget_show(top); | |
1497 | |
1498 gtk_box_pack_start(GTK_BOX(top), bot, FALSE, FALSE, 10); | |
454 | 1499 |
1 | 1500 gtk_container_add(GTK_CONTAINER(b->window), top); |
1501 gtk_container_border_width(GTK_CONTAINER(b->window), 10); | |
1502 gtk_widget_realize(b->window); | |
1503 aol_icon(b->window->window); | |
454 | 1504 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1505 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set User Info")); |
1 | 1506 gtk_widget_show(b->window); |
1507 | |
1508 } | |
1509 | |
1510 /*------------------------------------------------------------------------*/ | |
1511 /* The dialog for registration information */ | |
1512 /*------------------------------------------------------------------------*/ | |
1513 | |
1514 void do_register_dialog(GtkWidget *widget, struct registerdlg *b) | |
1515 { | |
1516 char *email = gtk_entry_get_text(GTK_ENTRY(b->email)); | |
1517 char *name = gtk_entry_get_text(GTK_ENTRY(b->name)); | |
1518 int uname = GTK_TOGGLE_BUTTON(b->uname)->active; | |
1519 int sname = GTK_TOGGLE_BUTTON(b->sname)->active; | |
1520 char *country = gtk_entry_get_text(GTK_ENTRY(b->country)); | |
1521 | |
1522 general_options |= OPT_GEN_REGISTERED; | |
1523 save_prefs(); | |
1524 | |
1525 destroy_dialog(NULL, b->window); | |
1526 | |
1527 g_free(b); | |
1528 | |
1529 g_sendemail(name, email, uname, sname, country); | |
1530 } | |
1531 | |
1532 void set_reg_flag(GtkWidget *widget, struct registerdlg *b) | |
1533 { | |
1534 general_options |= OPT_GEN_REGISTERED; | |
1535 save_prefs(); | |
1536 destroy_dialog(NULL, b->window); | |
1537 g_free(b); | |
1538 } | |
1539 | |
1540 void show_register_dialog() | |
1541 { | |
1542 GtkWidget *ok; | |
1543 GtkWidget *cancel; | |
1544 GtkWidget *label; | |
1545 GtkWidget *table; | |
1546 GtkWidget *vbox; | |
1547 GtkWidget *bbox; | |
1548 | |
1549 struct registerdlg *b = g_new0(struct registerdlg, 1); | |
1550 b->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
1551 dialogwindows = g_list_prepend(dialogwindows, b->window); | |
1552 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1553 cancel = gtk_button_new_with_label(_("Cancel")); |
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1554 ok = gtk_button_new_with_label(_("Send")); |
1 | 1555 |
1556 bbox = gtk_hbox_new(TRUE, 10); | |
1557 table = gtk_table_new(6, 2, TRUE); | |
1558 vbox = gtk_vbox_new(FALSE, 5); | |
1559 | |
1560 b->name = gtk_entry_new(); | |
1561 b->email = gtk_entry_new(); | |
1562 b->uname = gtk_check_button_new_with_label("Send the output of uname -a with registration"); | |
1563 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->uname), TRUE); | |
1564 b->sname = gtk_check_button_new_with_label("Send my screenname with registration"); | |
1565 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(b->sname), TRUE); | |
1566 gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 10); | |
1567 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 10); | |
1568 | |
1569 label = gtk_label_new("This list will not, in any way, be distributed and\nwill be used for internal census purposes only.\nAll fields are completely optional."); | |
1570 gtk_widget_show(label); | |
1571 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 2, 0, 1); | |
1572 | |
1573 label = gtk_label_new("Name"); | |
1574 gtk_widget_show(label); | |
1575 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); | |
1576 gtk_table_attach_defaults(GTK_TABLE(table), b->name, 1, 2, 1, 2); | |
1577 | |
1578 label = gtk_label_new("Email"); | |
1579 gtk_widget_show(label); | |
1580 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3); | |
1581 gtk_table_attach_defaults(GTK_TABLE(table), b->email, 1, 2, 2, 3); | |
1582 | |
1583 label = gtk_label_new("Country"); | |
1584 b->country = gtk_entry_new(); | |
1585 gtk_widget_show(label); | |
1586 gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 3, 4); | |
1587 gtk_table_attach_defaults(GTK_TABLE(table), b->country, 1, 2, 3, 4); | |
1588 | |
1589 gtk_table_attach_defaults(GTK_TABLE(table), b->sname, 0, 2, 4, 5); | |
1590 gtk_table_attach_defaults(GTK_TABLE(table), b->uname, 0, 2, 5, 6); | |
1591 | |
1592 gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 5); | |
1593 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); | |
1594 | |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
1595 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
1596 { |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
1597 gtk_button_set_relief(GTK_BUTTON(ok), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
1598 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
1599 } |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
1600 |
1 | 1601 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", |
1602 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
1603 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", | |
1604 GTK_SIGNAL_FUNC(set_reg_flag), b); | |
1605 gtk_signal_connect(GTK_OBJECT(ok), "clicked", | |
1606 GTK_SIGNAL_FUNC(do_register_dialog), b); | |
1607 | |
1608 gtk_widget_show(ok); | |
1609 gtk_widget_show(cancel); | |
1610 gtk_widget_show(b->name); | |
1611 gtk_widget_show(b->email); | |
1612 gtk_widget_show(b->uname); | |
1613 gtk_widget_show(b->sname); | |
1614 gtk_widget_show(b->country); | |
1615 gtk_widget_show(table); | |
1616 gtk_widget_show(bbox); | |
1617 gtk_widget_show(vbox); | |
1618 gtk_window_set_title(GTK_WINDOW(b->window), "Gaim - Registration"); | |
1619 gtk_window_set_focus(GTK_WINDOW(b->window), b->name); | |
1620 gtk_container_add(GTK_CONTAINER(b->window), vbox); | |
1621 gtk_container_border_width(GTK_CONTAINER(b->window), 10); | |
1622 gtk_widget_realize(b->window); | |
1623 aol_icon(b->window->window); | |
1624 | |
1625 gtk_widget_show(b->window); | |
1626 } | |
1627 | |
1628 | |
1629 /*------------------------------------------------------------------------*/ | |
1630 /* The dialog for the info requests */ | |
1631 /*------------------------------------------------------------------------*/ | |
1632 | |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
245
diff
changeset
|
1633 void g_show_info_text(char *info) |
1 | 1634 { |
1635 GtkWidget *ok; | |
1636 GtkWidget *label; | |
1637 GtkWidget *text; | |
1638 GtkWidget *bbox; | |
619 | 1639 GtkWidget *button_box; |
1 | 1640 GtkWidget *sw; |
1641 | |
1642 struct info_dlg *b = g_new0(struct info_dlg, 1); | |
1643 | |
1644 b->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
1645 dialogwindows = g_list_prepend(dialogwindows, b->window); | |
1646 gtk_container_border_width(GTK_CONTAINER(b->window), 5); | |
1647 bbox = gtk_vbox_new(FALSE, 5); | |
1648 gtk_container_add(GTK_CONTAINER(b->window), bbox); | |
619 | 1649 button_box = gtk_hbox_new(FALSE, 5); |
1650 gtk_widget_realize(GTK_WIDGET(b->window)); | |
1651 ok = picture_button(b->window, _("OK"), ok_xpm); | |
1 | 1652 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", |
1653 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
1654 gtk_signal_connect(GTK_OBJECT(ok), "clicked", | |
1655 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
1656 | |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
1657 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
1658 gtk_button_set_relief(GTK_BUTTON(ok), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
1659 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1660 label = gtk_label_new(_("Below are the results of your search: ")); |
1 | 1661 |
1662 sw = gtk_scrolled_window_new (NULL, NULL); | |
1663 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), | |
1664 GTK_POLICY_NEVER, | |
1665 GTK_POLICY_ALWAYS); | |
1666 text = gtk_html_new(NULL, NULL); | |
1667 b->text = text; | |
1668 gtk_container_add(GTK_CONTAINER(sw), text); | |
1669 | |
1670 GTK_HTML (text)->hadj->step_increment = 10.0; | |
1671 GTK_HTML (text)->vadj->step_increment = 10.0; | |
1672 gtk_widget_set_usize(sw, 300, 250); | |
1673 | |
1674 gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0); | |
1675 gtk_box_pack_start(GTK_BOX(bbox), sw, TRUE, TRUE, 0); | |
651 | 1676 gtk_box_pack_start(GTK_BOX(bbox), ok, FALSE, FALSE, 0); |
619 | 1677 /* gtk_box_pack_start(GTK_BOX(button_box), ok, FALSE, FALSE, 0);*/ |
1678 | |
1 | 1679 aol_icon(b->window->window); |
1680 gtk_widget_show_all(b->window); | |
1681 | |
602
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
595
diff
changeset
|
1682 if (display_options & OPT_DISP_SHOW_SMILEY) |
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
595
diff
changeset
|
1683 write_html_with_smileys(b->window, b->text, info); |
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
595
diff
changeset
|
1684 else |
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
595
diff
changeset
|
1685 gtk_html_append_text(GTK_HTML(b->text), info, 0); |
653
c8a3bf382108
[gaim-migrate @ 663]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
652
diff
changeset
|
1686 gtk_html_append_text(GTK_HTML(b->text), "</BODY>", 0); |
337 | 1687 |
550
6bd2bbc1b6c8
[gaim-migrate @ 560]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
1688 gtk_adjustment_set_value(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(sw)), 0); |
247
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
245
diff
changeset
|
1689 } |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
245
diff
changeset
|
1690 |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
245
diff
changeset
|
1691 void g_show_info(char *url) { |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
245
diff
changeset
|
1692 char *url_text = grab_url(url); |
f6e8ea29b24f
[gaim-migrate @ 257]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
245
diff
changeset
|
1693 g_show_info_text(url_text); |
1 | 1694 g_free(url_text); |
1695 } | |
1696 | |
1697 /*------------------------------------------------------------------------*/ | |
1698 /* The dialog for adding to permit/deny */ | |
1699 /*------------------------------------------------------------------------*/ | |
1700 | |
1701 | |
1702 static void do_add_perm(GtkWidget *w, struct addperm *p) | |
1703 { | |
1704 | |
1705 char *who; | |
1706 char *name; | |
1707 int d = 0; | |
1708 GSList *buttons = p->buttons; | |
1709 | |
1710 | |
1711 who = gtk_entry_get_text(GTK_ENTRY(p->entry)); | |
1712 | |
1713 name = g_malloc(strlen(who) + 2); | |
1714 g_snprintf(name, strlen(who) + 2, "%s", who); | |
1715 | |
1716 while(buttons) { | |
1717 if((int)gtk_object_get_user_data(GTK_OBJECT(buttons->data)) == 1) { | |
1718 if (GTK_TOGGLE_BUTTON(buttons->data)->active) | |
1719 d = 1; | |
1720 } | |
1721 buttons = buttons->next; | |
1722 } | |
1723 | |
1724 if (d) { | |
657
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1725 GList *d = deny; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1726 while (d) { |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1727 char *n = g_strdup(normalize(name)); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1728 if (!strcmp(n, normalize(d->data))) |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1729 break; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1730 d = d->next; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1731 g_free(n); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1732 } |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1733 if (!d) { |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1734 deny = g_list_append(deny, name); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1735 serv_add_deny(name); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1736 } |
1 | 1737 } else { |
657
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1738 GList *d = permit; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1739 while (d) { |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1740 char *n = g_strdup(normalize(name)); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1741 if (!strcmp(n, normalize(d->data))) |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1742 break; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1743 d = d->next; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1744 g_free(n); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1745 } |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1746 if (!d) { |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1747 permit = g_list_append(permit, name); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1748 serv_add_permit(name); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
1749 } |
1 | 1750 } |
1751 | |
1752 | |
1753 | |
1754 build_permit_tree(); | |
1755 | |
1756 serv_save_config(); | |
300
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
296
diff
changeset
|
1757 do_export(0, 0); |
1 | 1758 |
1759 destroy_dialog(NULL, p->window); | |
1760 } | |
1761 | |
1762 | |
1763 | |
1764 void show_add_perm(char *who) | |
1765 { | |
1766 GtkWidget *cancel; | |
1767 GtkWidget *add; | |
1768 GtkWidget *label; | |
1769 GtkWidget *bbox; | |
1770 GtkWidget *vbox; | |
1771 GtkWidget *rbox; | |
1772 GtkWidget *topbox; | |
1773 GtkWidget *which; | |
487 | 1774 GtkWidget *frame; |
1775 | |
486 | 1776 struct addperm *p = g_new0(struct addperm, 1); |
1 | 1777 |
1778 p->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
487 | 1779 gtk_container_set_border_width(GTK_CONTAINER(p->window), 5); |
1780 gtk_widget_set_usize(p->window, 310, 130); | |
1781 gtk_window_set_policy(GTK_WINDOW(p->window), FALSE, FALSE, TRUE); | |
486 | 1782 gtk_widget_show(p->window); |
487 | 1783 |
486 | 1784 dialogwindows = g_list_prepend(dialogwindows, p->window); |
1785 | |
1786 bbox = gtk_hbox_new(TRUE, 10); | |
1 | 1787 topbox = gtk_hbox_new(FALSE, 5); |
1788 vbox = gtk_vbox_new(FALSE, 5); | |
1789 rbox = gtk_vbox_new(FALSE, 5); | |
1790 p->entry = gtk_entry_new(); | |
1791 | |
487 | 1792 frame = gtk_frame_new(_("Permit / Deny")); |
1793 | |
486 | 1794 /* Build Add Button */ |
1795 | |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1796 add = picture_button(p->window, _("Add"), add_xpm); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1797 cancel = picture_button(p->window, _("Cancel"), cancel_xpm); |
486 | 1798 |
1799 /* End of Cancel Button */ | |
1 | 1800 if (who != NULL) |
1801 gtk_entry_set_text(GTK_ENTRY(p->entry), who); | |
1802 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1803 which = gtk_radio_button_new_with_label(NULL, _("Deny")); |
1 | 1804 gtk_box_pack_start(GTK_BOX(rbox), which, FALSE, FALSE, 0); |
1805 gtk_object_set_user_data(GTK_OBJECT(which), (int *)1); | |
1806 gtk_widget_show(which); | |
1807 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1808 which = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(which)), _("Permit")); |
1 | 1809 gtk_box_pack_start(GTK_BOX(rbox), which, FALSE, FALSE, 0); |
1810 gtk_object_set_user_data(GTK_OBJECT(which), (int *)2); | |
1811 gtk_widget_show(which); | |
1812 | |
1813 /* Put the buttons in the box */ | |
486 | 1814 |
1815 gtk_box_pack_start(GTK_BOX(bbox), add, FALSE, FALSE, 5); | |
1816 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5); | |
1 | 1817 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1818 label = gtk_label_new(_("Add")); |
1 | 1819 gtk_widget_show(label); |
1820 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); | |
1821 gtk_box_pack_start(GTK_BOX(topbox), p->entry, FALSE, FALSE, 5); | |
1822 gtk_box_pack_start(GTK_BOX(topbox), rbox, FALSE, FALSE, 5); | |
1823 /* And the boxes in the box */ | |
1824 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5); | |
1825 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); | |
487 | 1826 gtk_container_add(GTK_CONTAINER(frame), vbox); |
1 | 1827 |
1828 | |
1829 p->buttons = gtk_radio_button_group(GTK_RADIO_BUTTON(which)); | |
1830 /* Handle closes right */ | |
1831 gtk_signal_connect(GTK_OBJECT(p->window), "destroy", | |
1832 GTK_SIGNAL_FUNC(destroy_dialog), p->window); | |
1833 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", | |
1834 GTK_SIGNAL_FUNC(destroy_dialog), p->window); | |
1835 gtk_signal_connect(GTK_OBJECT(add), "clicked", | |
1836 GTK_SIGNAL_FUNC(do_add_perm), p); | |
1837 gtk_signal_connect(GTK_OBJECT(p->entry), "activate", | |
1838 GTK_SIGNAL_FUNC(do_add_perm), p); | |
1839 | |
1840 /* Finish up */ | |
1841 gtk_widget_show(add); | |
1842 gtk_widget_show(cancel); | |
1843 gtk_widget_show(p->entry); | |
1844 gtk_widget_show(topbox); | |
1845 gtk_widget_show(bbox); | |
1846 gtk_widget_show(vbox); | |
1847 gtk_widget_show(rbox); | |
487 | 1848 gtk_widget_show(frame); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1849 gtk_window_set_title(GTK_WINDOW(p->window), _("Gaim - Add Permit/Deny")); |
1 | 1850 gtk_window_set_focus(GTK_WINDOW(p->window), p->entry); |
487 | 1851 gtk_container_add(GTK_CONTAINER(p->window), frame); |
1 | 1852 gtk_widget_realize(p->window); |
1853 aol_icon(p->window->window); | |
1854 | |
1855 gtk_widget_show(p->window); | |
1856 } | |
1857 | |
1858 | |
1859 /*------------------------------------------------------------------------*/ | |
608 | 1860 /* Functions Called To Add A Log */ |
1 | 1861 /*------------------------------------------------------------------------*/ |
1862 | |
608 | 1863 void cancel_log(GtkWidget *widget, struct conversation *c) |
1864 { | |
1865 if (c->wood) | |
1866 { | |
1867 set_state_lock(1); | |
1868 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->wood), FALSE); | |
1869 set_state_lock(0); | |
1870 } | |
1871 dialogwindows = g_list_remove(dialogwindows, c->log_dialog); | |
1872 gtk_widget_destroy(c->log_dialog); | |
1873 c->log_dialog = NULL; | |
1874 } | |
1875 | |
1876 void do_log(GtkWidget *w, struct conversation *c) | |
1 | 1877 { |
1878 struct log_conversation *l; | |
1879 char buf[128]; | |
1880 | |
608 | 1881 if (!find_log_info(c->name)) { |
1 | 1882 l = (struct log_conversation *)g_new0(struct log_conversation, 1); |
608 | 1883 strcpy(l->name, c->name); |
1884 strcpy(l->filename, gtk_file_selection_get_filename(GTK_FILE_SELECTION(c->log_dialog))); | |
1 | 1885 log_conversations = g_list_append(log_conversations, l); |
1886 | |
1887 if (c != NULL) | |
1888 { | |
1889 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, c->name); | |
1890 gtk_window_set_title(GTK_WINDOW(c->window), buf); | |
1891 } | |
1892 } | |
1893 | |
1894 save_prefs(); | |
608 | 1895 cancel_log(NULL, c); |
1 | 1896 } |
1897 | |
608 | 1898 void show_log_dialog(struct conversation *c) |
1 | 1899 { |
1900 char *buf = g_malloc(BUF_LEN); | |
1901 | |
608 | 1902 if (!c->log_dialog) { |
1903 c->log_dialog = gtk_file_selection_new(_("Gaim - Log Conversation")); | |
1904 | |
1905 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(c->log_dialog)); | |
1 | 1906 |
608 | 1907 g_snprintf(buf, BUF_LEN - 1, "%s/%s.log", getenv("HOME"), c->name); |
1908 gtk_object_set_user_data(GTK_OBJECT(c->log_dialog), "log dialog"); | |
1909 gtk_file_selection_set_filename(GTK_FILE_SELECTION(c->log_dialog), buf); | |
1910 gtk_signal_connect(GTK_OBJECT(c->log_dialog), "delete_event", GTK_SIGNAL_FUNC(delete_event_dialog), c); | |
1911 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(c->log_dialog)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_log), c); | |
1912 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(c->log_dialog)->cancel_button), "clicked", GTK_SIGNAL_FUNC(cancel_log), c); | |
1 | 1913 } |
1914 | |
25 | 1915 g_free(buf); |
1916 | |
608 | 1917 gtk_widget_show(c->log_dialog); |
1918 gdk_window_raise(c->log_dialog->window); | |
1 | 1919 } |
1920 | |
1921 /*------------------------------------------------------*/ | |
1922 /* Find Buddy By Email */ | |
1923 /*------------------------------------------------------*/ | |
1924 | |
1925 void do_find_info(GtkWidget *w, struct findbyinfo *b) | |
1926 { | |
1927 char *first; | |
1928 char *middle; | |
1929 char *last; | |
1930 char *maiden; | |
1931 char *city; | |
1932 char *state; | |
1933 char *country; | |
1934 | |
1935 first = gtk_entry_get_text(GTK_ENTRY(b->firstentry)); | |
1936 middle = gtk_entry_get_text(GTK_ENTRY(b->middleentry)); | |
1937 last = gtk_entry_get_text(GTK_ENTRY(b->lastentry)); | |
1938 maiden = gtk_entry_get_text(GTK_ENTRY(b->maidenentry)); | |
1939 city = gtk_entry_get_text(GTK_ENTRY(b->cityentry)); | |
1940 state = gtk_entry_get_text(GTK_ENTRY(b->stateentry)); | |
1941 country = gtk_entry_get_text(GTK_ENTRY(b->countryentry)); | |
1942 | |
1943 serv_dir_search(first, middle, last, maiden, city, state, country, ""); | |
1944 destroy_dialog(NULL, b->window); | |
1945 } | |
1946 | |
1947 void do_find_email(GtkWidget *w, struct findbyemail *b) | |
1948 { | |
1949 char *email; | |
1950 | |
1951 email = gtk_entry_get_text(GTK_ENTRY(b->emailentry)); | |
1952 | |
1953 serv_dir_search("","","","","","","", email); | |
1954 | |
1955 destroy_dialog(NULL, b->window); | |
1956 } | |
1957 | |
1958 void show_find_info() | |
1959 { | |
1960 GtkWidget *cancel; | |
1961 GtkWidget *ok; | |
1962 GtkWidget *label; | |
1963 GtkWidget *bbox; | |
1964 GtkWidget *vbox; | |
479 | 1965 GtkWidget *hbox; |
1966 GtkWidget *fbox; | |
1967 GtkWidget *frame; | |
1 | 1968 |
1969 struct findbyinfo *b = g_new0(struct findbyinfo, 1); | |
1970 b->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
480 | 1971 gtk_widget_set_usize(b->window, 350, 320); |
479 | 1972 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, FALSE, TRUE); |
1973 gtk_widget_show(b->window); | |
1974 | |
1975 dialogwindows = g_list_prepend(dialogwindows, b->window); | |
1976 | |
1977 | |
1978 frame = gtk_frame_new(_("Search for Buddy")); | |
1979 fbox = gtk_vbox_new(FALSE, 5); | |
1980 | |
1981 /* Build OK Button */ | |
1982 | |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1983 ok = picture_button(b->window, _("OK"), ok_xpm); |
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
1984 cancel = picture_button(b->window, _("Cancel"), cancel_xpm); |
1 | 1985 |
1986 bbox = gtk_hbox_new(TRUE, 10); | |
479 | 1987 vbox = gtk_vbox_new(FALSE, 2); |
1 | 1988 |
1989 b->firstentry = gtk_entry_new(); | |
1990 b->middleentry = gtk_entry_new(); | |
1991 b->lastentry = gtk_entry_new(); | |
1992 b->maidenentry = gtk_entry_new(); | |
1993 b->cityentry = gtk_entry_new(); | |
1994 b->stateentry = gtk_entry_new(); | |
1995 b->countryentry = gtk_entry_new(); | |
1996 | |
595 | 1997 gtk_box_pack_start(GTK_BOX(bbox), ok, FALSE, FALSE, 10); |
483 | 1998 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 10); |
1 | 1999 |
479 | 2000 /* Line 1 */ |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2001 label = gtk_label_new(_("First Name")); |
1 | 2002 gtk_widget_show(label); |
479 | 2003 |
2004 hbox = gtk_hbox_new(FALSE, 2); | |
2005 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
2006 gtk_box_pack_end(GTK_BOX(hbox), b->firstentry, FALSE, FALSE, 5); | |
2007 | |
2008 gtk_widget_show(hbox); | |
2009 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
2010 | |
2011 /* Line 2 */ | |
1 | 2012 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2013 label = gtk_label_new(_("Middle Name")); |
1 | 2014 gtk_widget_show(label); |
479 | 2015 |
2016 hbox = gtk_hbox_new(FALSE, 2); | |
2017 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
2018 gtk_box_pack_end(GTK_BOX(hbox), b->middleentry, FALSE, FALSE, 5); | |
2019 | |
2020 gtk_widget_show(hbox); | |
2021 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
2022 | |
2023 /* Line 3 */ | |
2024 | |
2025 label = gtk_label_new(_("Last Name")); | |
1 | 2026 gtk_widget_show(label); |
479 | 2027 |
2028 hbox = gtk_hbox_new(FALSE, 2); | |
2029 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
2030 gtk_box_pack_end(GTK_BOX(hbox), b->lastentry, FALSE, FALSE, 5); | |
2031 | |
2032 gtk_widget_show(hbox); | |
2033 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
2034 | |
2035 /* Line 4 */ | |
2036 | |
2037 label = gtk_label_new(_("Maiden Name")); | |
1 | 2038 gtk_widget_show(label); |
479 | 2039 |
2040 hbox = gtk_hbox_new(FALSE, 2); | |
2041 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
2042 gtk_box_pack_end(GTK_BOX(hbox), b->maidenentry, FALSE, FALSE, 5); | |
2043 | |
2044 gtk_widget_show(hbox); | |
2045 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
2046 | |
2047 /* Line 5 */ | |
2048 | |
2049 label = gtk_label_new(_("City")); | |
1 | 2050 gtk_widget_show(label); |
479 | 2051 |
2052 hbox = gtk_hbox_new(FALSE, 2); | |
2053 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
2054 gtk_box_pack_end(GTK_BOX(hbox), b->cityentry, FALSE, FALSE, 5); | |
2055 | |
2056 gtk_widget_show(hbox); | |
2057 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
2058 | |
2059 /* Line 6 */ | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2060 label = gtk_label_new(_("State")); |
1 | 2061 gtk_widget_show(label); |
479 | 2062 |
2063 hbox = gtk_hbox_new(FALSE, 2); | |
2064 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
2065 gtk_box_pack_end(GTK_BOX(hbox), b->stateentry, FALSE, FALSE, 5); | |
2066 | |
2067 gtk_widget_show(hbox); | |
2068 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
2069 | |
2070 /* Line 7 */ | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2071 label = gtk_label_new(_("Country")); |
1 | 2072 gtk_widget_show(label); |
479 | 2073 |
2074 hbox = gtk_hbox_new(FALSE, 2); | |
2075 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
2076 gtk_box_pack_end(GTK_BOX(hbox), b->countryentry, FALSE, FALSE, 5); | |
2077 | |
2078 gtk_widget_show(hbox); | |
2079 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
2080 | |
2081 /* Merge The Boxes */ | |
2082 | |
2083 gtk_container_add(GTK_CONTAINER(frame), vbox); | |
2084 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5); | |
2085 gtk_box_pack_start(GTK_BOX(fbox), bbox, FALSE, FALSE, 5); | |
1 | 2086 |
2087 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", | |
2088 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
2089 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", | |
2090 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
2091 gtk_signal_connect(GTK_OBJECT(ok), "clicked", | |
2092 GTK_SIGNAL_FUNC(do_find_info), b); | |
2093 | |
2094 gtk_widget_show(ok); | |
2095 gtk_widget_show(cancel); | |
2096 gtk_widget_show(b->firstentry); | |
2097 gtk_widget_show(b->middleentry); | |
2098 gtk_widget_show(b->lastentry); | |
2099 gtk_widget_show(b->maidenentry); | |
2100 gtk_widget_show(b->cityentry); | |
2101 gtk_widget_show(b->stateentry); | |
2102 gtk_widget_show(b->countryentry); | |
2103 gtk_widget_show(bbox); | |
2104 gtk_widget_show(vbox); | |
479 | 2105 gtk_widget_show(frame); |
2106 gtk_widget_show(fbox); | |
2107 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2108 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Find Buddy By Info")); |
1 | 2109 gtk_window_set_focus(GTK_WINDOW(b->window), b->firstentry); |
479 | 2110 gtk_container_add(GTK_CONTAINER(b->window), fbox); |
2111 gtk_container_border_width(GTK_CONTAINER(b->window), 5); | |
1 | 2112 gtk_widget_realize(b->window); |
2113 aol_icon(b->window->window); | |
2114 | |
2115 gtk_widget_show(b->window); | |
2116 } | |
2117 | |
2118 void show_find_email() | |
2119 { | |
2120 GtkWidget *label; | |
2121 GtkWidget *bbox; | |
2122 GtkWidget *vbox; | |
2123 GtkWidget *topbox; | |
444 | 2124 GtkWidget *frame; |
2125 GtkWidget *button; | |
1 | 2126 |
2127 struct findbyemail *b = g_new0(struct findbyemail, 1); | |
2128 b->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
477 | 2129 gtk_widget_set_usize(b->window, 240, 110); |
478 | 2130 gtk_window_set_policy(GTK_WINDOW(b->window), FALSE, FALSE, TRUE); |
444 | 2131 gtk_widget_show(b->window); |
1 | 2132 dialogwindows = g_list_prepend(dialogwindows, b->window); |
2133 | |
444 | 2134 frame = gtk_frame_new(_("Search for Buddy")); |
2135 | |
2136 bbox = gtk_hbox_new(TRUE, 10); | |
1 | 2137 topbox = gtk_hbox_new(FALSE, 5); |
2138 vbox = gtk_vbox_new(FALSE, 5); | |
2139 | |
2140 b->emailentry = gtk_entry_new(); | |
2141 | |
444 | 2142 /* Build OK Button */ |
2143 | |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
2144 button = picture_button(b->window, _("OK"), ok_xpm); |
444 | 2145 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
2146 GTK_SIGNAL_FUNC(do_find_email), b); | |
2147 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); | |
2148 | |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
2149 button = picture_button(b->window, _("Cancel"), cancel_xpm); |
444 | 2150 gtk_signal_connect(GTK_OBJECT(button), "clicked", |
2151 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
2152 gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 5); | |
2153 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2154 label = gtk_label_new(_("Email")); |
1 | 2155 gtk_widget_show(label); |
2156 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); | |
2157 gtk_box_pack_start(GTK_BOX(topbox), b->emailentry, FALSE, FALSE, 5); | |
2158 | |
2159 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5); | |
2160 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); | |
2161 | |
2162 gtk_signal_connect(GTK_OBJECT(b->window), "destroy", | |
2163 GTK_SIGNAL_FUNC(destroy_dialog), b->window); | |
2164 gtk_signal_connect(GTK_OBJECT(b->emailentry), "activate", | |
2165 GTK_SIGNAL_FUNC(do_find_email), b); | |
2166 | |
444 | 2167 gtk_container_add(GTK_CONTAINER(frame), vbox); |
1 | 2168 gtk_widget_show(b->emailentry); |
444 | 2169 gtk_widget_show(frame); |
2170 gtk_widget_show(topbox); | |
1 | 2171 gtk_widget_show(bbox); |
2172 gtk_widget_show(vbox); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2173 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Find Buddy By Email")); |
1 | 2174 gtk_window_set_focus(GTK_WINDOW(b->window), b->emailentry); |
444 | 2175 gtk_container_add(GTK_CONTAINER(b->window), frame); |
1 | 2176 gtk_container_border_width(GTK_CONTAINER(b->window), 10); |
2177 gtk_widget_realize(b->window); | |
2178 aol_icon(b->window->window); | |
2179 | |
2180 gtk_widget_show(b->window); | |
2181 } | |
2182 | |
2183 /*------------------------------------------------------*/ | |
2184 /* Link Dialog */ | |
2185 /*------------------------------------------------------*/ | |
2186 | |
608 | 2187 void cancel_link(GtkWidget *widget, struct conversation *c) |
1 | 2188 { |
608 | 2189 if (c->link) { |
62 | 2190 set_state_lock(1); |
608 | 2191 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->link), FALSE); |
62 | 2192 set_state_lock(0); |
2193 } | |
608 | 2194 destroy_dialog(NULL, c->link_dialog); |
2195 c->link_dialog = NULL; | |
1 | 2196 } |
2197 | |
2198 void do_add_link(GtkWidget *widget, struct linkdlg *b) | |
2199 { | |
2200 char *open_tag; | |
2201 char *urltext, *showtext; | |
2202 open_tag = g_malloc(2048); | |
2203 | |
2204 | |
2205 urltext = gtk_entry_get_text(GTK_ENTRY(b->url)); | |
2206 showtext = gtk_entry_get_text(GTK_ENTRY(b->text)); | |
2207 | |
2208 g_snprintf(open_tag, 2048, "<A HREF=\"%s\">%s", urltext, showtext); | |
2209 surround(b->entry, open_tag, "</A>"); | |
2210 | |
2211 g_free(open_tag); | |
2212 destroy_dialog(NULL, b->window); | |
2213 } | |
2214 | |
2215 | |
608 | 2216 void show_add_link(GtkWidget *linky, struct conversation *c) |
1 | 2217 { |
2218 GtkWidget *vbox; | |
2219 GtkWidget *bbox; | |
588 | 2220 GtkWidget *hbox; |
1 | 2221 GtkWidget *label; |
588 | 2222 GtkWidget *frame; |
2223 GtkWidget *fbox; | |
1 | 2224 |
608 | 2225 if (!c->link_dialog) { |
1 | 2226 struct linkdlg *b = g_new0(struct linkdlg, 1); |
608 | 2227 c->link_dialog = gtk_window_new(GTK_WINDOW_DIALOG); |
2228 dialogwindows = g_list_prepend(dialogwindows, c->link_dialog); | |
2229 | |
2230 gtk_widget_set_usize(c->link_dialog, 270, 165); | |
2231 gtk_window_set_policy(GTK_WINDOW(c->link_dialog), FALSE, FALSE, TRUE); | |
2232 gtk_widget_show(c->link_dialog); | |
588 | 2233 |
2234 vbox = gtk_vbox_new(FALSE, 10); | |
2235 bbox = gtk_hbox_new(TRUE, 10); | |
2236 frame = gtk_frame_new(_("Insert Link")); | |
2237 fbox = gtk_vbox_new(FALSE, 5); | |
2238 | |
2239 /* Build OK Button */ | |
2240 | |
608 | 2241 b->ok = picture_button(c->link_dialog, _("OK"), ok_xpm); |
2242 b->cancel = picture_button(c->link_dialog, _("Cancel"), cancel_xpm); | |
1 | 2243 |
651 | 2244 gtk_widget_set_usize(b->ok, 75, 30); |
2245 gtk_widget_set_usize(b->cancel, 75, 30); | |
2246 | |
1 | 2247 gtk_box_pack_start(GTK_BOX(bbox), b->ok, FALSE, FALSE, 10); |
588 | 2248 gtk_box_pack_end(GTK_BOX(bbox), b->cancel, FALSE, FALSE, 10); |
1 | 2249 gtk_widget_show(bbox); |
2250 | |
2251 b->url = gtk_entry_new(); | |
2252 b->text = gtk_entry_new(); | |
2253 | |
588 | 2254 hbox = gtk_hbox_new(FALSE, 5); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2255 label = gtk_label_new(_("URL")); |
588 | 2256 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
2257 gtk_box_pack_end(GTK_BOX(hbox), b->url, FALSE, FALSE, 5); | |
1 | 2258 gtk_widget_show(label); |
588 | 2259 gtk_widget_show(hbox); |
2260 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
2261 | |
2262 hbox = gtk_hbox_new(FALSE, 5); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2263 label = gtk_label_new(_("Description")); |
588 | 2264 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
2265 gtk_box_pack_end(GTK_BOX(hbox), b->text, FALSE, FALSE, 5); | |
1 | 2266 gtk_widget_show(label); |
588 | 2267 gtk_widget_show(hbox); |
2268 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); | |
2269 | |
1 | 2270 gtk_widget_show(b->url); |
2271 gtk_widget_show(b->text); | |
588 | 2272 gtk_widget_show(frame); |
2273 gtk_widget_show(fbox); | |
2274 | |
2275 gtk_container_add(GTK_CONTAINER(frame), vbox); | |
2276 gtk_box_pack_start(GTK_BOX(fbox), frame, FALSE, FALSE, 5); | |
2277 gtk_box_pack_start(GTK_BOX(fbox), bbox, TRUE, TRUE, 5); | |
1 | 2278 gtk_widget_show(vbox); |
2279 | |
608 | 2280 gtk_signal_connect(GTK_OBJECT(c->link_dialog), "destroy", |
2281 GTK_SIGNAL_FUNC(cancel_link), c); | |
1 | 2282 gtk_signal_connect(GTK_OBJECT(b->cancel), "clicked", |
608 | 2283 GTK_SIGNAL_FUNC(cancel_link), c); |
1 | 2284 gtk_signal_connect(GTK_OBJECT(b->ok), "clicked", |
2285 GTK_SIGNAL_FUNC(do_add_link), b); | |
2286 | |
608 | 2287 gtk_container_add(GTK_CONTAINER(c->link_dialog ), fbox); |
2288 gtk_container_border_width(GTK_CONTAINER(c->link_dialog ), 10); | |
2289 gtk_window_set_title(GTK_WINDOW(c->link_dialog ), _("GAIM - Add URL")); | |
2290 gtk_window_set_focus(GTK_WINDOW(c->link_dialog ), b->url); | |
2291 b->window = c->link_dialog; | |
2292 b->toggle = linky; | |
611
0f7e5ff95f71
[gaim-migrate @ 621]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
609
diff
changeset
|
2293 b->entry = c->entry; |
608 | 2294 gtk_widget_realize(c->link_dialog); |
2295 aol_icon(c->link_dialog->window); | |
1 | 2296 |
2297 } | |
2298 | |
608 | 2299 gtk_widget_show(c->link_dialog); |
2300 gdk_window_raise(c->link_dialog->window); | |
1 | 2301 } |
2302 | |
2303 | |
2304 /*------------------------------------------------------*/ | |
2305 /* Color Selection Dialog */ | |
2306 /*------------------------------------------------------*/ | |
2307 | |
657
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2308 static GtkWidget *fgcseld = NULL; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2309 static GtkWidget *bgcseld = NULL; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2310 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2311 void cancel_color(GtkWidget *widget, struct conversation *c) |
1 | 2312 { |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2313 if (c->palette && widget) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2314 { |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2315 set_state_lock(1); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2316 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->palette), FALSE); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2317 set_state_lock(0); |
61 | 2318 } |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2319 dialogwindows = g_list_remove(dialogwindows, c->color_dialog); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2320 gtk_widget_destroy(c->color_dialog); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2321 c->color_dialog = NULL; |
1 | 2322 } |
2323 | |
2324 void do_color(GtkWidget *widget, GtkColorSelection *colorsel) | |
2325 { | |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2326 gdouble color[3]; |
1 | 2327 GdkColor text_color; |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2328 struct conversation *c; |
1 | 2329 char *open_tag; |
2330 | |
2331 open_tag = g_malloc(30); | |
2332 | |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2333 gtk_color_selection_get_color (colorsel, color); |
1 | 2334 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2335 c = gtk_object_get_user_data(GTK_OBJECT(colorsel)); |
411
a330017b3aa4
[gaim-migrate @ 421]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
401
diff
changeset
|
2336 /* GTK_IS_EDITABLE(c->entry); huh? */ |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2337 |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2338 text_color.red = ((guint16)(color[0]*65535))>>8; |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2339 text_color.green = ((guint16)(color[1]*65535))>>8; |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2340 text_color.blue = ((guint16)(color[2]*65535))>>8; |
1 | 2341 |
2342 g_snprintf(open_tag, 23, "<FONT COLOR=\"#%02X%02X%02X\">", text_color.red, text_color.green, text_color.blue); | |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2343 surround(c->entry, open_tag, "</FONT>"); |
1 | 2344 sprintf(debug_buff,"#%02X%02X%02X\n", text_color.red, text_color.green, text_color.blue); |
2345 debug_print(debug_buff); | |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2346 g_free(open_tag); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2347 cancel_color(NULL, c); |
1 | 2348 } |
2349 | |
657
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2350 static void destroy_colorsel(GtkWidget *w, gpointer d) |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2351 { |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2352 if (d) { |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2353 gtk_widget_destroy(fgcseld); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2354 fgcseld = NULL; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2355 } else { |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2356 gtk_widget_destroy(bgcseld); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2357 bgcseld = NULL; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2358 } |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2359 } |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2360 |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2361 static void apply_color_dlg(GtkWidget *w, gpointer d) |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2362 { |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2363 gdouble color[3]; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2364 if ((int)d == 1) { |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2365 gtk_color_selection_get_color(GTK_COLOR_SELECTION(fgcseld), color); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2366 destroy_colorsel(NULL, (void *)1); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2367 } else { |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2368 gtk_color_selection_get_color(GTK_COLOR_SELECTION(bgcseld), color); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2369 destroy_colorsel(NULL, (void *)2); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2370 } |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2371 /* FIXME ! here we need to set the preferences, etc */ |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2372 } |
1 | 2373 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2374 void show_color_dialog(struct conversation *c, GtkWidget *color) |
1 | 2375 { |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2376 GtkWidget *colorsel; |
1 | 2377 |
657
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2378 if ((int)color == 1) { /* foreground */ |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2379 if (fgcseld) return; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2380 fgcseld = gtk_color_selection_dialog_new(_("Select Text Color")); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2381 gtk_signal_connect(GTK_OBJECT(fgcseld), "delete_event", GTK_SIGNAL_FUNC(destroy_colorsel), (void *)1); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2382 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(fgcseld)->cancel_button), "clicked", GTK_SIGNAL_FUNC(destroy_colorsel), (void *)1); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2383 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(fgcseld)->ok_button), "clicked", GTK_SIGNAL_FUNC(apply_color_dlg), (void *)1); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2384 gtk_widget_realize(fgcseld); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2385 aol_icon(fgcseld->window); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2386 gtk_widget_show(fgcseld); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2387 gdk_window_raise(fgcseld->window); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2388 return; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2389 } else if ((int)color == 2) { /* background */ |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2390 if (bgcseld) return; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2391 bgcseld = gtk_color_selection_dialog_new(_("Select Background Color")); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2392 gtk_signal_connect(GTK_OBJECT(bgcseld), "delete_event", GTK_SIGNAL_FUNC(destroy_colorsel), NULL); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2393 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(bgcseld)->cancel_button), "clicked", GTK_SIGNAL_FUNC(destroy_colorsel), NULL); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2394 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(bgcseld)->ok_button), "clicked", GTK_SIGNAL_FUNC(apply_color_dlg), (void *)2); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2395 gtk_widget_realize(bgcseld); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2396 aol_icon(bgcseld->window); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2397 gtk_widget_show(bgcseld); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2398 gdk_window_raise(bgcseld->window); |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2399 return; |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2400 } |
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2401 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2402 if (!c->color_dialog) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2403 { |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2404 c->color_dialog = gtk_color_selection_dialog_new(_("Select Text Color")); |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2405 colorsel = GTK_COLOR_SELECTION_DIALOG(c->color_dialog)->colorsel; |
1 | 2406 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2407 gtk_object_set_user_data(GTK_OBJECT(colorsel), c); |
1 | 2408 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2409 gtk_signal_connect(GTK_OBJECT(c->color_dialog), "delete_event", GTK_SIGNAL_FUNC(delete_event_dialog), c); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2410 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(c->color_dialog)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_color), colorsel); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2411 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(c->color_dialog)->cancel_button), "clicked", GTK_SIGNAL_FUNC(cancel_color), c); |
1 | 2412 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2413 gtk_widget_realize(c->color_dialog); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2414 aol_icon(c->color_dialog->window); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2415 } |
1 | 2416 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2417 gtk_widget_show(c->color_dialog); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2418 gdk_window_raise(c->color_dialog->window); |
1 | 2419 } |
2420 | |
2421 /*------------------------------------------------------------------------*/ | |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2422 /* Font Selection Dialog */ |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2423 /*------------------------------------------------------------------------*/ |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2424 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2425 void cancel_font(GtkWidget *widget, struct conversation *c) |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2426 { |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2427 if (c->font && widget) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2428 { |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2429 set_state_lock(1); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2430 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->font), FALSE); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2431 set_state_lock(0); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2432 } |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2433 dialogwindows = g_list_remove(dialogwindows, c->font_dialog); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2434 gtk_widget_destroy(c->font_dialog); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2435 c->font_dialog = NULL; |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2436 } |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2437 |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2438 void apply_font(GtkWidget *widget, GtkFontSelection *fontsel) |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2439 { |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2440 /* this could be expanded to include font size, weight, etc. |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2441 but for now only works with font face */ |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2442 int i, j = 0, k = 0; |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2443 struct conversation *c = gtk_object_get_user_data(GTK_OBJECT(fontsel)); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2444 |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2445 if (c) |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2446 { |
334
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2447 char *tmp = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontsel)); |
308
e5fa88351dc8
[gaim-migrate @ 318]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
300
diff
changeset
|
2448 strncpy(c->current_fontname, tmp, sizeof(c->current_fontname)); |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2449 |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2450 for (i = 0; i < strlen(c->current_fontname); i++) |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2451 { |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2452 if (c->current_fontname[i] == '-') |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2453 { |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2454 if (++j > 2) |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2455 break; |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2456 } |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2457 else if (j == 2) |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2458 c->current_fontface[k++] = c->current_fontname[i]; |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2459 } |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2460 c->current_fontface[k] = '\0'; |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2461 |
488
0fcb7e7a263c
[gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
487
diff
changeset
|
2462 sprintf(debug_buff, "Setting font face %s\n", c->current_fontface); |
0fcb7e7a263c
[gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
487
diff
changeset
|
2463 debug_print(debug_buff); |
0fcb7e7a263c
[gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
487
diff
changeset
|
2464 |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2465 set_font_face(NULL, c); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2466 } |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2467 else |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2468 { |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2469 if (fontface) |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2470 g_free(fontface); |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2471 |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2472 fontface = g_malloc(64); |
334
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2473 fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontsel)); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2474 |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2475 for (i = 0; i < strlen(fontname); i++) |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2476 { |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2477 if (fontname[i] == '-') |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2478 { |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2479 if (++j > 2) |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2480 break; |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2481 } |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2482 else if (j == 2) |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2483 fontface[k++] = fontname[i]; |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2484 } |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2485 fontface[k] = '\0'; |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2486 } |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2487 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2488 cancel_font(NULL, c); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2489 } |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2490 |
334
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2491 static GtkWidget *fontseld; |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2492 |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2493 void destroy_fontsel(GtkWidget *w, gpointer d) { |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2494 gtk_widget_destroy(fontseld); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2495 fontseld = NULL; |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2496 } |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2497 |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2498 void apply_font_dlg(GtkWidget *w, GtkWidget *f) { |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2499 int i, j = 0, k = 0; |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2500 if (fontface) |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2501 g_free(fontface); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2502 |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2503 fontface = g_malloc(64); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2504 fontname = gtk_font_selection_dialog_get_font_name(GTK_FONT_SELECTION_DIALOG(fontseld)); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2505 destroy_fontsel(0, 0); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2506 for (i = 0; i < strlen(fontname); i++) { |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2507 if (fontname[i] == '-') { |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2508 if (++j > 2) break; |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2509 } else if (j == 2) |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2510 fontface[k++] = fontname[i]; |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2511 } |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2512 fontface[k] = '\0'; |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2513 } |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2514 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2515 void show_font_dialog(struct conversation *c, GtkWidget *font) |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2516 { |
334
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2517 |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2518 if (!font) { /* we came from the prefs dialog */ |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2519 if (fontseld) return; |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2520 fontseld = gtk_font_selection_dialog_new(_("Select Font")); |
334
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2521 if (fontname) |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2522 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(fontseld), fontname); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2523 else |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2524 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(fontseld), DEFAULT_FONT_NAME); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2525 |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2526 gtk_object_set_user_data(GTK_OBJECT(fontseld), NULL); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2527 gtk_signal_connect(GTK_OBJECT(fontseld), "delete_event", GTK_SIGNAL_FUNC(destroy_fontsel), NULL); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2528 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(fontseld)->cancel_button), "clicked", GTK_SIGNAL_FUNC(destroy_fontsel), NULL); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2529 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(fontseld)->ok_button), "clicked", GTK_SIGNAL_FUNC(apply_font_dlg), NULL); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2530 gtk_widget_realize(fontseld); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2531 aol_icon(fontseld->window); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2532 gtk_widget_show(fontseld); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2533 gdk_window_raise(fontseld->window); |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2534 return; |
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2535 } |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2536 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2537 if (!c->font_dialog) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2538 { |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2539 c->font_dialog = gtk_font_selection_dialog_new(_("Select Font")); |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2540 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2541 if (font) |
334
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2542 gtk_object_set_user_data(GTK_OBJECT(c->font_dialog), c); |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2543 else |
334
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2544 gtk_object_set_user_data(GTK_OBJECT(c->font_dialog), NULL); |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
231
diff
changeset
|
2545 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2546 gtk_font_selection_dialog_set_font_name((GtkFontSelectionDialog *)c->font_dialog, DEFAULT_FONT_NAME); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2547 |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2548 gtk_signal_connect(GTK_OBJECT(c->font_dialog), "delete_event", GTK_SIGNAL_FUNC(delete_event_dialog), c); |
334
0fa651368776
[gaim-migrate @ 344]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
311
diff
changeset
|
2549 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(c->font_dialog)->ok_button), "clicked", GTK_SIGNAL_FUNC(apply_font), c->font_dialog); |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2550 gtk_signal_connect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(c->font_dialog)->cancel_button), "clicked", GTK_SIGNAL_FUNC(cancel_font), c); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2551 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2552 if (fontname) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2553 gtk_font_selection_dialog_set_font_name((GtkFontSelectionDialog *)c->font_dialog, fontname); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2554 else |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2555 gtk_font_selection_dialog_set_font_name((GtkFontSelectionDialog *)c->font_dialog, DEFAULT_FONT_NAME); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2556 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2557 gtk_widget_realize(c->font_dialog); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2558 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2559 aol_icon(c->font_dialog->window); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2560 } |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2561 gtk_widget_show(c->font_dialog); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
308
diff
changeset
|
2562 gdk_window_raise(c->font_dialog->window); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2563 } |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2564 |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2565 /*------------------------------------------------------------------------*/ |
1 | 2566 /* The dialog for import/export */ |
2567 /*------------------------------------------------------------------------*/ | |
2568 | |
228 | 2569 #define PATHSIZE 1024 |
2570 | |
229 | 2571 /* see if a buddy list cache file for this user exists */ |
2572 | |
2573 gboolean | |
2574 bud_list_cache_exists( void ) | |
2575 { | |
2576 gboolean ret = FALSE; | |
2577 char path[PATHSIZE]; | |
2578 char *file; | |
2579 struct stat sbuf; | |
2580 extern char g_screenname[]; | |
2581 | |
2582 file = getenv( "HOME" ); | |
2583 if ( file != (char *) NULL ) { | |
262
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2584 sprintf( path, "%s/.gaim/%s.blist", file, g_screenname ); |
229 | 2585 if ( !stat(path, &sbuf) ) |
2586 ret = TRUE; | |
2587 } | |
2588 return ret; | |
2589 } | |
2590 | |
262
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2591 /* if dummy is 0, save to ~/.gaim/screenname.blist. Else, let user choose */ |
228 | 2592 |
1 | 2593 void do_export(GtkWidget *w, void *dummy) |
2594 { | |
2595 FILE *f; | |
228 | 2596 gint show_dialog = (int) dummy; |
1 | 2597 char *buf = g_malloc(BUF_LONG); |
228 | 2598 char *file; |
2599 char path[PATHSIZE]; | |
2600 extern char g_screenname[]; | |
1 | 2601 |
228 | 2602 if ( show_dialog == 1 ) { |
2603 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(exportdialog)); | |
2604 strncpy( path, file, PATHSIZE - 1 ); | |
2605 } | |
2606 else { | |
2607 file = getenv( "HOME" ); | |
262
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2608 if ( file != (char *) NULL ) { |
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2609 FILE *dir; |
266
3b5b469d07f7
[gaim-migrate @ 276]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
262
diff
changeset
|
2610 sprintf(buf, "%s/.gaim/", file); |
262
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2611 dir = fopen(buf, "r"); |
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2612 if (!dir) |
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2613 mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR); |
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2614 else |
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2615 fclose(dir); |
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2616 sprintf( path, "%s/.gaim/%s.blist", file, g_screenname ); |
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2617 } else |
228 | 2618 return; |
2619 } | |
2620 if ((f = fopen(path,"w"))) { | |
237
6ced2f1c8b24
[gaim-migrate @ 247]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
236
diff
changeset
|
2621 serv_build_config(buf, 8192 - 1); |
1 | 2622 fprintf(f, "%s\n", buf); |
2623 fclose(f); | |
2624 chmod(buf, S_IRUSR | S_IWUSR); | |
228 | 2625 } else if ( show_dialog == 1 ) { |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2626 g_snprintf(buf, BUF_LONG / 2, _("Error writing file %s"), file); |
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2627 do_error_dialog(buf, _("Error")); |
1 | 2628 } |
228 | 2629 if ( show_dialog == 1 ) { |
2630 destroy_dialog(NULL, exportdialog); | |
2631 exportdialog = NULL; | |
2632 } | |
1 | 2633 |
2634 g_free(buf); | |
2635 | |
2636 } | |
2637 | |
2638 | |
2639 void show_export_dialog() | |
2640 { | |
2641 char *buf = g_malloc(BUF_LEN); | |
2642 if (!exportdialog) { | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2643 exportdialog = gtk_file_selection_new(_("Gaim - Export Buddy List")); |
1 | 2644 |
2645 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(exportdialog)); | |
2646 | |
2647 g_snprintf(buf, BUF_LEN - 1, "%s/gaim.buddy", getenv("HOME")); | |
2648 | |
2649 gtk_file_selection_set_filename(GTK_FILE_SELECTION(exportdialog), buf); | |
2650 gtk_signal_connect(GTK_OBJECT(exportdialog), "destroy", | |
2651 GTK_SIGNAL_FUNC(destroy_dialog), exportdialog); | |
2652 | |
2653 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(exportdialog)->ok_button), | |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2654 "clicked", GTK_SIGNAL_FUNC(do_export), (void*)1); |
1 | 2655 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(exportdialog)->cancel_button), |
2656 "clicked", GTK_SIGNAL_FUNC(destroy_dialog), exportdialog); | |
2657 | |
2658 | |
2659 } | |
2660 | |
2661 g_free(buf); | |
2662 | |
2663 gtk_widget_show(exportdialog); | |
2664 gdk_window_raise(exportdialog->window); | |
2665 | |
2666 } | |
2667 | |
262
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2668 /* if dummy is 0, then import from ~/.gaim/screenname.blist, else let user |
229 | 2669 choose */ |
228 | 2670 |
1 | 2671 void do_import(GtkWidget *w, void *dummy) |
2672 { | |
228 | 2673 gint show_dialog = (int) dummy; |
1 | 2674 GList *grp, *grp2; |
2675 char *buf = g_malloc(BUF_LONG); | |
2676 char *buf2; | |
2677 char *first = g_malloc(64); | |
228 | 2678 char *file; |
2679 char path[PATHSIZE]; | |
1 | 2680 FILE *f; |
228 | 2681 extern char g_screenname[]; |
2682 | |
2683 if ( show_dialog == 1 ) { | |
2684 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog)); | |
2685 strncpy( path, file, PATHSIZE - 1 ); | |
2686 } | |
2687 else { | |
2688 file = getenv( "HOME" ); | |
2689 if ( file != (char *) NULL ) | |
262
07abf2ed6665
[gaim-migrate @ 272]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
255
diff
changeset
|
2690 sprintf( path, "%s/.gaim/%s.blist", file, g_screenname ); |
228 | 2691 else |
2692 return; | |
2693 } | |
2694 | |
2695 if (!(f = fopen(path,"r"))) { | |
2696 if ( show_dialog == 1 ) { | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2697 g_snprintf(buf, BUF_LONG / 2, _("Error reading file %s"), file); |
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2698 do_error_dialog(buf, _("Error")); |
228 | 2699 destroy_dialog(NULL, importdialog); |
2700 importdialog = NULL; | |
2701 } | |
1 | 2702 g_free(buf); |
37 | 2703 g_free(first); |
1 | 2704 return; |
2705 } | |
2706 | |
2707 fgets(first, 64, f); | |
2708 | |
2709 if (!strcasecmp(first, "Config {\n")) { | |
228 | 2710 if ( show_dialog == 1 ) { |
2711 destroy_dialog(NULL, importdialog); | |
2712 importdialog = NULL; | |
2713 } | |
25 | 2714 g_free(buf); |
37 | 2715 g_free(first); |
228 | 2716 fclose( f ); |
1 | 2717 return; |
2718 } else if (buf[0] == 'm') { | |
2719 buf2 = buf; | |
231 | 2720 buf = g_malloc(8193); |
2721 g_snprintf(buf, 8192, "toc_set_config {%s}\n", buf2); | |
1 | 2722 g_free(buf2); |
2723 } | |
2724 | |
2725 | |
2726 fseek(f, 0, SEEK_SET); | |
2727 | |
2728 fread(buf, BUF_LONG, 1, f); | |
2729 | |
2730 grp = groups; | |
2731 | |
657
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2732 /* why is this being done? if we merge them than this shouldn't happen |
1 | 2733 while(grp) { |
2734 grp2 = grp->next; | |
2735 remove_group((struct group *)grp->data); | |
2736 grp = grp2; | |
2737 } | |
657
4bbc103a3294
[gaim-migrate @ 667]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
654
diff
changeset
|
2738 */ |
1 | 2739 |
296
a88b889b692b
[gaim-migrate @ 306]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
266
diff
changeset
|
2740 parse_toc_buddy_list(buf, 1); |
1 | 2741 |
2742 serv_save_config(); | |
2743 | |
2744 build_edit_tree(); | |
2745 build_permit_tree(); | |
2746 | |
228 | 2747 fclose( f ); |
2748 | |
2749 if ( show_dialog == 1 ) { | |
2750 /* save what we just did to cache */ | |
2751 | |
2752 do_export( (GtkWidget *) NULL, 0 ); | |
2753 destroy_dialog(NULL, importdialog); | |
2754 importdialog = NULL; | |
2755 } | |
1 | 2756 |
2757 g_free(buf); | |
37 | 2758 g_free(first); |
1 | 2759 } |
2760 | |
2761 void show_import_dialog() | |
2762 { | |
2763 char *buf = g_malloc(BUF_LEN); | |
2764 if (!importdialog) { | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2765 importdialog = gtk_file_selection_new(_("Gaim - Import Buddy List")); |
1 | 2766 |
2767 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(importdialog)); | |
2768 | |
2769 g_snprintf(buf, BUF_LEN - 1, "%s/", getenv("HOME")); | |
2770 | |
2771 gtk_file_selection_set_filename(GTK_FILE_SELECTION(importdialog), buf); | |
2772 gtk_signal_connect(GTK_OBJECT(importdialog), "destroy", | |
2773 GTK_SIGNAL_FUNC(destroy_dialog), importdialog); | |
2774 | |
2775 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(importdialog)->ok_button), | |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
229
diff
changeset
|
2776 "clicked", GTK_SIGNAL_FUNC(do_import), (void*)1); |
1 | 2777 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(importdialog)->cancel_button), |
2778 "clicked", GTK_SIGNAL_FUNC(destroy_dialog), importdialog); | |
2779 | |
2780 | |
2781 } | |
2782 | |
24 | 2783 g_free(buf); |
1 | 2784 gtk_widget_show(importdialog); |
2785 gdk_window_raise(importdialog->window); | |
2786 } | |
2787 | |
2788 | |
2789 /*------------------------------------------------------------------------*/ | |
2790 /* The dialog for new away messages */ | |
2791 /*------------------------------------------------------------------------*/ | |
2792 | |
2793 void create_mess(GtkWidget *widget, struct create_away *ca) | |
2794 { | |
2795 struct away_message *b; | |
2796 gchar *away_message; | |
2797 guint text_len; | |
2798 int is_checked; | |
2799 | |
2800 /* Grab the appropriate data */ | |
2801 b = g_new0(struct away_message, 1); | |
2802 g_snprintf(b->name, sizeof(b->name), "%s", gtk_entry_get_text(GTK_ENTRY(ca->entry))); | |
2803 | |
2804 /* Get proper Length */ | |
2805 text_len = gtk_text_get_length(GTK_TEXT(ca->text)); | |
2806 away_message = gtk_editable_get_chars(GTK_EDITABLE(ca->text), 0, text_len); | |
2807 | |
2808 g_snprintf(b->message, sizeof(b->message), "%s", away_message); | |
38 | 2809 g_free(away_message); |
1 | 2810 is_checked = GTK_TOGGLE_BUTTON(ca->checkbx)->active; |
2811 | |
452
0a2eb65b6909
[gaim-migrate @ 462]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
444
diff
changeset
|
2812 if (is_checked) { |
1 | 2813 away_messages = g_list_append(away_messages, b); |
2814 save_prefs(); | |
2815 do_away_menu(); | |
652
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
651
diff
changeset
|
2816 if (prefs_away_list != NULL) |
4d3285caa191
[gaim-migrate @ 662]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
651
diff
changeset
|
2817 gtk_list_select_item(GTK_LIST(prefs_away_list), g_list_index(away_messages, b)); |
452
0a2eb65b6909
[gaim-migrate @ 462]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
444
diff
changeset
|
2818 } |
0a2eb65b6909
[gaim-migrate @ 462]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
444
diff
changeset
|
2819 |
0a2eb65b6909
[gaim-migrate @ 462]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
444
diff
changeset
|
2820 /* stick it on the away list */ |
470
4bf9c74b9e4d
[gaim-migrate @ 480]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
467
diff
changeset
|
2821 if (!strlen(b->name)) |
4bf9c74b9e4d
[gaim-migrate @ 480]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
467
diff
changeset
|
2822 g_snprintf(b->name, sizeof(b->name), "I'm away!"); |
4bf9c74b9e4d
[gaim-migrate @ 480]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
467
diff
changeset
|
2823 do_away_message(NULL, b); |
1 | 2824 |
2825 destroy_dialog(NULL, ca->window); | |
2826 } | |
2827 | |
2828 void create_away_mess(GtkWidget *widget, void *dummy) | |
2829 { | |
2830 GtkWidget *bbox; | |
439 | 2831 GtkWidget *hbox; |
1 | 2832 GtkWidget *titlebox; |
2833 GtkWidget *tbox; | |
2834 GtkWidget *sw; | |
2835 GtkWidget *label; | |
439 | 2836 GtkWidget *frame; |
2837 GtkWidget *fbox; | |
441 | 2838 GtkWidget *button; |
1 | 2839 |
2840 struct create_away *ca = g_new0(struct create_away, 1); | |
2841 | |
2842 /* Set up window */ | |
2843 ca->window = gtk_window_new(GTK_WINDOW_DIALOG); | |
441 | 2844 gtk_widget_set_usize(ca->window, 275, 200); |
2845 gtk_widget_show(ca->window); | |
2846 gtk_container_border_width(GTK_CONTAINER(ca->window), 5); | |
440 | 2847 gtk_window_set_policy(GTK_WINDOW(ca->window), FALSE, FALSE, TRUE); |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2848 gtk_window_set_title(GTK_WINDOW(ca->window), _("Gaim - New away message")); |
1 | 2849 gtk_signal_connect(GTK_OBJECT(ca->window),"delete_event", |
2850 GTK_SIGNAL_FUNC(destroy_dialog), ca->window); | |
2851 | |
439 | 2852 /* Set up our frame */ |
2853 | |
2854 frame = gtk_frame_new(_("New away message")); | |
2855 | |
1 | 2856 /* set up container boxes */ |
440 | 2857 bbox = gtk_hbox_new(FALSE, 0); |
439 | 2858 fbox = gtk_vbox_new(FALSE, 0); |
440 | 2859 hbox = gtk_hbox_new(FALSE, 0); |
1 | 2860 titlebox = gtk_hbox_new(FALSE, 0); |
2861 tbox = gtk_vbox_new(FALSE, 0); | |
2862 | |
2863 /* Make a label for away entry */ | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
2864 label = gtk_label_new(_("Away title: ")); |
440 | 2865 gtk_box_pack_start(GTK_BOX(titlebox), label, TRUE, TRUE, 5); |
441 | 2866 gtk_widget_show(label); |
1 | 2867 |
2868 /* make away title entry */ | |
2869 ca->entry = gtk_entry_new(); | |
440 | 2870 gtk_box_pack_start(GTK_BOX(titlebox), ca->entry, TRUE, TRUE, 5); |
1 | 2871 |
2872 sw = gtk_scrolled_window_new(NULL, NULL); | |
2873 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
2874 GTK_POLICY_AUTOMATIC, | |
2875 GTK_POLICY_AUTOMATIC); | |
2876 gtk_widget_show(sw); | |
2877 | |
2878 /* create and format text box */ | |
2879 ca->text = gtk_text_new(NULL, NULL); | |
2880 gtk_text_set_word_wrap(GTK_TEXT(ca->text), TRUE); | |
2881 gtk_text_set_editable(GTK_TEXT(ca->text), TRUE ); | |
2882 gtk_container_add(GTK_CONTAINER(sw), ca->text); | |
2883 gtk_widget_show(ca->text); | |
440 | 2884 gtk_box_pack_start(GTK_BOX(bbox), sw, TRUE, TRUE, 5); |
1 | 2885 |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
2886 button = picture_button(ca->window, _("Away"), save_xpm); |
441 | 2887 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(create_mess), ca); |
2888 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); | |
2889 | |
603
9b0717b4a490
[gaim-migrate @ 613]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
2890 button = picture_button(ca->window, _("Cancel"), cancel_xpm); |
441 | 2891 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(destroy_dialog), ca->window); |
2892 gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 5); | |
2893 | |
1 | 2894 /* Checkbox for showing away msg */ |
452
0a2eb65b6909
[gaim-migrate @ 462]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
444
diff
changeset
|
2895 ca->checkbx = gtk_check_button_new_with_label(_("Save for later use")); |
1 | 2896 |
2897 /* pack boxes where they belong */ | |
440 | 2898 gtk_box_pack_start(GTK_BOX(fbox), titlebox, TRUE, TRUE, 5); |
2899 gtk_box_pack_start(GTK_BOX(fbox), bbox, TRUE, TRUE, 5); | |
2900 gtk_box_pack_start(GTK_BOX(fbox), ca->checkbx, TRUE, TRUE, 5); | |
439 | 2901 |
2902 gtk_container_add(GTK_CONTAINER(frame), fbox); | |
2903 gtk_container_set_border_width(GTK_CONTAINER(frame), 5); | |
2904 gtk_box_pack_start(GTK_BOX(tbox), frame, TRUE, TRUE, 0); | |
442 | 2905 gtk_box_pack_start(GTK_BOX(tbox), hbox, TRUE, FALSE, 5); |
439 | 2906 |
1 | 2907 gtk_container_add(GTK_CONTAINER(ca->window), tbox); |
2908 | |
2909 /* let the world see what we have done. */ | |
2910 gtk_widget_show(label); | |
2911 gtk_widget_show(ca->checkbx); | |
2912 gtk_widget_show(ca->entry); | |
2913 gtk_widget_show(titlebox); | |
439 | 2914 gtk_widget_show(hbox); |
1 | 2915 gtk_widget_show(tbox); |
2916 gtk_widget_show(bbox); | |
439 | 2917 gtk_widget_show(fbox); |
2918 gtk_widget_show(frame); | |
1 | 2919 |
2920 gtk_widget_realize(ca->window); | |
2921 aol_icon(ca->window->window); | |
2922 } | |
555 | 2923 |
2924 /* smiley dialog */ | |
2925 | |
2926 void close_smiley_dialog(GtkWidget *widget, struct conversation *c) | |
2927 { | |
570 | 2928 if (c->smiley) |
2929 { | |
2930 set_state_lock(1); | |
2931 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(c->smiley), FALSE); | |
2932 set_state_lock(0); | |
2933 } | |
555 | 2934 dialogwindows = g_list_remove(dialogwindows, c->smiley_dialog); |
2935 gtk_widget_destroy(c->smiley_dialog); | |
2936 c->smiley_dialog = NULL; | |
2937 } | |
2938 | |
2939 void set_smiley_array(GtkWidget *widget, int smiley_type) | |
2940 { | |
2941 int i; | |
2942 | |
2943 for (i = 0; i < FACE_TOTAL; i++) | |
2944 smiley_array[i] = 0; | |
2945 | |
2946 smiley_array[smiley_type] = 1; | |
2947 | |
2948 return; | |
2949 } | |
2950 | |
2951 void insert_smiley_text(GtkWidget *widget, struct conversation *c) | |
2952 { | |
2953 char *smiley_text; | |
2954 int i; | |
2955 | |
2956 for (i = 0; i < FACE_TOTAL; i++) | |
2957 if (smiley_array[i] == 1) | |
2958 break; | |
2959 | |
2960 switch (i) | |
2961 { | |
2962 case (FACE_ANGEL): smiley_text = g_strndup("O:-)", strlen("O:-)")); break; | |
2963 case (FACE_BIGSMILE): smiley_text = g_strndup(":-D", strlen(":-D")); break; | |
2964 case (FACE_BURP): smiley_text = g_strndup(":-!", strlen(":-!")); break; | |
2965 case (FACE_CROSSEDLIPS): smiley_text = g_strndup(":-X", strlen(":-X")); break; | |
2966 case (FACE_CRY): smiley_text = g_strndup(":'(", strlen(":'(")); break; | |
2967 case (FACE_EMBARRASSED): smiley_text = g_strndup(":-[", strlen(":-[")); break; | |
2968 case (FACE_KISS): smiley_text = g_strndup(":-*", strlen(":-*")); break; | |
2969 case (FACE_MONEYMOUTH): smiley_text = g_strndup(":-$", strlen(":-$")); break; | |
2970 case (FACE_SAD): smiley_text = g_strndup(":-(", strlen(":-(")); break; | |
2971 case (FACE_SCREAM): smiley_text = g_strndup("=-O", strlen("=-O")); break; | |
2972 case (FACE_SMILE): smiley_text = g_strndup(":-)", strlen(":-)")); break; | |
2973 case (FACE_SMILE8): smiley_text = g_strndup("8-)", strlen("8-)")); break; | |
2974 case (FACE_THINK): smiley_text = g_strndup(":-/", strlen(":-/")); break; | |
2975 case (FACE_TONGUE): smiley_text = g_strndup(":-p", strlen(":-p")); break; | |
2976 case (FACE_WINK): smiley_text = g_strndup(";-)", strlen(";-)")); break; | |
2977 case (FACE_YELL): smiley_text = g_strndup(">:o", strlen(">:o")); break; | |
2978 default: smiley_text = g_strndup(":-)", strlen(":-)")); break; | |
2979 } | |
2980 | |
2981 surround(c->entry, smiley_text, ""); | |
2982 | |
2983 g_free(smiley_text); | |
2984 | |
2985 close_smiley_dialog(NULL, c); | |
2986 | |
2987 return; | |
2988 } | |
579
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
2989 |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
2990 static void toolbar_add_smiley(struct conversation *c, GtkWidget *bar, char **xpm, GtkWidget *win, int face) |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
2991 { |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
2992 GtkWidget *tpm; |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
2993 GdkBitmap *mask; |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
2994 GdkPixmap *dpm; |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
2995 GtkWidget *button; |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
2996 |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
2997 dpm = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, xpm); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
2998 tpm = gtk_pixmap_new(dpm, mask); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
2999 gtk_widget_show(tpm); |
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
619
diff
changeset
|
3000 gdk_pixmap_unref(dpm); |
579
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3001 button = gtk_toolbar_append_element(GTK_TOOLBAR(bar), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, NULL, NULL, tpm, GTK_SIGNAL_FUNC(set_smiley_array), (int *)face); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3002 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3003 |
605 | 3004 /* these look really weird with borders */ |
3005 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | |
579
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3006 } |
555 | 3007 |
3008 void show_smiley_dialog(struct conversation *c, GtkWidget *widget) | |
3009 { | |
3010 GtkWidget *dialog; | |
584 | 3011 GtkWidget *vbox, *smiley_box_1, *smiley_box_2, *smiley_box_3, *smiley_box_4; |
555 | 3012 GtkWidget *win; |
582 | 3013 GtkWidget *bbox; |
555 | 3014 |
3015 if (c->smiley_dialog) | |
558
f1b8f03db83f
[gaim-migrate @ 568]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
555
diff
changeset
|
3016 return; |
579
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3017 |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3018 win = c->window; |
555 | 3019 |
579
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3020 dialog = gtk_window_new(GTK_WINDOW_DIALOG); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3021 gtk_window_set_policy(GTK_WINDOW(dialog), 0, 0, 1); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3022 |
555 | 3023 /* setup boxes */ |
582 | 3024 vbox = gtk_vbox_new(TRUE, 5); |
3025 bbox = gtk_hbox_new(FALSE, 5); | |
3026 | |
555 | 3027 smiley_box_1 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS); |
3028 smiley_box_2 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS); | |
579
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3029 smiley_box_3 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3030 smiley_box_4 = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS); |
555 | 3031 |
3032 /* setup buttons */ | |
3033 | |
3034 /* pack buttons */ | |
579
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3035 toolbar_add_smiley(c, smiley_box_1, angel_xpm, win, FACE_ANGEL); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3036 toolbar_add_smiley(c, smiley_box_1, bigsmile_xpm, win, FACE_BIGSMILE); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3037 toolbar_add_smiley(c, smiley_box_1, burp_xpm, win, FACE_BURP); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3038 toolbar_add_smiley(c, smiley_box_1, crossedlips_xpm, win, FACE_CROSSEDLIPS); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3039 |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3040 toolbar_add_smiley(c, smiley_box_2, cry_xpm, win, FACE_CRY); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3041 toolbar_add_smiley(c, smiley_box_2, embarrassed_xpm, win, FACE_EMBARRASSED); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3042 toolbar_add_smiley(c, smiley_box_2, kiss_xpm, win, FACE_KISS); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3043 toolbar_add_smiley(c, smiley_box_2, moneymouth_xpm, win, FACE_MONEYMOUTH); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3044 |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3045 toolbar_add_smiley(c, smiley_box_3, sad_xpm, win, FACE_SAD); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3046 toolbar_add_smiley(c, smiley_box_3, scream_xpm, win, FACE_SCREAM); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3047 toolbar_add_smiley(c, smiley_box_3, smile_xpm, win, FACE_SMILE); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3048 toolbar_add_smiley(c, smiley_box_3, smile8_xpm, win, FACE_SMILE8); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3049 |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3050 toolbar_add_smiley(c, smiley_box_4, think_xpm, win, FACE_THINK); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3051 toolbar_add_smiley(c, smiley_box_4, tongue_xpm, win, FACE_TONGUE); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3052 toolbar_add_smiley(c, smiley_box_4, wink_xpm, win, FACE_WINK); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3053 toolbar_add_smiley(c, smiley_box_4, yell_xpm, win, FACE_YELL); |
555 | 3054 |
3055 /* pack containers */ | |
3056 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_1, TRUE, TRUE, 0); | |
3057 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_2, TRUE, TRUE, 0); | |
579
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3058 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_3, TRUE, TRUE, 0); |
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3059 gtk_box_pack_start(GTK_BOX(vbox), smiley_box_4, TRUE, TRUE, 0); |
582 | 3060 |
3061 gtk_container_add(GTK_CONTAINER(dialog), vbox); | |
579
7b501c39a6ee
[gaim-migrate @ 589]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
577
diff
changeset
|
3062 gtk_container_set_border_width(GTK_CONTAINER(dialog), 5); |
555 | 3063 |
605 | 3064 /* connect signals */ |
3065 gtk_object_set_user_data(GTK_OBJECT(dialog), "smiley dialog"); | |
3066 gtk_signal_connect(GTK_OBJECT(dialog), "delete_event", GTK_SIGNAL_FUNC(delete_event_dialog), c); | |
3067 | |
555 | 3068 /* show everything */ |
567
102afb84ce45
[gaim-migrate @ 577]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
558
diff
changeset
|
3069 gtk_window_set_title(GTK_WINDOW(dialog), _("Smile!")); |
584 | 3070 gtk_widget_show_all(dialog); |
555 | 3071 |
3072 c->smiley_dialog = dialog; | |
584 | 3073 |
555 | 3074 return; |
558
f1b8f03db83f
[gaim-migrate @ 568]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
555
diff
changeset
|
3075 } |