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