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