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