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