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