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