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