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