Mercurial > pidgin.yaz
annotate src/buddy_chat.c @ 931:59d9e1177ab5
[gaim-migrate @ 941]
yay! let's recompile everything, again!
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 20 Sep 2000 23:35:17 +0000 |
parents | 378c862a2381 |
children | fa681641643d |
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:
344
diff
changeset
|
22 #ifdef HAVE_CONFIG_H |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
344
diff
changeset
|
23 #include "../config.h" |
b402a23f35df
[gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
344
diff
changeset
|
24 #endif |
1 | 25 #include <string.h> |
26 #include <sys/time.h> | |
27 #include <unistd.h> | |
28 #include <stdio.h> | |
29 #include <stdlib.h> | |
30 #include <gtk/gtk.h> | |
31 #include "gtkhtml.h" | |
300
b32c83750104
[gaim-migrate @ 310]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
226
diff
changeset
|
32 #include <gdk/gdkkeysyms.h> |
1 | 33 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
34 #include "convo.h" |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
35 |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
36 #include "pixmaps/tb_forward.xpm" |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
37 #include "pixmaps/join.xpm" |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
38 #include "pixmaps/close.xpm" |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
535
diff
changeset
|
39 |
1 | 40 static GtkWidget *joinchat; |
41 static GtkWidget *entry; | |
42 static GtkWidget *invite; | |
43 static GtkWidget *inviteentry; | |
44 static GtkWidget *invitemess; | |
692
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
45 static int community; |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
46 extern int state_lock; |
1 | 47 |
48 static void destroy_join_chat() | |
49 { | |
50 if (joinchat) | |
51 gtk_widget_destroy(joinchat); | |
52 joinchat=NULL; | |
53 } | |
54 | |
55 static void destroy_invite() | |
56 { | |
57 if (invite) | |
58 gtk_widget_destroy(invite); | |
59 invite=NULL; | |
60 } | |
61 | |
62 | |
694
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
63 struct conversation *find_chat(char *name) |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
64 { |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
65 char cuser[64]; |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
66 struct conversation *c = NULL; |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
67 GList *cnv = buddy_chats; |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
68 |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
69 strcpy(cuser, normalize(name)); |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
70 |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
71 while (cnv) { |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
72 c = (struct conversation *)cnv->data; |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
73 if (!strcasecmp(cuser, normalize(c->name))) { |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
74 return c; |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
75 } |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
76 cnv = cnv->next; |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
77 } |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
78 return NULL; |
150214f1d48b
[gaim-migrate @ 704]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
692
diff
changeset
|
79 } |
1 | 80 |
81 | |
82 static void do_join_chat() | |
83 { | |
84 char *group; | |
85 | |
86 group = gtk_entry_get_text(GTK_ENTRY(entry)); | |
87 | |
88 if (joinchat) { | |
692
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
89 serv_join_chat(community + 4, group); |
1 | 90 gtk_widget_destroy(joinchat); |
91 } | |
92 joinchat=NULL; | |
93 } | |
94 | |
95 | |
96 | |
97 void join_chat() | |
98 { | |
99 GtkWidget *cancel; | |
100 GtkWidget *join; | |
101 GtkWidget *label; | |
102 GtkWidget *bbox; | |
103 GtkWidget *vbox; | |
104 GtkWidget *topbox; | |
457 | 105 GtkWidget *frame; |
692
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
106 GtkWidget *opt; |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
107 GtkWidget *hbox; |
456 | 108 |
1 | 109 if (!joinchat) { |
457 | 110 joinchat = gtk_window_new(GTK_WINDOW_DIALOG); |
905 | 111 gtk_window_set_wmclass(GTK_WINDOW(joinchat), "joinchat", |
112 "Gaim"); | |
457 | 113 gtk_window_set_policy(GTK_WINDOW(joinchat), FALSE, FALSE, TRUE); |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
114 gtk_widget_realize(joinchat); |
1 | 115 bbox = gtk_hbox_new(TRUE, 10); |
116 topbox = gtk_hbox_new(FALSE, 5); | |
117 vbox = gtk_vbox_new(FALSE, 5); | |
118 entry = gtk_entry_new(); | |
692
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
119 hbox = gtk_hbox_new(TRUE, 10); |
1 | 120 |
457 | 121 frame = gtk_frame_new(_("Buddy Chat")); |
456 | 122 |
692
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
123 join = picture_button(joinchat, _("Join"), join_xpm); |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
124 cancel = picture_button(joinchat, _("Cancel"), cancel_xpm); |
456 | 125 |
692
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
126 gtk_box_pack_start(GTK_BOX(bbox), join, FALSE, FALSE, 5); |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
127 gtk_box_pack_end(GTK_BOX(bbox), cancel, FALSE, FALSE, 5); |
456 | 128 |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
129 label = gtk_label_new(_("Join what group:")); |
1 | 130 gtk_widget_show(label); |
131 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); | |
132 gtk_box_pack_start(GTK_BOX(topbox), entry, FALSE, FALSE, 5); | |
692
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
133 |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
134 opt = gtk_radio_button_new_with_label(NULL, |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
135 _("AIM Private Chats")); |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
136 gtk_box_pack_start(GTK_BOX(hbox), opt, FALSE, FALSE, 0); |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
137 community = 0; |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
138 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
139 gtk_signal_connect(GTK_OBJECT(opt), "clicked", set_option, &community); |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
140 gtk_widget_show(opt); |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
141 |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
142 opt = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(opt)), |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
143 _("AOL Community Chats")); |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
144 gtk_box_pack_start(GTK_BOX(hbox), opt, FALSE, FALSE, 0); |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
145 gtk_widget_show(opt); |
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
146 |
1 | 147 /* And the boxes in the box */ |
148 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5); | |
692
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
149 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 5); |
457 | 150 gtk_box_pack_start(GTK_BOX(vbox), bbox, TRUE, TRUE, 5); |
1 | 151 |
152 /* Handle closes right */ | |
153 gtk_signal_connect(GTK_OBJECT(joinchat), "delete_event", | |
154 GTK_SIGNAL_FUNC(destroy_join_chat), joinchat); | |
155 | |
156 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", | |
157 GTK_SIGNAL_FUNC(destroy_join_chat), joinchat); | |
158 gtk_signal_connect(GTK_OBJECT(join), "clicked", | |
159 GTK_SIGNAL_FUNC(do_join_chat), joinchat); | |
160 gtk_signal_connect(GTK_OBJECT(entry), "activate", | |
161 GTK_SIGNAL_FUNC(do_join_chat), joinchat); | |
162 /* Finish up */ | |
163 gtk_widget_show(join); | |
164 gtk_widget_show(cancel); | |
165 gtk_widget_show(entry); | |
166 gtk_widget_show(topbox); | |
692
f4026275bc9f
[gaim-migrate @ 702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
167 gtk_widget_show(hbox); |
1 | 168 gtk_widget_show(bbox); |
169 gtk_widget_show(vbox); | |
457 | 170 gtk_widget_show(frame); |
171 gtk_container_add(GTK_CONTAINER(frame), vbox); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
172 gtk_window_set_title(GTK_WINDOW(joinchat), _("Join Chat")); |
1 | 173 gtk_window_set_focus(GTK_WINDOW(joinchat), entry); |
457 | 174 gtk_container_add(GTK_CONTAINER(joinchat), frame); |
175 gtk_container_set_border_width(GTK_CONTAINER(joinchat), 5); | |
1 | 176 gtk_widget_realize(joinchat); |
177 aol_icon(joinchat->window); | |
178 | |
179 } | |
180 gtk_widget_show(joinchat); | |
181 } | |
182 | |
183 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
184 static void do_invite(GtkWidget *w, struct conversation *b) |
1 | 185 { |
186 char *buddy; | |
187 char *mess; | |
188 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
189 if (!b->is_chat) { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
190 debug_print("do_invite: expecting chat, got IM\n"); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
191 return; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
192 } |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
193 |
1 | 194 buddy = gtk_entry_get_text(GTK_ENTRY(inviteentry)); |
195 mess = gtk_entry_get_text(GTK_ENTRY(invitemess)); | |
196 | |
197 if (invite) { | |
198 serv_chat_invite(b->id, mess, buddy); | |
199 gtk_widget_destroy(invite); | |
200 } | |
201 invite=NULL; | |
202 } | |
203 | |
204 | |
205 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
206 void invite_callback(GtkWidget *w, struct conversation *b) |
1 | 207 { |
208 GtkWidget *cancel; | |
209 GtkWidget *invite_btn; | |
210 GtkWidget *label; | |
211 GtkWidget *bbox; | |
212 GtkWidget *vbox; | |
213 GtkWidget *topbox; | |
214 if (!invite) { | |
215 invite = gtk_window_new(GTK_WINDOW_DIALOG); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
216 cancel = gtk_button_new_with_label(_("Cancel")); |
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
217 invite_btn = gtk_button_new_with_label(_("Invite")); |
1 | 218 bbox = gtk_hbox_new(TRUE, 10); |
219 topbox = gtk_hbox_new(FALSE, 5); | |
220 vbox = gtk_vbox_new(FALSE, 5); | |
221 inviteentry = gtk_entry_new(); | |
222 invitemess = gtk_entry_new(); | |
223 | |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
224 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
225 { |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
226 gtk_button_set_relief(GTK_BUTTON(cancel), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
227 gtk_button_set_relief(GTK_BUTTON(invite_btn), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
228 } |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
229 |
1 | 230 /* Put the buttons in the box */ |
231 gtk_box_pack_start(GTK_BOX(bbox), invite_btn, TRUE, TRUE, 10); | |
232 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 10); | |
233 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
234 label = gtk_label_new(_("Invite who?")); |
1 | 235 gtk_widget_show(label); |
236 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); | |
237 gtk_box_pack_start(GTK_BOX(topbox), inviteentry, FALSE, FALSE, 5); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
238 label = gtk_label_new(_("With message:")); |
1 | 239 gtk_widget_show(label); |
240 gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5); | |
241 gtk_box_pack_start(GTK_BOX(topbox), invitemess, FALSE, FALSE, 5); | |
242 | |
243 /* And the boxes in the box */ | |
244 gtk_box_pack_start(GTK_BOX(vbox), topbox, TRUE, TRUE, 5); | |
245 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); | |
246 | |
247 /* Handle closes right */ | |
248 gtk_signal_connect(GTK_OBJECT(invite), "delete_event", | |
249 GTK_SIGNAL_FUNC(destroy_invite), invite); | |
250 | |
251 gtk_signal_connect(GTK_OBJECT(cancel), "clicked", | |
252 GTK_SIGNAL_FUNC(destroy_invite), b); | |
253 gtk_signal_connect(GTK_OBJECT(invite_btn), "clicked", | |
254 GTK_SIGNAL_FUNC(do_invite), b); | |
255 gtk_signal_connect(GTK_OBJECT(inviteentry), "activate", | |
256 GTK_SIGNAL_FUNC(do_invite), b); | |
257 /* Finish up */ | |
258 gtk_widget_show(invite_btn); | |
259 gtk_widget_show(cancel); | |
260 gtk_widget_show(inviteentry); | |
261 gtk_widget_show(invitemess); | |
262 gtk_widget_show(topbox); | |
263 gtk_widget_show(bbox); | |
264 gtk_widget_show(vbox); | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
265 gtk_window_set_title(GTK_WINDOW(invite), _("Invite to Buddy Chat")); |
1 | 266 gtk_window_set_focus(GTK_WINDOW(invite), inviteentry); |
267 gtk_container_add(GTK_CONTAINER(invite), vbox); | |
268 gtk_widget_realize(invite); | |
269 aol_icon(invite->window); | |
270 | |
271 } | |
272 gtk_widget_show(invite); | |
273 } | |
274 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
275 gboolean meify(char *message) { |
415
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
276 /* read /me-ify : if the message (post-HTML) starts with /me, remove |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
277 * the "/me " part of it (including that space) and return TRUE */ |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
278 char *c = message; |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
279 int inside_HTML = 0; /* i really don't like descriptive names */ |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
280 if (!c) return FALSE; /* um... this would be very bad if this happens */ |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
281 while (*c) { |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
282 if (inside_HTML) { |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
283 if (*c == '>') inside_HTML = 0; |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
284 } else { |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
285 if (*c == '<') inside_HTML = 1; |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
286 else break; |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
287 } |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
288 c++; /* i really don't like c++ either */ |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
289 } |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
290 /* k, so now we've gotten past all the HTML crap. */ |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
291 if (!*c) return FALSE; |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
292 if (!strncmp(c, "/me ", 4)) { |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
293 sprintf(c, "%s", c+4); |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
294 return TRUE; |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
295 } else |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
296 return FALSE; |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
297 } |
a266fd221c3c
[gaim-migrate @ 425]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
298 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
299 void chat_write(struct conversation *b, char *who, int flag, char *message) |
1 | 300 { |
301 GList *ignore = b->ignored; | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
302 char *str; |
1 | 303 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
304 if (!b->is_chat) { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
305 debug_print("chat_write: expecting chat, got IM\n"); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
306 return; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
307 } |
1 | 308 |
309 while(ignore) { | |
310 if (!strcasecmp(who, ignore->data)) | |
311 return; | |
312 ignore = ignore->next; | |
313 } | |
371
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
314 |
1 | 315 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
316 if (!(flag & WFLAG_WHISPER)) { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
317 str = g_strdup(normalize(who)); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
318 if (!strcasecmp(str, normalize(current_user->username))) { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
319 sprintf(debug_buff, "%s %s\n", normalize(who), normalize(current_user->username)); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
320 debug_print(debug_buff); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
321 if (b->makesound && (sound_options & OPT_SOUND_CHAT_SAY)) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
322 play_sound(SEND); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
323 flag |= WFLAG_SEND; |
371
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
324 } else { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
325 if (b->makesound && (sound_options & OPT_SOUND_CHAT_SAY)) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
326 play_sound(RECEIVE); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
327 flag |= WFLAG_RECV; |
371
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
328 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
329 g_free(str); |
1 | 330 } |
331 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
332 write_to_conv(b, message, flag, who); |
1 | 333 } |
334 | |
335 | |
368
9bf1f77985d2
[gaim-migrate @ 378]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
363
diff
changeset
|
336 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
337 void whisper_callback(GtkWidget *widget, struct conversation *b) |
1 | 338 { |
79 | 339 char buf[BUF_LEN*4]; |
1 | 340 char buf2[BUF_LONG]; |
341 GList *selected; | |
342 char *who; | |
343 | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
300
diff
changeset
|
344 strncpy(buf, gtk_editable_get_chars(GTK_EDITABLE(b->entry), 0, -1), sizeof(buf)/2); |
1 | 345 if (!strlen(buf)) |
346 return; | |
347 | |
348 selected = GTK_LIST(b->list)->selection; | |
349 | |
350 if (!selected) | |
351 return; | |
352 | |
353 | |
354 who = GTK_LABEL(gtk_container_children(GTK_CONTAINER(selected->data))->data)->label; | |
355 | |
356 if (!who) | |
357 return; | |
358 | |
338
9d258a0aa560
[gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
300
diff
changeset
|
359 gtk_editable_delete_text(GTK_EDITABLE(b->entry), 0, -1); |
1 | 360 |
361 escape_text(buf); | |
362 serv_chat_whisper(b->id, who, buf); | |
363 | |
364 g_snprintf(buf2, sizeof(buf2), "%s->%s", current_user->username, who); | |
365 | |
366 chat_write(b, buf2, WFLAG_WHISPER, buf); | |
367 | |
368 gtk_widget_grab_focus(GTK_WIDGET(b->entry)); | |
369 | |
370 | |
371 } | |
372 | |
373 | |
374 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
375 void update_chat_list(struct conversation *b) |
1 | 376 { |
377 GtkWidget *list_item; | |
378 char name[80]; | |
379 char *tmp; | |
380 GList *names = b->in_room; | |
381 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
382 if (!b->is_chat) { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
383 debug_print("update_chat_list: expecting chat, got IM\n"); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
384 return; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
385 } |
1 | 386 |
387 gtk_list_clear_items(GTK_LIST(b->list), 0, -1); | |
388 | |
389 | |
390 while(names) { | |
391 tmp = (char *)names->data; | |
392 if (g_list_index(b->ignored, names->data) != -1) | |
393 g_snprintf(name, sizeof(name), "X %s", tmp); | |
394 else | |
395 g_snprintf(name, sizeof(name), "%s", tmp); | |
396 | |
397 list_item = gtk_list_item_new_with_label(name); | |
398 gtk_widget_show(list_item); | |
399 gtk_object_set_user_data(GTK_OBJECT(list_item), tmp); | |
400 | |
401 gtk_list_append_items(GTK_LIST(b->list), g_list_append(NULL, list_item)); | |
402 | |
403 names = names->next; | |
404 } | |
405 | |
406 } | |
407 | |
408 | |
409 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
410 void add_chat_buddy(struct conversation *b, char *buddy) |
1 | 411 { |
412 char *name = g_strdup(buddy); | |
612
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
413 char tmp[BUF_LONG]; |
1 | 414 |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
716
diff
changeset
|
415 plugin_event(event_chat_buddy_join, b->name, name, 0); |
1 | 416 b->in_room = g_list_append(b->in_room, name); |
417 | |
418 update_chat_list(b); | |
419 | |
371
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
420 if (b->makesound && (sound_options & OPT_SOUND_CHAT_JOIN)) |
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
421 play_sound(BUDDY_ARRIVE); |
612
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
422 |
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
423 if (display_options & OPT_DISP_CHAT_LOGON) { |
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
424 g_snprintf(tmp, sizeof(tmp), _("<B>%s entered the room.</B>"), name); |
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
425 write_to_conv(b, tmp, WFLAG_SYSTEM, NULL); |
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
426 } |
1 | 427 } |
428 | |
429 | |
430 | |
431 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
432 void remove_chat_buddy(struct conversation *b, char *buddy) |
1 | 433 { |
434 GList *names = b->in_room; | |
612
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
435 char tmp[BUF_LONG]; |
1 | 436 |
780
c714def9cebb
[gaim-migrate @ 790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
716
diff
changeset
|
437 plugin_event(event_chat_buddy_leave, b->name, buddy, 0); |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
375
diff
changeset
|
438 |
1 | 439 while(names) { |
440 if (!strcasecmp((char *)names->data, buddy)) { | |
441 b->in_room = g_list_remove(b->in_room, names->data); | |
442 update_chat_list(b); | |
443 break; | |
444 } | |
445 names = names->next; | |
446 } | |
371
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
447 |
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
448 if (b->makesound && (sound_options & OPT_SOUND_CHAT_JOIN)) |
9d22acf6db73
[gaim-migrate @ 381]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
368
diff
changeset
|
449 play_sound(BUDDY_LEAVE); |
612
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
450 |
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
451 if (display_options & OPT_DISP_CHAT_LOGON) { |
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
452 g_snprintf(tmp, sizeof(tmp), _("<B>%s left the room.</B>"), buddy); |
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
453 write_to_conv(b, tmp, WFLAG_SYSTEM, NULL); |
12bb64b42ad1
[gaim-migrate @ 622]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
604
diff
changeset
|
454 } |
1 | 455 } |
456 | |
457 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
458 void im_callback(GtkWidget *w, struct conversation *b) |
1 | 459 { |
460 char *name; | |
461 GList *i; | |
462 struct conversation *c; | |
463 | |
464 i = GTK_LIST(b->list)->selection; | |
465 if (i) | |
466 name = (char *)gtk_object_get_user_data(GTK_OBJECT(i->data)); | |
467 else | |
468 return; | |
469 | |
470 c = find_conversation(name); | |
471 | |
472 if (c != NULL) { | |
473 gdk_window_raise(c->window->window); | |
474 } else { | |
475 c = new_conversation(name); | |
476 } | |
477 | |
478 | |
479 } | |
480 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
481 void ignore_callback(GtkWidget *w, struct conversation *b) |
1 | 482 { |
483 char *name; | |
484 GList *i; | |
485 | |
486 i = GTK_LIST(b->list)->selection; | |
487 if (i) | |
488 name = (char *)gtk_object_get_user_data(GTK_OBJECT(i->data)); | |
489 else | |
490 return; | |
491 | |
492 if (g_list_index(b->ignored, (gpointer)name) == -1) | |
493 b->ignored = g_list_append(b->ignored, name); | |
494 else | |
495 b->ignored = g_list_remove(b->ignored, name); | |
496 | |
497 update_chat_list(b); | |
498 } | |
499 | |
500 | |
501 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
502 void show_new_buddy_chat(struct conversation *b) |
1 | 503 { |
504 GtkWidget *win; | |
505 GtkWidget *text; | |
506 GtkWidget *send; | |
507 GtkWidget *list; | |
508 GtkWidget *invite_btn; | |
509 GtkWidget *whisper; | |
510 GtkWidget *close; | |
511 GtkWidget *chatentry; | |
512 GtkWidget *lbox; | |
513 GtkWidget *bbox; | |
514 GtkWidget *bbox2; | |
515 GtkWidget *im, *ignore, *info; | |
516 GtkWidget *sw; | |
517 GtkWidget *sw2; | |
518 GtkWidget *vbox; | |
223 | 519 GtkWidget *vpaned; |
520 GtkWidget *hpaned; | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
521 GtkWidget *toolbar; |
844 | 522 |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
523 int dispstyle; |
1 | 524 |
525 win = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
526 b->window = win; | |
905 | 527 gtk_window_set_wmclass(GTK_WINDOW(win), "buddy_chat", "Gaim"); |
1 | 528 |
223 | 529 vpaned = gtk_vpaned_new(); |
530 hpaned = gtk_hpaned_new(); | |
531 | |
26 | 532 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
533 gtk_widget_realize(win); |
26 | 534 |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
535 dispstyle = set_dispstyle(1); |
1 | 536 |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
537 close = picture_button2(win, _("Close"), cancel_xpm, dispstyle); |
844 | 538 |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
539 invite_btn = picture_button2(win, _("Invite"), join_xpm, dispstyle); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
540 whisper = picture_button2(win, _("Whisper"), tb_forward_xpm, dispstyle); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
541 send = picture_button2(win, _("Send"), tmp_send_xpm, dispstyle); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
542 |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
543 im = picture_button2(win, _("IM"), tmp_send_xpm, FALSE); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
544 ignore = picture_button2(win, _("Ignore"), close_xpm, FALSE); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
545 info = picture_button2(win, _("Info"), tb_search_xpm, FALSE); |
1 | 546 |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
547 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
548 { |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
549 gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
550 gtk_button_set_relief(GTK_BUTTON(invite_btn), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
551 gtk_button_set_relief(GTK_BUTTON(whisper), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
552 gtk_button_set_relief(GTK_BUTTON(send), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
553 gtk_button_set_relief(GTK_BUTTON(im), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
554 gtk_button_set_relief(GTK_BUTTON(ignore), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
555 gtk_button_set_relief(GTK_BUTTON(info), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
556 } |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
485
diff
changeset
|
557 |
1 | 558 text = gtk_html_new(NULL, NULL); |
559 | |
560 b->text = text; | |
561 | |
562 list = gtk_list_new(); | |
563 b->list = list; | |
564 | |
844 | 565 bbox = gtk_hbox_new(FALSE, 5); |
1 | 566 bbox2 = gtk_hbox_new(TRUE, 0); |
567 vbox = gtk_vbox_new(FALSE, 0); | |
568 lbox = gtk_vbox_new(FALSE, 4); | |
646
83c773b5b6dc
[gaim-migrate @ 656]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
615
diff
changeset
|
569 |
223 | 570 chatentry = gtk_text_new( NULL, NULL ); |
571 gtk_text_set_editable(GTK_TEXT(chatentry), TRUE); | |
572 gtk_text_set_word_wrap(GTK_TEXT(chatentry), TRUE); | |
646
83c773b5b6dc
[gaim-migrate @ 656]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
615
diff
changeset
|
573 gtk_object_set_user_data(GTK_OBJECT(chatentry), b); |
83c773b5b6dc
[gaim-migrate @ 656]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
615
diff
changeset
|
574 b->entry = chatentry; |
1 | 575 |
576 gtk_widget_realize(win); | |
577 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
578 toolbar = build_conv_toolbar(b); |
1 | 579 |
580 /* Hack something so we know have an entry click event */ | |
581 | |
582 gtk_signal_connect(GTK_OBJECT(chatentry), "activate", GTK_SIGNAL_FUNC(send_callback),b); | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
457
diff
changeset
|
583 gtk_signal_connect(GTK_OBJECT(chatentry), "key_press_event", GTK_SIGNAL_FUNC(keypress_callback), b); |
1 | 584 /* Text box */ |
585 | |
586 sw = gtk_scrolled_window_new (NULL, NULL); | |
587 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), | |
588 GTK_POLICY_NEVER, | |
589 GTK_POLICY_ALWAYS); | |
590 gtk_widget_show(sw); | |
591 gtk_container_add(GTK_CONTAINER(sw), text); | |
592 gtk_widget_show(text); | |
593 | |
594 | |
595 GTK_HTML (text)->hadj->step_increment = 10.0; | |
596 GTK_HTML (text)->vadj->step_increment = 10.0; | |
597 gtk_widget_set_usize(sw, 320, 150); | |
598 | |
223 | 599 gtk_paned_pack1(GTK_PANED(hpaned), sw, TRUE, TRUE); |
1 | 600 |
601 sw2 = gtk_scrolled_window_new(NULL, NULL); | |
602 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw2), | |
603 GTK_POLICY_NEVER, | |
604 GTK_POLICY_AUTOMATIC); | |
605 gtk_widget_show(sw2); | |
606 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(sw2), list); | |
607 | |
608 gtk_box_pack_start(GTK_BOX(lbox), sw2, TRUE, TRUE, 0); | |
226 | 609 gtk_box_pack_start(GTK_BOX(lbox), bbox2, FALSE, FALSE, 5); |
1 | 610 |
611 | |
223 | 612 gtk_paned_pack2(GTK_PANED(hpaned), lbox, TRUE, TRUE); |
1 | 613 gtk_widget_show(list); |
614 | |
615 | |
616 gtk_widget_set_usize(list, 150, 150); | |
617 | |
618 | |
619 /* Ready and pack buttons */ | |
620 gtk_object_set_user_data(GTK_OBJECT(win), b); | |
621 gtk_object_set_user_data(GTK_OBJECT(close), b); | |
622 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(close_callback),b); | |
623 gtk_signal_connect(GTK_OBJECT(send), "clicked", GTK_SIGNAL_FUNC(send_callback),b); | |
624 gtk_signal_connect(GTK_OBJECT(invite_btn), "clicked", GTK_SIGNAL_FUNC(invite_callback), b); | |
625 gtk_signal_connect(GTK_OBJECT(whisper), "clicked", GTK_SIGNAL_FUNC(whisper_callback), b); | |
626 | |
627 gtk_signal_connect(GTK_OBJECT(im), "clicked", GTK_SIGNAL_FUNC(im_callback), b); | |
628 gtk_signal_connect(GTK_OBJECT(ignore), "clicked", GTK_SIGNAL_FUNC(ignore_callback), b); | |
629 gtk_signal_connect(GTK_OBJECT(info), "clicked", GTK_SIGNAL_FUNC(info_callback), b); | |
630 | |
631 | |
844 | 632 gtk_box_pack_end(GTK_BOX(bbox), close, dispstyle, dispstyle, 5); |
633 gtk_box_pack_end(GTK_BOX(bbox), invite_btn, dispstyle, dispstyle, 5); | |
634 gtk_box_pack_end(GTK_BOX(bbox), whisper, dispstyle, dispstyle, 5); | |
635 gtk_box_pack_end(GTK_BOX(bbox), send, dispstyle, dispstyle, 5); | |
636 | |
637 gtk_box_pack_start(GTK_BOX(bbox2), im, dispstyle, dispstyle, 5); | |
638 gtk_box_pack_start(GTK_BOX(bbox2), ignore, dispstyle, dispstyle, 5); | |
639 gtk_box_pack_start(GTK_BOX(bbox2), info, dispstyle, dispstyle, 5); | |
1 | 640 |
641 /* pack and fill the rest */ | |
642 | |
643 | |
223 | 644 gtk_paned_pack1(GTK_PANED(vpaned), hpaned, TRUE, FALSE); |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
338
diff
changeset
|
645 gtk_box_pack_start(GTK_BOX(vbox), toolbar, TRUE, TRUE, 5); |
223 | 646 gtk_box_pack_start(GTK_BOX(vbox), chatentry, TRUE, TRUE, 5); |
1 | 647 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 5); |
223 | 648 gtk_paned_pack2(GTK_PANED(vpaned), vbox, TRUE, FALSE); |
1 | 649 |
650 gtk_widget_show(send); | |
651 gtk_widget_show(invite_btn); | |
652 gtk_widget_show(whisper); | |
653 gtk_widget_show(close); | |
654 gtk_widget_show(im); | |
655 gtk_widget_show(ignore); | |
656 gtk_widget_show(info); | |
657 gtk_widget_show(bbox); | |
658 gtk_widget_show(lbox); | |
659 gtk_widget_show(bbox2); | |
660 gtk_widget_show(vbox); | |
223 | 661 gtk_widget_show( vpaned ); |
662 gtk_widget_show( hpaned ); | |
1 | 663 gtk_widget_show(chatentry); |
864 | 664 |
665 if (display_options & OPT_DISP_CHAT_BIG_ENTRY) | |
666 gtk_widget_set_usize(chatentry, 320, 50); | |
667 else | |
668 gtk_widget_set_usize(chatentry, 320, 25); | |
1 | 669 |
223 | 670 gtk_container_add(GTK_CONTAINER(win),vpaned); |
1 | 671 gtk_container_border_width(GTK_CONTAINER(win), 10); |
672 | |
673 gtk_window_set_title(GTK_WINDOW(win), b->name); | |
674 gtk_window_set_focus(GTK_WINDOW(win), chatentry); | |
675 | |
676 gtk_signal_connect(GTK_OBJECT(win), "destroy", GTK_SIGNAL_FUNC(close_callback),b); | |
907
08d5037c9296
[gaim-migrate @ 917]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
677 gtk_signal_connect(GTK_OBJECT(chatentry), "insert-text", GTK_SIGNAL_FUNC(check_spelling), chatentry); |
08d5037c9296
[gaim-migrate @ 917]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
678 gtk_signal_connect(GTK_OBJECT(chatentry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed), chatentry); |
1 | 679 |
716 | 680 b->font_dialog = NULL; |
858
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
845
diff
changeset
|
681 b->fg_color_dialog = NULL; |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
845
diff
changeset
|
682 b->bg_color_dialog = NULL; |
716 | 683 b->smiley_dialog = NULL; |
684 b->link_dialog = NULL; | |
685 b->log_dialog = NULL; | |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
686 b->send = send; |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
687 b->whisper = whisper; |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
688 b->invite = invite_btn; |
814
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
780
diff
changeset
|
689 b->close = close; |
716 | 690 sprintf(b->fontface, "%s", fontface); |
691 b->hasfont = 0; | |
692 b->bgcol = bgcolor; | |
693 b->hasbg = 0; | |
694 b->fgcol = fgcolor; | |
695 b->hasfg = 0; | |
696 | |
615 | 697 gtk_widget_realize(win); |
1 | 698 aol_icon(win->window); |
699 | |
700 gtk_widget_show(win); | |
701 } | |
702 | |
703 | |
704 | |
705 void handle_click_chat(GtkWidget *widget, GdkEventButton *event, struct chat_room *cr) | |
706 { | |
707 if (event->type == GDK_2BUTTON_PRESS && event->button == 1) { | |
708 serv_join_chat(cr->exchange, cr->name); | |
709 } | |
710 } | |
711 | |
712 | |
713 void setup_buddy_chats() | |
714 { | |
21 | 715 GList *list; |
1 | 716 struct chat_room *cr; |
717 GList *crs = chat_rooms; | |
718 GtkWidget *w; | |
719 GtkWidget *item; | |
720 GtkWidget *tree; | |
721 | |
21 | 722 if (buddies == NULL) |
723 return; | |
724 | |
725 list = GTK_TREE(buddies)->children; | |
726 | |
1 | 727 while(list) { |
728 w = (GtkWidget *)list->data; | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
729 if (!strcmp(GTK_LABEL(GTK_BIN(w)->child)->label, _("Buddy Chat"))) { |
1 | 730 gtk_tree_remove_items(GTK_TREE(buddies), list); |
731 list = GTK_TREE(buddies)->children; | |
732 if (!list) | |
733 break; | |
734 } | |
735 list = list->next; | |
736 } | |
737 | |
738 if (crs == NULL) | |
739 return; | |
740 | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
741 item = gtk_tree_item_new_with_label(_("Buddy Chat")); |
1 | 742 tree = gtk_tree_new(); |
743 gtk_widget_show(item); | |
744 gtk_widget_show(tree); | |
745 gtk_tree_append(GTK_TREE(buddies), item); | |
746 gtk_tree_item_set_subtree(GTK_TREE_ITEM(item), tree); | |
747 gtk_tree_item_expand(GTK_TREE_ITEM(item)); | |
748 | |
749 while (crs) { | |
750 cr = (struct chat_room *)crs->data; | |
751 | |
752 item = gtk_tree_item_new_with_label(cr->name); | |
753 gtk_object_set_user_data(GTK_OBJECT(item), cr); | |
754 gtk_tree_append(GTK_TREE(tree), item); | |
755 gtk_widget_show(item); | |
756 gtk_signal_connect(GTK_OBJECT(item), "button_press_event", | |
757 GTK_SIGNAL_FUNC(handle_click_chat), | |
758 cr); | |
759 | |
760 crs = crs->next; | |
761 | |
762 } | |
763 | |
764 } | |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
765 |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
766 static GtkWidget *change_text(GtkWidget *win, char *text, GtkWidget *button, char **xpm, int chat) |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
767 { |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
768 int dispstyle = set_dispstyle(chat); |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
769 GtkWidget *parent = button->parent; |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
770 gtk_widget_destroy(button); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
771 button = picture_button2(win, text, xpm, dispstyle); |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
772 if (chat == 1) |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
773 gtk_box_pack_start(GTK_BOX(parent), button, dispstyle, dispstyle, 5); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
774 else |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
775 gtk_box_pack_end(GTK_BOX(parent), button, dispstyle, dispstyle, 0); |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
776 gtk_widget_show(button); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
777 return button; |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
778 } |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
779 |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
780 void update_chat_button_pix() |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
781 { |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
782 GList *bcs = buddy_chats; |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
783 struct conversation *c; |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
784 int opt = 1; |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
785 |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
786 while (bcs) { |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
787 c = (struct conversation *)bcs->data; |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
788 c->send = change_text(c->window, _("Send"), c->send, tmp_send_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
789 c->whisper = change_text(c->window, _("Whisper"), c->whisper, tb_forward_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
790 c->invite = change_text(c->window, _("Invite"), c->invite, join_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
791 c->close = change_text(c->window, _("Close"), c->close, cancel_xpm, opt); |
834
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
792 gtk_object_set_user_data(GTK_OBJECT(c->close), c); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
793 gtk_signal_connect(GTK_OBJECT(c->close), "clicked", GTK_SIGNAL_FUNC(close_callback),c); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
794 gtk_signal_connect(GTK_OBJECT(c->send), "clicked", GTK_SIGNAL_FUNC(send_callback),c); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
795 gtk_signal_connect(GTK_OBJECT(c->invite), "clicked", GTK_SIGNAL_FUNC(invite_callback),c); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
796 gtk_signal_connect(GTK_OBJECT(c->whisper), "clicked", GTK_SIGNAL_FUNC(whisper_callback),c); |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
797 bcs = bcs->next; |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
798 } |
bac7089491c1
[gaim-migrate @ 844]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
823
diff
changeset
|
799 } |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
800 |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
801 void update_im_button_pix() |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
802 { |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
803 GList *bcs = conversations; |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
804 struct conversation *c; |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
805 GtkWidget *parent; |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
806 int opt = 0; |
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
807 int dispstyle = set_dispstyle(0); |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
808 |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
809 while (bcs) { |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
810 c = (struct conversation *)bcs->data; |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
811 parent = c->close->parent; |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
812 c->close = change_text(c->window, _("Close"), c->close, cancel_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
813 gtk_box_reorder_child(GTK_BOX(parent), c->close, 0); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
814 gtk_box_set_child_packing(GTK_BOX(parent), c->sep1, dispstyle, dispstyle, 0, GTK_PACK_END); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
815 if (find_buddy(c->name) == NULL) |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
816 c->add = change_text(c->window, _("Add"), c->add, gnome_add_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
817 else |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
818 c->add = change_text(c->window, _("Remove"), c->add, gnome_remove_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
819 gtk_box_reorder_child(GTK_BOX(parent), c->add, 2); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
820 c->block = change_text(c->window, _("Block"), c->block, block_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
821 gtk_box_reorder_child(GTK_BOX(parent), c->block, 3); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
822 c->warn = change_text(c->window, _("Warn"), c->warn, warn_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
823 gtk_box_reorder_child(GTK_BOX(parent), c->warn, 4); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
824 c->info = change_text(c->window, _("Info"), c->info, tb_search_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
825 gtk_box_reorder_child(GTK_BOX(parent), c->info, 5); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
826 c->send = change_text(c->window, _("Send"), c->send, tmp_send_xpm, opt); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
827 gtk_box_set_child_packing(GTK_BOX(parent), c->sep2, dispstyle, dispstyle, 0, GTK_PACK_END); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
828 gtk_box_reorder_child(GTK_BOX(parent), c->send, 7); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
829 gtk_object_set_user_data(GTK_OBJECT(c->close), c); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
830 gtk_signal_connect(GTK_OBJECT(c->close), "clicked", GTK_SIGNAL_FUNC(close_callback),c); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
831 gtk_signal_connect(GTK_OBJECT(c->send), "clicked", GTK_SIGNAL_FUNC(send_callback),c); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
832 gtk_signal_connect(GTK_OBJECT(c->add), "clicked", GTK_SIGNAL_FUNC(add_callback),c); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
833 gtk_signal_connect(GTK_OBJECT(c->info), "clicked", GTK_SIGNAL_FUNC(info_callback),c); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
834 gtk_signal_connect(GTK_OBJECT(c->warn), "clicked", GTK_SIGNAL_FUNC(warn_callback),c); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
835 gtk_signal_connect(GTK_OBJECT(c->block), "clicked", GTK_SIGNAL_FUNC(block_callback),c); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
836 bcs = bcs->next; |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
837 } |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
838 } |