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