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