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