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