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