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