Mercurial > pidgin.yaz
annotate src/conversation.c @ 1191:4fd0d35826fe
[gaim-migrate @ 1201]
thanks to decklin for this patch.
for some reason the logic in strcpy_withhtml looks funny to me. i'm sure it's just me though.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sun, 03 Dec 2000 09:50:39 +0000 |
parents | b1454d019277 |
children | 29b708cde8a7 |
rev | line source |
---|---|
66 | 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 |
66 | 25 #include <string.h> |
26 #include <sys/time.h> | |
27 #include <sys/types.h> | |
28 #include <sys/stat.h> | |
29 #include <unistd.h> | |
30 #include <stdio.h> | |
31 #include <stdlib.h> | |
210
ec0686b3b03f
[gaim-migrate @ 220]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
209
diff
changeset
|
32 #include <ctype.h> |
66 | 33 #include <gtk/gtk.h> |
34 #include "gtkhtml.h" | |
35 #include <gdk/gdkkeysyms.h> | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
36 #include "convo.h" |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
37 #include "gtkspell.h" |
337 | 38 |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
39 #include "pixmaps/underline.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
40 #include "pixmaps/bold.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
41 #include "pixmaps/italic.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
42 #include "pixmaps/small.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
43 #include "pixmaps/normal.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
44 #include "pixmaps/big.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
45 #include "pixmaps/fontface.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
46 #include "pixmaps/speaker.xpm" |
790 | 47 #include "pixmaps/smile_icon.xpm" |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
48 #include "pixmaps/wood.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
49 #include "pixmaps/link.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
50 #include "pixmaps/strike.xpm" |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
51 #include "pixmaps/fgcolor.xpm" |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
52 #include "pixmaps/bgcolor.xpm" |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
53 |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
54 #include "pixmaps/angel.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
55 #include "pixmaps/bigsmile.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
56 #include "pixmaps/burp.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
57 #include "pixmaps/crossedlips.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
58 #include "pixmaps/cry.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
59 #include "pixmaps/embarrassed.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
60 #include "pixmaps/kiss.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
61 #include "pixmaps/moneymouth.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
62 #include "pixmaps/sad.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
63 #include "pixmaps/scream.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
64 #include "pixmaps/smile.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
65 #include "pixmaps/smile8.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
66 #include "pixmaps/think.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
67 #include "pixmaps/tongue.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
68 #include "pixmaps/wink.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
69 #include "pixmaps/yell.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
70 #include "pixmaps/luke03.xpm" |
610
cadb51c068cb
[gaim-migrate @ 620]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
608
diff
changeset
|
71 #include "pixmaps/oneeye.xpm" |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
72 |
66 | 73 int state_lock=0; |
74 | |
75 GdkPixmap *dark_icon_pm = NULL; | |
76 GdkBitmap *dark_icon_bm = NULL; | |
77 | |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
78 char fontface[64]; |
885
db5f5c33e83f
[gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
876
diff
changeset
|
79 extern GdkColor bgcolor; |
db5f5c33e83f
[gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
876
diff
changeset
|
80 extern GdkColor fgcolor; |
66 | 81 |
82 void check_everything(GtkWidget *entry); | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
83 gboolean keypress_callback(GtkWidget *entry, GdkEventKey *event, struct conversation *c); |
66 | 84 |
85 /*------------------------------------------------------------------------*/ | |
86 /* Helpers */ | |
87 /*------------------------------------------------------------------------*/ | |
88 | |
89 | |
90 void quiet_set(GtkWidget *tb, int state) | |
91 { | |
92 state_lock=1; | |
93 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(tb), state); | |
94 state_lock=0; | |
95 } | |
96 | |
97 | |
98 void set_state_lock(int i) | |
99 { | |
100 state_lock = i; | |
101 } | |
102 | |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
103 void toggle_sensitive(GtkWidget *widget, GtkWidget *to_toggle) |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
104 { |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
105 gboolean sensitivity = GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(to_toggle)); |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
106 |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
107 if (sensitivity == TRUE) |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
108 gtk_widget_set_sensitive(GTK_WIDGET(to_toggle), FALSE); |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
109 else |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
110 gtk_widget_set_sensitive(GTK_WIDGET(to_toggle), TRUE); |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
111 |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
112 return; |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
113 } |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
114 |
66 | 115 struct conversation *new_conversation(char *name) |
116 { | |
117 struct conversation *c; | |
118 | |
119 c = find_conversation(name); | |
120 | |
121 if (c != NULL) | |
122 return c; | |
123 | |
124 c = (struct conversation *)g_new0(struct conversation, 1); | |
125 g_snprintf(c->name, sizeof(c->name), "%s", name); | |
126 | |
127 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) { | |
128 FILE *fd; | |
70 | 129 |
373
1d29321843b0
[gaim-migrate @ 383]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
363
diff
changeset
|
130 fd = open_log_file(c->name); |
1034
1d43fda97960
[gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
131 if (fd > 0) { |
1d43fda97960
[gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
132 if (!(general_options & OPT_GEN_STRIP_HTML)) |
1d43fda97960
[gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
133 fprintf(fd, "<HR><BR><H3 Align=Center> ---- New Conversation @ %s ----</H3><BR>\n", full_date()); |
1d43fda97960
[gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
134 else |
1d43fda97960
[gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
135 fprintf(fd, " ---- New Conversation @ %s ----\n", full_date()); |
1d43fda97960
[gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
136 fclose(fd); |
1d43fda97960
[gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
137 } else |
1d43fda97960
[gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
138 /* do we want to do something here? */ ; |
66 | 139 } |
140 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
141 if (connections) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
142 c->gc = (struct gaim_connection *)connections->data; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
143 show_conv(c); |
66 | 144 conversations = g_list_append(conversations, c); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
145 plugin_event(event_new_conversation, name, 0, 0, 0); |
66 | 146 return c; |
147 } | |
148 | |
149 | |
150 struct conversation *find_conversation(char *name) | |
151 { | |
152 char *cuser = g_malloc(64); | |
153 struct conversation *c; | |
154 GList *cnv = conversations; | |
155 | |
156 strcpy(cuser, normalize(name)); | |
157 | |
158 while(cnv) { | |
159 c = (struct conversation *)cnv->data; | |
160 if(!strcasecmp(cuser, normalize(c->name))) { | |
161 g_free(cuser); | |
162 return c; | |
163 } | |
164 cnv = cnv->next; | |
165 } | |
166 g_free(cuser); | |
167 return NULL; | |
168 } | |
169 | |
170 /* --------------------------------------------------- | |
171 * Function to remove a log file entry | |
172 * --------------------------------------------------- | |
173 */ | |
174 | |
175 void rm_log(struct log_conversation *a) | |
176 { | |
177 struct conversation *cnv = find_conversation(a->name); | |
178 char buf[128]; | |
179 | |
180 log_conversations = g_list_remove(log_conversations, a); | |
181 | |
182 save_prefs(); | |
183 | |
184 if (cnv) { | |
185 if (!(general_options & OPT_GEN_LOG_ALL)) | |
186 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, cnv->name); | |
187 else | |
188 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, cnv->name); | |
189 gtk_window_set_title(GTK_WINDOW(cnv->window), buf); | |
190 } | |
191 } | |
192 | |
193 struct log_conversation *find_log_info(char *name) | |
194 { | |
195 char *pname = g_malloc(64); | |
196 GList *lc = log_conversations; | |
197 struct log_conversation *l; | |
198 | |
199 | |
200 strcpy(pname, normalize(name)); | |
201 | |
202 while(lc) { | |
203 l = (struct log_conversation *)lc->data; | |
204 if (!strcasecmp(pname, normalize(l->name))) { | |
205 g_free(pname); | |
206 return l; | |
207 } | |
208 lc = lc->next; | |
209 } | |
210 g_free(pname); | |
211 return NULL; | |
212 } | |
213 | |
625
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
214 void delete_conversation(struct conversation *c) |
66 | 215 { |
625
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
216 conversations = g_list_remove(conversations, c); |
858
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
217 if (c->fg_color_dialog) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
218 gtk_widget_destroy(c->fg_color_dialog); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
219 if (c->bg_color_dialog) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
220 gtk_widget_destroy(c->bg_color_dialog); |
625
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
221 if (c->font_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
222 gtk_widget_destroy(c->font_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
223 if (c->smiley_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
224 gtk_widget_destroy(c->smiley_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
225 if (c->link_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
226 gtk_widget_destroy(c->link_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
227 if (c->log_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
228 gtk_widget_destroy(c->log_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
229 g_free(c); |
66 | 230 } |
231 | |
232 void update_log_convs() | |
233 { | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
234 GSList *C = connections; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
235 struct gaim_connection *g; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
236 GSList *bcs; |
66 | 237 GList *cnv = conversations; |
238 struct conversation *c; | |
239 | |
240 while(cnv) { | |
241 c = (struct conversation *)cnv->data; | |
242 | |
243 if (c->log_button) | |
244 gtk_widget_set_sensitive(c->log_button, ((general_options & OPT_GEN_LOG_ALL)) ? FALSE : TRUE); | |
245 | |
246 cnv = cnv->next; | |
247 } | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
248 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
249 while (C) { |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
250 g = (struct gaim_connection *)C->data; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
251 bcs = g->buddy_chats; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
252 while(bcs) { |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
253 c = (struct conversation *)bcs->data; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
254 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
255 if (c->log_button) |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
256 gtk_widget_set_sensitive(c->log_button, ((general_options & OPT_GEN_LOG_ALL)) ? FALSE : TRUE); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
257 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
258 bcs = bcs->next; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
259 } |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
260 C = C->next; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
261 } |
66 | 262 } |
263 | |
264 void update_font_buttons() | |
265 { | |
266 GList *cnv = conversations; | |
267 struct conversation *c; | |
268 | |
269 while (cnv) { | |
270 c = (struct conversation *)cnv->data; | |
271 | |
272 if (c->bold) | |
273 gtk_widget_set_sensitive(c->bold, ((font_options & OPT_FONT_BOLD)) ? FALSE : TRUE); | |
274 | |
275 if (c->italic) | |
276 gtk_widget_set_sensitive(c->italic, ((font_options & OPT_FONT_ITALIC)) ? FALSE : TRUE); | |
277 | |
278 if (c->underline) | |
279 gtk_widget_set_sensitive(c->underline, ((font_options & OPT_FONT_UNDERLINE)) ? FALSE : TRUE); | |
280 | |
281 if (c->strike) | |
282 gtk_widget_set_sensitive(c->strike, ((font_options & OPT_FONT_STRIKE)) ? FALSE : TRUE); | |
283 | |
284 cnv = cnv->next; | |
285 } | |
286 } | |
287 | |
288 /* | |
289 void update_transparency() | |
290 { | |
291 GList *cnv = conversations; | |
292 struct conversation *c; | |
293 | |
294 This func should be uncalled! | |
295 | |
296 while(cnv) { | |
297 c = (struct conversation *)cnv->data; | |
298 | |
299 if (c->text) | |
300 gtk_html_set_transparent(GTK_HTML(c->text), | |
301 (transparent) ? TRUE : FALSE); | |
302 | |
303 cnv = cnv->next; | |
304 } | |
305 } | |
306 */ | |
307 | |
308 | |
309 /*------------------------------------------------------------------------*/ | |
310 /* Callbacks */ | |
311 /*------------------------------------------------------------------------*/ | |
312 | |
608 | 313 void toggle_loggle(GtkWidget *loggle, struct conversation *c) |
66 | 314 { |
315 if (state_lock) | |
316 return; | |
608 | 317 if (find_log_info(c->name)) |
318 rm_log(find_log_info(c->name)); | |
319 else if (GTK_TOGGLE_BUTTON(loggle)->active) | |
320 show_log_dialog(c); | |
321 else | |
322 cancel_log(NULL, c); | |
66 | 323 } |
324 | |
570 | 325 void insert_smiley(GtkWidget *smiley, struct conversation *c) |
555 | 326 { |
327 if (state_lock) | |
328 return; | |
570 | 329 if (GTK_TOGGLE_BUTTON(smiley)->active) |
330 show_smiley_dialog(c, smiley); | |
331 else if (c->smiley_dialog) | |
332 close_smiley_dialog(smiley, c); | |
333 | |
555 | 334 return; |
335 } | |
336 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
337 int close_callback(GtkWidget *widget, struct conversation *c) |
66 | 338 { |
814
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
339 if (c->is_chat && (widget == c->close)) { |
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
340 GtkWidget *tmp = c->window; |
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
341 debug_print("chat clicked close button\n"); |
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
342 c->window = NULL; |
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
343 gtk_widget_destroy(tmp); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
344 return FALSE; |
814
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
345 } |
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
346 |
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
347 debug_print("conversation close callback\n"); |
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
348 |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
349 if (general_options & OPT_GEN_CHECK_SPELLING) |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
350 gtkspell_detach(GTK_TEXT(c->entry)); |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
351 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
352 if (c->window) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
353 gtk_widget_destroy(c->window); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
354 c->window = NULL; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
355 |
858
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
356 if (c->fg_color_dialog) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
357 gtk_widget_destroy(c->fg_color_dialog); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
358 c->fg_color_dialog = NULL; |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
359 if (c->bg_color_dialog) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
360 gtk_widget_destroy(c->bg_color_dialog); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
361 c->bg_color_dialog = NULL; |
625
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
362 if (c->font_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
363 gtk_widget_destroy(c->font_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
364 c->font_dialog = NULL; |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
365 if (c->smiley_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
366 gtk_widget_destroy(c->smiley_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
367 c->smiley_dialog = NULL; |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
368 if (c->link_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
369 gtk_widget_destroy(c->link_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
370 c->link_dialog = NULL; |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
371 if (c->log_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
372 gtk_widget_destroy(c->log_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
373 c->log_dialog = NULL; |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
374 |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
502
diff
changeset
|
375 if (c->is_chat) { |
1063
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
376 if (c->gc) |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
377 serv_chat_leave(c->gc, c->id); |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
378 else { |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
379 /* bah */ |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
380 while (c->in_room) { |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
381 char *tmp = c->in_room->data; |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
382 c->in_room = g_list_remove(c->in_room, tmp); |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
383 g_free(tmp); |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
384 } |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
385 g_free(c); |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
386 } |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
502
diff
changeset
|
387 } else { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
388 delete_conversation(c); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
502
diff
changeset
|
389 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
390 |
66 | 391 return TRUE; |
392 } | |
393 | |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
394 void set_font_face(char *newfont, struct conversation *c) |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
395 { |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
396 char *pre_fontface; |
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
397 int alloc = 1; |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
398 |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
399 pre_fontface = g_strconcat("<FONT FACE=\"", newfont, "\">", '\0'); |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
400 |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
401 if (!strcmp(pre_fontface, "<FONT FACE=\"\">")) |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
402 { |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
403 g_free(pre_fontface); |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
404 alloc--; |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
405 pre_fontface = "<FONT FACE=\"Helvetica\">"; |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
406 } |
275
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
407 |
687
02ef523db170
[gaim-migrate @ 697]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
408 sprintf(c->fontface, "%s", newfont ? (newfont[0] ? newfont : "Helvetica") : "Helvetica"); |
688
6b1345121dd3
[gaim-migrate @ 698]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
687
diff
changeset
|
409 c->hasfont = 1; |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
410 surround(c->entry, pre_fontface, "</FONT>"); |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
411 gtk_widget_grab_focus(c->entry); |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
412 |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
413 if (alloc) |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
414 g_free(pre_fontface); |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
415 } |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
416 |
66 | 417 static gint delete_event_convo(GtkWidget *w, GdkEventAny *e, struct conversation *c) |
418 { | |
419 delete_conversation(c); | |
420 return FALSE; | |
421 } | |
422 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
423 void add_callback(GtkWidget *widget, struct conversation *c) |
66 | 424 { |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
425 if (c->gc && find_buddy(c->gc, c->name) != NULL) { |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
426 sprintf(debug_buff,_("Removing '%s' from buddylist.\n"), c->name); |
66 | 427 debug_print(debug_buff); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
428 remove_buddy(c->gc, find_group_by_buddy(c->gc, c->name), find_buddy(c->gc, c->name)); |
66 | 429 build_edit_tree(); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
430 update_convo_add_button(c); |
66 | 431 } |
432 else | |
433 { | |
1072
81d19577285a
[gaim-migrate @ 1082]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1067
diff
changeset
|
434 if (c->gc) show_add_buddy(c->gc, c->name, NULL); |
66 | 435 } |
436 | |
437 gtk_widget_grab_focus(c->entry); | |
438 } | |
439 | |
440 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
441 void block_callback(GtkWidget *widget, struct conversation *c) |
66 | 442 { |
1144
b1454d019277
[gaim-migrate @ 1154]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1133
diff
changeset
|
443 if (c->gc) show_add_perm(c->gc, c->name, FALSE); |
66 | 444 gtk_widget_grab_focus(c->entry); |
445 } | |
446 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
447 void warn_callback(GtkWidget *widget, struct conversation *c) |
66 | 448 { |
976
2586b2a3725e
[gaim-migrate @ 986]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
964
diff
changeset
|
449 show_warn_dialog(c->gc, c->name); |
66 | 450 gtk_widget_grab_focus(c->entry); |
451 } | |
452 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
453 void info_callback(GtkWidget *w, struct conversation *c) |
66 | 454 { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
455 if (c->is_chat) { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
456 char *name; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
457 GList *i; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
458 |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
459 i = GTK_LIST(c->list)->selection; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
460 if (i) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
461 name = (char *)gtk_object_get_user_data(GTK_OBJECT(i->data)); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
462 else |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
463 return; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
464 |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
465 serv_get_info(c->gc, name); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
466 } else { |
1032
643a4d81c18a
[gaim-migrate @ 1042]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1030
diff
changeset
|
467 serv_get_info(c->gc, c->name); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
468 gtk_widget_grab_focus(c->entry); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
469 } |
66 | 470 } |
471 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
472 gboolean keypress_callback(GtkWidget *entry, GdkEventKey *event, struct conversation *c) |
66 | 473 { |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
474 int pos; |
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
475 if(event->keyval==GDK_Return) { |
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
476 if(!(event->state & GDK_SHIFT_MASK) |
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
477 && (general_options & OPT_GEN_ENTER_SENDS)) { |
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
478 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c); |
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
479 //to stop the putting in of the enter character |
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
480 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
481 } else { |
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
482 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
483 pos=gtk_editable_get_position(GTK_EDITABLE(entry)); |
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
484 gtk_editable_insert_text(GTK_EDITABLE(entry), "\n", 1, &pos); |
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
485 } |
830
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
486 } else if (event->state & GDK_CONTROL_MASK) { |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
487 if (general_options & OPT_GEN_CTL_CHARS) { |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
488 switch (event->keyval) { |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
489 case 'i': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
490 quiet_set(c->italic, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->italic))); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
491 do_italic(c->italic, c->entry); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
492 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
493 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
494 case 'u': /* ctl-u is GDK_Clear, which clears the line */ |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
495 quiet_set(c->underline, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->underline))); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
496 do_underline(c->underline, c->entry); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
497 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
498 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
499 case 'b': /* ctl-b is GDK_Left, which moves backwards */ |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
500 quiet_set(c->bold, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->bold))); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
501 do_bold(c->bold, c->entry); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
502 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
503 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
504 case 's': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
505 quiet_set(c->strike, !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->strike))); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
506 do_strike(c->strike, c->entry); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
507 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
508 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
509 } |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
510 } |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
511 if (general_options & OPT_GEN_CTL_SMILEYS) { |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
512 char buf[7]; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
513 buf[0] = '\0'; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
514 switch (event->keyval) { |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
515 case '1': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
516 sprintf(buf, ":-)"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
517 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
518 case '2': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
519 sprintf(buf, ":-("); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
520 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
521 case '3': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
522 sprintf(buf, ";-)"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
523 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
524 case '4': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
525 sprintf(buf, ":-P"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
526 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
527 case '5': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
528 sprintf(buf, "=-O"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
529 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
530 case '6': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
531 sprintf(buf, ":-*"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
532 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
533 case '7': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
534 sprintf(buf, ">:o"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
535 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
536 case '8': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
537 sprintf(buf, "8-)"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
538 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
539 case '!': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
540 sprintf(buf, ":-$"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
541 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
542 case '@': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
543 sprintf(buf, ":-!"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
544 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
545 case '#': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
546 sprintf(buf, ":-["); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
547 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
548 case '$': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
549 sprintf(buf, "O:-)"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
550 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
551 case '%': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
552 sprintf(buf, ":-/"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
553 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
554 case '^': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
555 sprintf(buf, ":'("); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
556 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
557 case '&': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
558 sprintf(buf, ":-X"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
559 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
560 case '*': |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
561 sprintf(buf, ":-D"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
562 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
563 } |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
564 if (buf[0]) { |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
565 if (GTK_EDITABLE(c->entry)->has_selection) { |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
566 int finish = GTK_EDITABLE(c->entry)->selection_end_pos; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
567 gtk_editable_insert_text(GTK_EDITABLE(c->entry), |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
568 buf, strlen(buf), &finish); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
569 } else { |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
570 pos = GTK_EDITABLE(c->entry)->current_pos; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
571 gtk_editable_insert_text(GTK_EDITABLE(c->entry), |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
572 buf, strlen(buf), &pos); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
573 } |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
574 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
575 } |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
576 } |
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
577 } |
66 | 578 |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
579 return TRUE; |
66 | 580 |
581 } | |
582 | |
583 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
584 void send_callback(GtkWidget *widget, struct conversation *c) |
66 | 585 { |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
586 char *buf, *buf2, *buf3; |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
587 int limit; |
66 | 588 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
589 if (!c->gc) return; |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
590 |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
591 buf2 = gtk_editable_get_chars(GTK_EDITABLE(c->entry), 0, -1); |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
592 /* uncomment this if you want no limit on outgoing messages. |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
593 * if you uncomment this, you'll probably get kicked off if |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
594 * you send one that's too big. |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
595 limit = strlen(buf2) * 2; |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
596 */ |
1002
1d8f05ea6bdf
[gaim-migrate @ 1012]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1000
diff
changeset
|
597 limit = 7985 << 2; |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
598 buf = g_malloc(limit); |
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
599 g_snprintf(buf, limit, "%s", buf2); |
753
cd62f69d187e
[gaim-migrate @ 763]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
745
diff
changeset
|
600 g_free(buf2); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
601 gtk_editable_delete_text(GTK_EDITABLE(c->entry), 0, -1); |
796
4783a3b6859d
[gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
795
diff
changeset
|
602 if (!strlen(buf)) { |
4783a3b6859d
[gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
795
diff
changeset
|
603 g_free(buf); |
4783a3b6859d
[gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
795
diff
changeset
|
604 return; |
4783a3b6859d
[gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
795
diff
changeset
|
605 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
606 |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
607 if (general_options & OPT_GEN_SEND_LINKS) |
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
608 linkify_text(buf); |
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
609 |
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
610 buf2 = g_malloc(limit); |
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
611 |
66 | 612 if (font_options & OPT_FONT_BOLD) { |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
613 g_snprintf(buf2, limit, "<B>%s</B>", buf); |
66 | 614 strcpy(buf, buf2); |
615 } | |
616 | |
617 if (font_options & OPT_FONT_ITALIC) { | |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
618 g_snprintf(buf2, limit, "<I>%s</I>", buf); |
66 | 619 strcpy(buf, buf2); |
620 } | |
621 | |
622 if (font_options & OPT_FONT_UNDERLINE) { | |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
623 g_snprintf(buf2, limit, "<U>%s</U>", buf); |
66 | 624 strcpy(buf, buf2); |
625 } | |
626 | |
627 if (font_options & OPT_FONT_STRIKE) { | |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
628 g_snprintf(buf2, limit, "<STRIKE>%s</STRIKE>", buf); |
66 | 629 strcpy(buf, buf2); |
630 } | |
101
a9aa982272f9
[gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
88
diff
changeset
|
631 |
688
6b1345121dd3
[gaim-migrate @ 698]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
687
diff
changeset
|
632 if ((font_options & OPT_FONT_FACE) || c->hasfont) { |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
633 g_snprintf(buf2, limit, "<FONT FACE=\"%s\">%s</FONT>", c->fontface, buf); |
488
0fcb7e7a263c
[gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
474
diff
changeset
|
634 strcpy(buf, buf2); |
0fcb7e7a263c
[gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
474
diff
changeset
|
635 } |
0fcb7e7a263c
[gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
474
diff
changeset
|
636 |
699
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
637 if ((font_options & OPT_FONT_FGCOL) || c->hasfg) { |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
638 g_snprintf(buf2, limit, "<FONT COLOR=\"#%02X%02X%02X\">%s</FONT>", c->fgcol.red, c->fgcol.green, c->fgcol.blue, buf); |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
639 strcpy(buf, buf2); |
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
640 } |
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
641 |
699
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
642 if ((font_options & OPT_FONT_BGCOL) || c->hasbg) { |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
643 g_snprintf(buf2, limit, "<BODY BGCOLOR=\"#%02X%02X%02X\">%s</BODY>", c->bgcol.red, c->bgcol.green, c->bgcol.blue, buf); |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
644 strcpy(buf, buf2); |
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
645 } |
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
646 |
101
a9aa982272f9
[gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
88
diff
changeset
|
647 { |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
389
diff
changeset
|
648 char *buffy = g_strdup(buf); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
649 enum gaim_event evnt = c->is_chat ? event_chat_send : event_im_send; |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
650 int plugin_return = plugin_event(evnt, c->gc, c->name, &buffy, 0); |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
389
diff
changeset
|
651 if (!buffy) { |
102
8c301530b2a3
[gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
101
diff
changeset
|
652 g_free(buf2); |
796
4783a3b6859d
[gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
795
diff
changeset
|
653 g_free(buf); |
102
8c301530b2a3
[gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
101
diff
changeset
|
654 return; |
8c301530b2a3
[gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
101
diff
changeset
|
655 } |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
656 if (plugin_return) { |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
657 g_free(buffy); |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
658 g_free(buf2); |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
659 g_free(buf); |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
660 return; |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
661 } |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
662 g_snprintf(buf, limit, "%s", buffy); |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
389
diff
changeset
|
663 g_free(buffy); |
101
a9aa982272f9
[gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
88
diff
changeset
|
664 } |
66 | 665 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
666 if (!c->is_chat) { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
667 buf3 = g_strdup(buf); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
668 write_to_conv(c, buf3, WFLAG_SEND, NULL); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
669 g_free(buf3); |
66 | 670 |
980
82c5865f7cfe
[gaim-migrate @ 990]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
976
diff
changeset
|
671 serv_send_im(c->gc, c->name, buf, 0); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
672 |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
673 if (c->makesound && (sound_options & OPT_SOUND_SEND)) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
674 play_sound(SEND); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
675 } else { |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
676 serv_chat_send(c->gc, c->id, buf); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
677 |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
678 /* no sound because we do that when we receive our message */ |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
679 } |
66 | 680 |
681 quiet_set(c->bold, FALSE); | |
682 quiet_set(c->strike, FALSE); | |
683 quiet_set(c->italic, FALSE); | |
684 quiet_set(c->underline, FALSE); | |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
685 quiet_set(c->font, FALSE); |
854 | 686 quiet_set(c->fgcolorbtn, FALSE); |
687 quiet_set(c->bgcolorbtn, FALSE); | |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
688 quiet_set(c->link, FALSE); |
66 | 689 |
375
1eae69f076d2
[gaim-migrate @ 385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
373
diff
changeset
|
690 if ((general_options & OPT_GEN_BACK_ON_IM) && awaymessage != NULL) { |
66 | 691 do_im_back(); |
692 } | |
693 | |
694 gtk_widget_grab_focus(c->entry); | |
796
4783a3b6859d
[gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
795
diff
changeset
|
695 g_free(buf2); |
4783a3b6859d
[gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
795
diff
changeset
|
696 g_free(buf); |
66 | 697 } |
698 | |
907
08d5037c9296
[gaim-migrate @ 917]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
699 int entry_key_pressed(GtkWidget *w, GtkWidget *entry) |
66 | 700 { |
701 check_everything(w); | |
702 return TRUE; | |
703 } | |
704 | |
705 /*------------------------------------------------------------------------*/ | |
706 /* HTML-type stuff */ | |
707 /*------------------------------------------------------------------------*/ | |
708 | |
709 int count_tag(GtkWidget *entry, char *s1, char *s2) | |
710 { | |
711 char *p1, *p2; | |
712 int res=0; | |
713 char *tmp, *tmpo, h; | |
714 tmpo = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); | |
715 h = tmpo[GTK_EDITABLE(entry)->current_pos]; | |
716 tmpo[GTK_EDITABLE(entry)->current_pos]='\0'; | |
717 tmp=tmpo; | |
718 do { | |
719 p1 = strstr(tmp, s1); | |
720 p2 = strstr(tmp, s2); | |
721 if (p1 && p2) { | |
722 if (p1 < p2) { | |
723 res=1; | |
724 tmp = p1 +strlen(s1); | |
725 } else if (p2 < p1) { | |
726 res = 0; | |
727 tmp = p2 + strlen(s2); | |
728 } | |
729 } else { | |
730 if (p1) { | |
731 res = 1; | |
732 tmp = p1 + strlen(s1); | |
733 } else if (p2) { | |
734 res = 0; | |
735 tmp = p2 + strlen(s2); | |
736 } | |
737 } | |
738 } while (p1 || p2); | |
739 tmpo[GTK_EDITABLE(entry)->current_pos]=h; | |
740 g_free(tmpo); | |
741 return res; | |
742 } | |
743 | |
744 | |
745 int invert_tags(GtkWidget *entry, char *s1, char *s2, int really) | |
746 { | |
747 int start = GTK_EDITABLE(entry)->selection_start_pos; | |
748 int finish = GTK_EDITABLE(entry)->selection_end_pos; | |
749 char *s; | |
750 | |
751 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); | |
752 if (!strncasecmp(&s[start], s1, strlen(s1)) && | |
753 !strncasecmp(&s[finish - strlen(s2)], s2, strlen(s2))) { | |
754 if (really) { | |
755 gtk_editable_delete_text(GTK_EDITABLE(entry), start, start + strlen(s1)); | |
756 gtk_editable_delete_text(GTK_EDITABLE(entry), finish - strlen(s2) - strlen(s1), finish - strlen(s1)); | |
757 } | |
758 g_free(s); | |
759 return 1; | |
760 } | |
761 g_free(s); | |
762 return 0; | |
763 } | |
764 | |
765 | |
766 void remove_tags(GtkWidget *entry, char *tag) | |
767 { | |
275
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
768 char *s, *t; |
66 | 769 int start = GTK_EDITABLE(entry)->selection_start_pos; |
770 int finish = GTK_EDITABLE(entry)->selection_end_pos; | |
275
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
771 int temp; |
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
772 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); |
66 | 773 t = s; |
275
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
774 |
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
775 if (start > finish) |
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
776 { |
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
777 temp = start; |
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
778 start = finish; |
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
779 finish = temp; |
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
780 } |
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
781 |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
782 if (strstr(tag, "<FONT SIZE=")) |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
783 { |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
784 while((t = strstr(t, "<FONT SIZE="))) { |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
785 if (((t-s) < finish) && ((t-s) >= start)) { |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
786 gtk_editable_delete_text(GTK_EDITABLE(entry), (t-s), (t-s) + strlen(tag)); |
846
4b05985bae5e
[gaim-migrate @ 856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
843
diff
changeset
|
787 g_free(s); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
788 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
789 t = s; |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
790 } |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
791 else t++; |
68 | 792 } |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
793 } |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
794 else |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
795 { |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
796 while((t = strstr(t, tag))) { |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
797 if (((t-s) < finish) && ((t-s) >= start)) { |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
798 gtk_editable_delete_text(GTK_EDITABLE(entry), (t-s), (t-s) + strlen(tag)); |
846
4b05985bae5e
[gaim-migrate @ 856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
843
diff
changeset
|
799 g_free(s); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
800 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
801 t = s; |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
802 } |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
803 else t++; |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
804 } |
66 | 805 } |
806 g_free(s); | |
807 } | |
808 | |
1103
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
809 static char* add_br(char* p) { |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
810 |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
811 char* temp_p = p; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
812 char* buffer_p; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
813 char* buffer_start; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
814 int num_cr = 0; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
815 int char_len = 0; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
816 |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
817 while( *temp_p != '\0' ) { |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
818 char_len++; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
819 if( *temp_p == '\n' ) |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
820 num_cr++; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
821 ++temp_p; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
822 } |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
823 |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
824 temp_p = p; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
825 buffer_p = g_malloc(char_len + ( 4 * num_cr ) + 1); |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
826 buffer_start = buffer_p; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
827 |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
828 while( *temp_p != '\0' ) { |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
829 *buffer_p = *temp_p; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
830 if( *temp_p == '\n' ) { |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
831 *buffer_p++ = '<'; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
832 *buffer_p++ = 'B'; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
833 *buffer_p++ = 'R'; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
834 *buffer_p++ = '>'; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
835 *buffer_p = '\n'; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
836 } |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
837 ++buffer_p; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
838 ++temp_p; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
839 } |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
840 *buffer_p = '\0'; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
841 |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
842 return buffer_start; |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
843 } |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
844 |
66 | 845 void surround(GtkWidget *entry, char *pre, char *post) |
846 { | |
649 | 847 int temp, pos = GTK_EDITABLE(entry)->current_pos; |
66 | 848 int dummy; |
849 int start, finish; | |
1133 | 850 |
851 if (general_options & OPT_GEN_CHECK_SPELLING) { | |
852 gtkspell_detach(GTK_TEXT(entry)); | |
853 } | |
854 | |
66 | 855 if (GTK_EDITABLE(entry)->has_selection) { |
856 remove_tags(entry, pre); | |
857 remove_tags(entry, post); | |
858 start = GTK_EDITABLE(entry)->selection_start_pos; | |
859 finish = GTK_EDITABLE(entry)->selection_end_pos; | |
860 if (start > finish) { | |
861 dummy = finish; | |
862 finish = start; | |
863 start = dummy; | |
864 } | |
865 dummy = start; | |
866 gtk_editable_insert_text(GTK_EDITABLE(entry), pre, strlen(pre), &dummy); | |
867 dummy = finish + strlen(pre); | |
868 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy); | |
869 gtk_editable_select_region(GTK_EDITABLE(entry), start, finish + strlen(pre) + strlen(post)); | |
870 } else { | |
649 | 871 temp = pos; |
66 | 872 gtk_editable_insert_text(GTK_EDITABLE(entry), pre, strlen(pre), &pos); |
649 | 873 if (temp == pos) |
874 { | |
875 dummy = pos + strlen(pre); | |
876 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy); | |
877 gtk_editable_set_position(GTK_EDITABLE(entry), dummy); | |
878 } | |
879 else | |
880 { | |
881 dummy = pos; | |
882 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy); | |
883 gtk_editable_set_position(GTK_EDITABLE(entry), pos); | |
884 } | |
66 | 885 } |
1133 | 886 |
887 if (general_options & OPT_GEN_CHECK_SPELLING) { | |
888 gtkspell_attach(GTK_TEXT(entry)); | |
889 } | |
890 | |
66 | 891 gtk_widget_grab_focus(entry); |
892 } | |
893 | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
894 void advance_past(GtkWidget *entry, char *pre, char *post) |
66 | 895 { |
896 char *s, *s2; | |
897 int pos; | |
898 if (invert_tags(entry, pre, post, 1)) | |
899 return; | |
900 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); | |
901 pos = GTK_EDITABLE(entry)->current_pos; | |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
520
diff
changeset
|
902 sprintf(debug_buff, _("Currently at %d, "), pos); |
66 | 903 debug_print(debug_buff); |
904 s2= strstr(&s[pos], post); | |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
520
diff
changeset
|
905 if (s2) { |
66 | 906 pos = s2 - s + strlen(post); |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
520
diff
changeset
|
907 } else { |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
520
diff
changeset
|
908 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &pos); |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
520
diff
changeset
|
909 } |
846
4b05985bae5e
[gaim-migrate @ 856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
843
diff
changeset
|
910 g_free(s); |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
520
diff
changeset
|
911 sprintf(debug_buff, _("Setting position to %d\n"), pos); |
66 | 912 debug_print(debug_buff); |
913 gtk_editable_set_position(GTK_EDITABLE(entry), pos); | |
914 gtk_widget_grab_focus(entry); | |
915 } | |
916 | |
858
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
917 void toggle_fg_color(GtkWidget *color, struct conversation *c) |
66 | 918 { |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
919 if (state_lock) |
66 | 920 return; |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
921 if (GTK_TOGGLE_BUTTON(color)->active) |
858
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
922 show_fgcolor_dialog(c, color); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
923 else if (c->fg_color_dialog) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
924 cancel_fgcolor(color, c); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
925 else |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
926 advance_past(c->entry, "<FONT COLOR>", "</FONT>" ); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
927 } |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
928 |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
929 void toggle_bg_color(GtkWidget *color, struct conversation *c) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
930 { |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
931 if (state_lock) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
932 return; |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
933 if (GTK_TOGGLE_BUTTON(color)->active) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
934 show_bgcolor_dialog(c, color); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
935 else if (c->bg_color_dialog) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
936 cancel_bgcolor(color, c); |
189
50dc3db25513
[gaim-migrate @ 199]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
187
diff
changeset
|
937 else |
859
75172284a1a7
[gaim-migrate @ 869]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
858
diff
changeset
|
938 advance_past(c->entry, "<BODY BGCOLOR>", "</BODY>" ); |
66 | 939 } |
940 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
941 void toggle_font(GtkWidget *font, struct conversation *c) |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
942 { |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
943 if (state_lock) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
944 return; |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
945 if (GTK_TOGGLE_BUTTON(font)->active) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
946 show_font_dialog(c, font); |
563
8d6e2de1fb64
[gaim-migrate @ 573]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
557
diff
changeset
|
947 else if (c->font_dialog) |
8d6e2de1fb64
[gaim-migrate @ 573]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
557
diff
changeset
|
948 cancel_font(font, c); |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
949 else |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
950 advance_past(c->entry, "<FONT FACE>", "</FONT>"); |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
951 } |
611
0f7e5ff95f71
[gaim-migrate @ 621]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
610
diff
changeset
|
952 |
608 | 953 void toggle_link(GtkWidget *linky, struct conversation *c) |
954 { | |
955 if (state_lock) | |
956 return; | |
957 if (GTK_TOGGLE_BUTTON(linky)->active) | |
958 show_add_link(linky, c); | |
959 else if (c->link_dialog) | |
960 cancel_link(linky, c); | |
961 else | |
962 advance_past(c->entry, "<A HREF>", "</A>"); | |
963 } | |
66 | 964 |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
965 void do_strike(GtkWidget *strike, GtkWidget *entry) |
66 | 966 { |
967 if (state_lock) | |
968 return; | |
1133 | 969 |
66 | 970 if (GTK_TOGGLE_BUTTON(strike)->active) |
971 surround(entry, "<STRIKE>","</STRIKE>"); | |
972 else | |
973 advance_past(entry, "<STRIKE>", "</STRIKE>"); | |
1133 | 974 |
66 | 975 } |
976 | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
977 void do_bold(GtkWidget *bold, GtkWidget *entry) |
66 | 978 { |
979 if (state_lock) | |
980 return; | |
981 if (GTK_TOGGLE_BUTTON(bold)->active) | |
982 surround(entry, "<B>","</B>"); | |
983 else | |
984 advance_past(entry, "<B>", "</B>"); | |
985 } | |
986 | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
987 void do_underline(GtkWidget *underline, GtkWidget *entry) |
66 | 988 { |
989 if (state_lock) | |
990 return; | |
991 if (GTK_TOGGLE_BUTTON(underline)->active) | |
992 surround(entry, "<U>","</U>"); | |
993 else | |
994 advance_past(entry, "<U>", "</U>"); | |
995 } | |
996 | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
997 void do_italic(GtkWidget *italic, GtkWidget *entry) |
66 | 998 { |
999 if (state_lock) | |
1000 return; | |
1001 if (GTK_TOGGLE_BUTTON(italic)->active) | |
1002 surround(entry, "<I>","</I>"); | |
1003 else | |
1004 advance_past(entry, "<I>", "</I>"); | |
1005 } | |
1006 | |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
1007 /* html code to modify font sizes must all be the same length, */ |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
1008 /* currently set to 15 chars */ |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
1009 |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1010 void do_small(GtkWidget *small, GtkWidget *entry) |
66 | 1011 { |
1012 if (state_lock) | |
1013 return; | |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
1014 surround(entry, "<FONT SIZE=\"1\">","</FONT>"); |
66 | 1015 } |
1016 | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1017 void do_normal(GtkWidget *normal, GtkWidget *entry) |
66 | 1018 { |
1019 if (state_lock) | |
1020 return; | |
88 | 1021 surround(entry, "<FONT SIZE=\"3\">","</FONT>"); |
66 | 1022 } |
1023 | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1024 void do_big(GtkWidget *big, GtkWidget *entry) |
66 | 1025 { |
1026 if (state_lock) | |
1027 return; | |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
1028 surround(entry, "<FONT SIZE=\"5\">","</FONT>"); |
66 | 1029 } |
1030 | |
1031 void check_everything(GtkWidget *entry) | |
1032 { | |
1033 struct conversation *c; | |
206 | 1034 |
66 | 1035 c = (struct conversation *)gtk_object_get_user_data(GTK_OBJECT(entry)); |
1036 if (!c) return; | |
1037 if (invert_tags(entry, "<B>", "</B>", 0)) | |
1038 quiet_set(c->bold, TRUE); | |
1039 else if (count_tag(entry, "<B>", "</B>")) | |
1040 quiet_set(c->bold, TRUE); | |
1041 else | |
1042 quiet_set(c->bold,FALSE); | |
1043 if (invert_tags(entry, "<I>", "</I>", 0)) | |
1044 quiet_set(c->italic, TRUE); | |
1045 else if (count_tag(entry, "<I>", "</I>")) | |
1046 quiet_set(c->italic, TRUE); | |
1047 else | |
1048 quiet_set(c->italic, FALSE); | |
1049 | |
1050 if (invert_tags(entry, "<FONT COLOR", "</FONT>", 0)) | |
854 | 1051 quiet_set(c->fgcolorbtn, TRUE); |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1052 else if (count_tag(entry, "<FONT COLOR", "</FONT>")) |
854 | 1053 quiet_set(c->fgcolorbtn, TRUE); |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1054 else |
854 | 1055 quiet_set(c->fgcolorbtn, FALSE); |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1056 |
861
00fb90babcb2
[gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
860
diff
changeset
|
1057 if (invert_tags(entry, "<BODY BGCOLOR", "</BODY>", 0)) |
00fb90babcb2
[gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
860
diff
changeset
|
1058 quiet_set(c->bgcolorbtn, TRUE); |
00fb90babcb2
[gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
860
diff
changeset
|
1059 else if (count_tag(entry, "<BODY BGCOLOR", "</BODY>")) |
00fb90babcb2
[gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
860
diff
changeset
|
1060 quiet_set(c->bgcolorbtn, TRUE); |
00fb90babcb2
[gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
860
diff
changeset
|
1061 else |
00fb90babcb2
[gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
860
diff
changeset
|
1062 quiet_set(c->bgcolorbtn, FALSE); |
00fb90babcb2
[gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
860
diff
changeset
|
1063 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1064 if (invert_tags(entry, "<FONT FACE", "</FONT>", 0)) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1065 quiet_set(c->font, TRUE); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1066 else if (count_tag(entry, "<FONT FACE", "</FONT>")) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1067 quiet_set(c->font, TRUE); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1068 else |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1069 quiet_set(c->font, FALSE); |
66 | 1070 |
1071 if (invert_tags(entry, "<A HREF", "</A>", 0)) | |
1072 quiet_set(c->link, TRUE); | |
1073 else if (count_tag(entry, "<A HREF", "</A>")) | |
1074 quiet_set(c->link, TRUE); | |
1075 else | |
1076 quiet_set(c->link, FALSE); | |
1077 | |
1078 if (invert_tags(entry, "<U>", "</U>", 0)) | |
1079 quiet_set(c->underline, TRUE); | |
1080 else if (count_tag(entry, "<U>", "</U>")) | |
1081 quiet_set(c->underline, TRUE); | |
1082 else | |
1083 quiet_set(c->underline, FALSE); | |
1084 | |
1085 if (invert_tags(entry, "<STRIKE>", "</STRIKE>", 0)) | |
1086 quiet_set(c->strike, TRUE); | |
1087 else if (count_tag(entry, "<STRIKE>", "</STRIKE>")) | |
1088 quiet_set(c->strike, TRUE); | |
1089 else | |
1090 quiet_set(c->strike, FALSE); | |
1091 } | |
1092 | |
1093 | |
1094 /*------------------------------------------------------------------------*/ | |
1095 /* Takin care of the window.. */ | |
1096 /*------------------------------------------------------------------------*/ | |
1097 | |
1098 | |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1099 static GdkPixmap *is_smiley(GtkWidget *window, char *m, int *len, GdkColor *trans) { |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1100 GdkBitmap *mask; |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1101 GdkPixmap *face = NULL; |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1102 |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1103 if (strlen(m) < 2) return face; |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1104 *len = 2; |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1105 if ( !strncmp(m, ":)", 2) || |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1106 !strncmp(m, "=)", 2)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1107 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, smile_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1108 } else if (!strncmp(m, ":(", 2) || |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1109 !strncmp(m, "=(", 2)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1110 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, sad_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1111 } else if (!strncmp(m, ";)", 2)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1112 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, wink_xpm); |
629
ce8d8608d05b
[gaim-migrate @ 639]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
628
diff
changeset
|
1113 } else if (!strncmp(m, ":p", 2) || |
ce8d8608d05b
[gaim-migrate @ 639]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
628
diff
changeset
|
1114 !strncmp(m, ":P", 2)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1115 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, tongue_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1116 } |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1117 |
816
09e9685e24b9
[gaim-migrate @ 826]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
815
diff
changeset
|
1118 if (face || strlen(m) < 3) return face; |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1119 *len = 3; |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1120 if ( !strncmp(m, ":-)", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1121 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, smile_xpm); |
610
cadb51c068cb
[gaim-migrate @ 620]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
608
diff
changeset
|
1122 } else if (!strncmp(m, "O-)", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1123 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, oneeye_xpm); |
551 | 1124 } else if (!strncmp(m, "C:)", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1125 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, luke03_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1126 } else if (!strncmp(m, ":-(", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1127 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, sad_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1128 } else if (!strncmp(m, ";-)", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1129 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, wink_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1130 } else if (!strncmp(m, ":-p", 3) || |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1131 !strncmp(m, ":-P", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1132 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, tongue_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1133 } else if (!strncmp(m, "=-O", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1134 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, scream_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1135 } else if (!strncmp(m, ":-*", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1136 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, kiss_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1137 } else if (!strncmp(m, ">:o", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1138 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, yell_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1139 } else if (!strncmp(m, "8-)", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1140 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, smile8_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1141 } else if (!strncmp(m, ":-$", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1142 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, moneymouth_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1143 } else if (!strncmp(m, ":-!", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1144 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, burp_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1145 } else if (!strncmp(m, ":-[", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1146 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, embarrassed_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1147 } else if (!strncmp(m, ":'(", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1148 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, cry_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1149 } else if (!strncmp(m, ":-\\", 3) || |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1150 !strncmp(m, ":-/", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1151 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, think_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1152 } else if (!strncmp(m, ":-X", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1153 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, crossedlips_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1154 } else if (!strncmp(m, ":-D", 3)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1155 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, bigsmile_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1156 } |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1157 |
816
09e9685e24b9
[gaim-migrate @ 826]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
815
diff
changeset
|
1158 if (face || strlen(m) < 4) return face; |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1159 *len = 4; |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1160 if ( !strncmp(m, "O:-)", 4)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1161 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, angel_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1162 } |
551 | 1163 else if (!strncmp(m, "C:-)", 4)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1164 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, luke03_xpm); |
551 | 1165 } |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1166 |
816
09e9685e24b9
[gaim-migrate @ 826]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
815
diff
changeset
|
1167 if (face || strlen(m) < 6) return face; |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1168 *len = 6; |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1169 if ( !strncmp(m, ">:o", 6)) { |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1170 face = gdk_pixmap_create_from_xpm_d(window->window, &mask, trans, yell_xpm); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1171 } |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1172 |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1173 return face; |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1174 } |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
1175 |
602
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
575
diff
changeset
|
1176 void write_html_with_smileys(GtkWidget *window, GtkWidget *html, char *what) |
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
575
diff
changeset
|
1177 { |
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
575
diff
changeset
|
1178 int y = 0; |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1179 char *buf2 = g_strdup(what); |
602
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
575
diff
changeset
|
1180 int i; |
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
575
diff
changeset
|
1181 GdkPixmap *face; |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1182 /* hopefully we can later use this for bgcolors in smileys */ |
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1183 GdkColor *trans = &window->style->base[GTK_STATE_NORMAL]; |
841
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1184 gboolean in_tag = FALSE; |
602
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
575
diff
changeset
|
1185 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1186 for (i = 0; i < strlen(what); i++) |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1187 { |
841
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1188 if (!in_tag) { |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1189 int len; |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1190 if (what[i] == '<') { |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1191 buf2[y] = what[i]; |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1192 y++; |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1193 in_tag = TRUE; |
860
a8633715fb5b
[gaim-migrate @ 870]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
859
diff
changeset
|
1194 } else if ((face = is_smiley(window, &what[i], &len, trans)) != NULL) { |
841
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1195 buf2[y] = 0; |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1196 gtk_html_append_text(GTK_HTML(html), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1197 gtk_html_add_pixmap(GTK_HTML(html), face, 0, 0); |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1198 y = 0; |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1199 i += len - 1; |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1200 } else { |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1201 buf2[y] = what[i]; |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1202 y++; |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1203 } |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1204 } else { |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1205 buf2[y] = what[i]; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1206 y++; |
841
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1207 if (what[i] == '>') |
3b09dd379600
[gaim-migrate @ 851]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
834
diff
changeset
|
1208 in_tag = FALSE; |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1209 } |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1210 } |
602
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
575
diff
changeset
|
1211 |
829
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1212 if (y) |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1213 { |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1214 buf2[y] = 0; |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1215 gtk_html_append_text(GTK_HTML(html), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1216 } |
9a123b171f46
[gaim-migrate @ 839]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
820
diff
changeset
|
1217 g_free(buf2); |
602
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
575
diff
changeset
|
1218 } |
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
575
diff
changeset
|
1219 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1220 /* this is going to be interesting since the conversation could either be a |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1221 * normal IM conversation or a chat window. but hopefully it won't matter */ |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1222 void write_to_conv(struct conversation *c, char *what, int flags, char *who) |
66 | 1223 { |
1224 char *buf = g_malloc(BUF_LONG); | |
636
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
629
diff
changeset
|
1225 char buf2[1024]; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1226 char *str; |
66 | 1227 FILE *fd; |
1228 char colour[10]; | |
636
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
629
diff
changeset
|
1229 int colorv = -1; |
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
629
diff
changeset
|
1230 char *clr; |
389 | 1231 char *smiley = g_malloc(7); |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
738
diff
changeset
|
1232 struct buddy *b; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1233 |
474
7720d0f9da8e
[gaim-migrate @ 484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
473
diff
changeset
|
1234 if (!who) { |
745
d693b83e4933
[gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
1235 if (flags & WFLAG_SEND) { |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1236 b = find_buddy(c->gc, c->gc->username); |
745
d693b83e4933
[gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
1237 if (b) |
d693b83e4933
[gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
1238 who = b->show; |
d693b83e4933
[gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
1239 else |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1240 who = c->gc->username; |
745
d693b83e4933
[gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
1241 } else { |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1242 b = find_buddy(c->gc, c->name); |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
738
diff
changeset
|
1243 if (b) |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
738
diff
changeset
|
1244 who = b->show; |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
738
diff
changeset
|
1245 else |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
738
diff
changeset
|
1246 who = c->name; |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
738
diff
changeset
|
1247 } |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
738
diff
changeset
|
1248 } else { |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1249 b = find_buddy(c->gc, who); |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
738
diff
changeset
|
1250 if (b) |
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
738
diff
changeset
|
1251 who = b->show; |
474
7720d0f9da8e
[gaim-migrate @ 484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
473
diff
changeset
|
1252 } |
337 | 1253 |
66 | 1254 if (flags & WFLAG_SYSTEM) { |
1255 | |
1256 gtk_html_freeze(GTK_HTML(c->text)); | |
1257 | |
1258 gtk_html_append_text(GTK_HTML(c->text), what, 0); | |
337 | 1259 |
1260 gtk_html_append_text(GTK_HTML(c->text), "<BR>", 0); | |
66 | 1261 |
1262 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) { | |
1263 char *t1; | |
699
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1264 char nm[256]; |
66 | 1265 |
1266 if (general_options & OPT_GEN_STRIP_HTML) { | |
1267 t1 = strip_html(what); | |
1268 } else { | |
1269 t1 = what; | |
1270 } | |
699
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1271 if (c->is_chat) |
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1272 g_snprintf(nm, 256, "%s.chat", c->name); |
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1273 else |
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1274 g_snprintf(nm, 256, "%s", c->name); |
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1275 fd = open_log_file(nm); |
1067
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1276 if (fd > 0) { |
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1277 if (general_options & OPT_GEN_STRIP_HTML) { |
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1278 fprintf(fd, "%s\n", t1); |
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1279 } else { |
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1280 fprintf(fd, "%s<BR>\n", t1); |
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1281 } |
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1282 fclose(fd); |
936 | 1283 } |
66 | 1284 if (general_options & OPT_GEN_STRIP_HTML) { |
1285 g_free(t1); | |
1286 } | |
1287 } | |
1288 | |
1289 } else { | |
636
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
629
diff
changeset
|
1290 if ((clr = strstr(what, "<BODY BGCOLOR=\"#")) != NULL) { |
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
629
diff
changeset
|
1291 sscanf(clr + strlen("<BODY BGCOLOR=\"#"), "%x", &colorv); |
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
629
diff
changeset
|
1292 } |
66 | 1293 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1294 if (flags & WFLAG_WHISPER) { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1295 /* if we're whispering, it's not an autoresponse */ |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1296 if (meify(what)) { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1297 str = g_malloc(64); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1298 g_snprintf(str, 62, "***%s", who); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1299 strcpy(colour, "#6C2585\0"); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1300 } else { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1301 str = g_malloc(64); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1302 g_snprintf(str, 62, "*%s*:", who); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1303 strcpy(colour, "#00ff00\0"); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1304 } |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1305 } else { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1306 if (meify(what)) { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1307 str = g_malloc(64); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1308 if (flags & WFLAG_AUTO) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1309 g_snprintf(str, 62, "%s ***%s", AUTO_RESPONSE, who); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1310 else |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1311 g_snprintf(str, 62, "***%s", who); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1312 strcpy(colour, "#062585\0"); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1313 } else { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1314 str = g_malloc(64); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1315 if (flags & WFLAG_AUTO) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1316 g_snprintf(str, 62, "%s %s", who, AUTO_RESPONSE); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1317 else |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1318 g_snprintf(str, 62, "%s:", who); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1319 if (flags & WFLAG_RECV) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1320 strcpy(colour, "#ff0000"); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1321 else if (flags & WFLAG_SEND) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1322 strcpy(colour, "#0000ff"); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1323 } |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1324 } |
66 | 1325 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1326 if (display_options & OPT_DISP_SHOW_TIME) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1327 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s %s</B></FONT> ", colour, date(), str); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1328 else |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1329 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s</B></FONT>", colour, str); |
66 | 1330 |
473
f9bb7761c52b
[gaim-migrate @ 483]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
472
diff
changeset
|
1331 g_free(str); |
f9bb7761c52b
[gaim-migrate @ 483]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
472
diff
changeset
|
1332 |
66 | 1333 gtk_html_freeze(GTK_HTML(c->text)); |
1334 | |
636
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
629
diff
changeset
|
1335 if (colorv != -1) { |
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
629
diff
changeset
|
1336 sprintf(buf2, "<BODY BGCOLOR=\"#%x\">", colorv); |
843
868e7a30b48a
[gaim-migrate @ 853]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
841
diff
changeset
|
1337 gtk_html_append_text(GTK_HTML(c->text), buf2, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); |
636
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
629
diff
changeset
|
1338 } |
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
629
diff
changeset
|
1339 |
849
be8211f068c4
[gaim-migrate @ 859]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
846
diff
changeset
|
1340 gtk_html_append_text(GTK_HTML(c->text), buf, 0); |
337 | 1341 |
1342 if (display_options & OPT_DISP_SHOW_SMILEY) | |
1343 { | |
602
02ea095a972a
[gaim-migrate @ 612]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
575
diff
changeset
|
1344 write_html_with_smileys(c->window, c->text, what); |
337 | 1345 } |
1346 else | |
1347 { | |
1348 gtk_html_append_text(GTK_HTML(c->text), what, (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); | |
1349 } | |
66 | 1350 |
636
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
629
diff
changeset
|
1351 if (colorv != -1) { |
843
868e7a30b48a
[gaim-migrate @ 853]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
841
diff
changeset
|
1352 gtk_html_append_text(GTK_HTML(c->text), "</BODY>", (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); |
636
072200640327
[gaim-migrate @ 646]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
629
diff
changeset
|
1353 } |
843
868e7a30b48a
[gaim-migrate @ 853]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
841
diff
changeset
|
1354 gtk_html_append_text(GTK_HTML(c->text), "<BR>", (display_options & OPT_DISP_IGNORE_COLOUR) ? HTML_OPTION_NO_COLOURS : 0); |
66 | 1355 |
1356 | |
1357 if ((general_options & OPT_GEN_LOG_ALL) || find_log_info(c->name)) { | |
1358 char *t1, *t2; | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1359 char *nm = g_malloc(256); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1360 if (c->is_chat) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1361 g_snprintf(nm, 256, "%s.chat", c->name); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1362 else |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1363 g_snprintf(nm, 256, "%s", c->name); |
66 | 1364 |
1365 if (general_options & OPT_GEN_STRIP_HTML) { | |
1366 t1 = strip_html(buf); | |
1367 t2 = strip_html(what); | |
1368 } else { | |
1103
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
1369 t1 = add_br(buf); |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
1370 t2 = add_br(what); |
66 | 1371 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1372 fd = open_log_file(nm); |
1067
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1373 if (fd > 0) { |
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1374 if (general_options & OPT_GEN_STRIP_HTML) { |
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1375 fprintf(fd, "%s%s\n", t1, t2); |
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1376 } else { |
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1377 fprintf(fd, "%s%s<BR>\n", t1, t2); |
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1378 } |
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1379 fclose(fd); |
936 | 1380 } |
1103
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
1381 g_free(t1); |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
1382 g_free(t2); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1383 g_free(nm); |
66 | 1384 } |
1385 } | |
1386 | |
1387 /* if (!GTK_WIDGET_MAPPED(c->window)) { | |
1388 | |
1389 if (dark_icon_pm == NULL) | |
1390 dark_icon_pm = gdk_pixmap_create_from_xpm_d(c->window->window, &dark_icon_bm, | |
1391 NULL, (gchar **)aimicon2_xpm); | |
1392 gdk_window_set_icon(c->window->window, NULL, dark_icon_pm, dark_icon_bm); | |
1393 } | |
1394 */ | |
1395 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1396 if ((c->is_chat && (general_options & OPT_GEN_POPUP_CHAT)) || |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1397 (!c->is_chat && (general_options & OPT_GEN_POPUP_WINDOWS))) |
81 | 1398 gdk_window_show(c->window->window); |
66 | 1399 |
491
dcf5fe44396a
[gaim-migrate @ 501]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
1400 gtk_html_thaw(GTK_HTML(c->text)); |
dcf5fe44396a
[gaim-migrate @ 501]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
488
diff
changeset
|
1401 |
337 | 1402 g_free(smiley); |
66 | 1403 g_free(buf); |
1404 } | |
1405 | |
1406 | |
1407 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1408 GtkWidget *build_conv_toolbar(struct conversation *c) { |
854 | 1409 GdkPixmap *strike_i, *small_i, *normal_i, *big_i, *bold_i, *italic_i, *underline_i, *speaker_i, *wood_i, *fgcolor_i, *bgcolor_i, *link_i, *font_i, *smiley_i; |
1410 GtkWidget *strike_p, *small_p, *normal_p, *big_p, *bold_p, *italic_p, *underline_p, *speaker_p, *wood_p, *fgcolor_p, *bgcolor_p, *link_p, *font_p, *smiley_p; | |
1411 GtkWidget *strike, *small, *normal, *big, *bold, *italic, *underline, *speaker, *wood, *fgcolorbtn, *bgcolorbtn, *link, *font, *smiley; | |
66 | 1412 GdkBitmap *mask; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1413 GtkWidget *toolbar; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1414 GtkWidget *win; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1415 GtkWidget *entry; |
66 | 1416 |
1417 toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS); | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1418 win = c->window; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1419 entry = c->entry; |
66 | 1420 |
1421 link_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, | |
854 | 1422 &win->style->white, link_xpm ); |
66 | 1423 link_p = gtk_pixmap_new(link_i, mask); |
1424 gtk_widget_show(link_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1425 gdk_bitmap_unref(mask); |
66 | 1426 |
854 | 1427 fgcolor_i = gdk_pixmap_create_from_xpm_d (win->window, &mask, |
1428 &win->style->white, fgcolor_xpm ); | |
1429 fgcolor_p = gtk_pixmap_new(fgcolor_i, mask); | |
1430 gtk_widget_show(fgcolor_p); | |
1431 gdk_bitmap_unref(mask); | |
1432 | |
1433 bgcolor_i = gdk_pixmap_create_from_xpm_d (win->window, &mask, | |
1434 &win->style->white, bgcolor_xpm ); | |
1435 bgcolor_p = gtk_pixmap_new(bgcolor_i, mask); | |
1436 gtk_widget_show(bgcolor_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1437 gdk_bitmap_unref(mask); |
66 | 1438 |
1439 wood_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask, | |
801 | 1440 &win->style->white, wood_xpm ); |
66 | 1441 wood_p = gtk_pixmap_new(wood_i, mask); |
1442 gtk_widget_show(wood_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1443 gdk_bitmap_unref(mask); |
66 | 1444 speaker_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask, |
795 | 1445 &win->style->white, speaker_xpm ); |
66 | 1446 speaker_p = gtk_pixmap_new(speaker_i, mask); |
1447 gtk_widget_show(speaker_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1448 gdk_bitmap_unref(mask); |
66 | 1449 c->makesound=1; |
1450 strike_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask, | |
1451 &win->style->white, strike_xpm ); | |
1452 strike_p = gtk_pixmap_new(strike_i, mask); | |
1453 gtk_widget_show(strike_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1454 gdk_bitmap_unref(mask); |
66 | 1455 bold_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask, |
1456 &win->style->white, bold_xpm ); | |
1457 bold_p = gtk_pixmap_new(bold_i, mask); | |
1458 gtk_widget_show(bold_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1459 gdk_bitmap_unref(mask); |
66 | 1460 italic_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask, |
1461 &win->style->white, italic_xpm ); | |
1462 italic_p = gtk_pixmap_new(italic_i, mask); | |
1463 gtk_widget_show(italic_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1464 gdk_bitmap_unref(mask); |
66 | 1465 underline_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask, |
1466 &win->style->white, underline_xpm ); | |
1467 underline_p = gtk_pixmap_new(underline_i, mask); | |
1468 gtk_widget_show(underline_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1469 gdk_bitmap_unref(mask); |
66 | 1470 small_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask, |
790 | 1471 &win->style->white, small_xpm ); |
66 | 1472 small_p = gtk_pixmap_new(small_i, mask); |
1473 gtk_widget_show(small_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1474 gdk_bitmap_unref(mask); |
66 | 1475 normal_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask, |
795 | 1476 &win->style->white, normal_xpm ); |
66 | 1477 normal_p = gtk_pixmap_new(normal_i, mask); |
1478 gtk_widget_show(normal_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1479 gdk_bitmap_unref(mask); |
66 | 1480 big_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask, |
790 | 1481 &win->style->white, big_xpm ); |
66 | 1482 big_p = gtk_pixmap_new(big_i, mask); |
1483 gtk_widget_show(big_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1484 gdk_bitmap_unref(mask); |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
1485 font_i = gdk_pixmap_create_from_xpm_d ( win->window, &mask, |
876 | 1486 &win->style->white, fontface_xpm ); |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
1487 font_p = gtk_pixmap_new(font_i, mask); |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
1488 gtk_widget_show(font_p); |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1489 gdk_bitmap_unref(mask); |
790 | 1490 smiley_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, smile_icon_xpm); |
555 | 1491 smiley_p = gtk_pixmap_new(smiley_i, mask); |
1492 gtk_widget_show(smiley_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1493 gdk_bitmap_unref(mask); |
66 | 1494 |
1495 bold = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), | |
615 | 1496 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, |
1497 _("Bold"), _("Bold Text"), _("Bold"), bold_p, | |
1498 GTK_SIGNAL_FUNC(do_bold), entry); | |
66 | 1499 italic = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
615 | 1500 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1501 NULL, _("Italics"), _("Italics Text"), |
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1502 _("Italics"), italic_p, GTK_SIGNAL_FUNC(do_italic), entry); |
66 | 1503 underline = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1504 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1505 NULL, _("Underline"), _("Underline Text"), |
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1506 _("Underline"), underline_p, GTK_SIGNAL_FUNC(do_underline), entry); |
66 | 1507 strike = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1508 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1509 NULL, _("Strike"), _("Strike through Text"), |
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1510 _("Strike"), strike_p, GTK_SIGNAL_FUNC(do_strike), entry); |
66 | 1511 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); |
615 | 1512 small = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), |
1513 _("Small"), _("Decrease font size"), _("Small"), | |
1514 small_p, GTK_SIGNAL_FUNC(do_small), entry); | |
1515 normal = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), | |
1516 _("Normal"), _("Normal font size"), _("Normal"), | |
1517 normal_p, GTK_SIGNAL_FUNC(do_normal), entry); | |
1518 big = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), | |
1519 _("Big"), _("Increase font size"), _("Big"), | |
1520 big_p, GTK_SIGNAL_FUNC(do_big), entry); | |
862
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1521 |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1522 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1523 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1524 font = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1525 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1526 NULL, _("Font"), _("Select Font"), |
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1527 _("Font"), font_p, GTK_SIGNAL_FUNC(toggle_font), c); |
862
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1528 fgcolorbtn = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1529 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1530 NULL, _("Color"), _("Text Color"), |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1531 _("Color"), fgcolor_p, GTK_SIGNAL_FUNC(toggle_fg_color), c); |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1532 bgcolorbtn = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1533 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1534 NULL, _("Color"), _("Background Color"), |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1535 _("Color"), bgcolor_p, GTK_SIGNAL_FUNC(toggle_bg_color), c); |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1536 |
66 | 1537 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); |
862
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1538 |
66 | 1539 link = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
615 | 1540 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
611
0f7e5ff95f71
[gaim-migrate @ 621]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
610
diff
changeset
|
1541 NULL, _("Link"), _("Insert Link"), |
862
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1542 _("Link"), link_p, GTK_SIGNAL_FUNC(toggle_link), c); |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1543 smiley = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1544 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1545 NULL, _("Smiley"), _("Insert smiley face"), _("Smiley"), |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1546 smiley_p, GTK_SIGNAL_FUNC(insert_smiley), c); |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1547 |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1548 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1549 |
66 | 1550 wood = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1551 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, | |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1552 NULL, _("Logging"), _("Enable logging"), |
615 | 1553 _("Logging"), wood_p, GTK_SIGNAL_FUNC(toggle_loggle), c); |
66 | 1554 speaker = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
615 | 1555 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1556 NULL, _("Sound"), _("Enable sounds"), |
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1557 _("Sound"), speaker_p, GTK_SIGNAL_FUNC(set_option), &c->makesound); |
66 | 1558 c->makesound=0; |
1559 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(speaker), TRUE); | |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
1560 |
615 | 1561 state_lock = 1; |
66 | 1562 if (find_log_info(c->name)) |
1563 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), TRUE); | |
1564 else | |
1565 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), FALSE); | |
615 | 1566 state_lock = 0; |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1567 |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1568 /* use a slicker look if the user wants to */ |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1569 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1570 { |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1571 gtk_button_set_relief(GTK_BUTTON(strike), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1572 gtk_button_set_relief(GTK_BUTTON(normal), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1573 gtk_button_set_relief(GTK_BUTTON(big), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1574 gtk_button_set_relief(GTK_BUTTON(bold), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1575 gtk_button_set_relief(GTK_BUTTON(italic), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1576 gtk_button_set_relief(GTK_BUTTON(underline), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1577 gtk_button_set_relief(GTK_BUTTON(speaker), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1578 gtk_button_set_relief(GTK_BUTTON(wood), GTK_RELIEF_NONE); |
854 | 1579 gtk_button_set_relief(GTK_BUTTON(fgcolorbtn), GTK_RELIEF_NONE); |
1580 gtk_button_set_relief(GTK_BUTTON(bgcolorbtn), GTK_RELIEF_NONE); | |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1581 gtk_button_set_relief(GTK_BUTTON(link), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1582 gtk_button_set_relief(GTK_BUTTON(font), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1583 gtk_button_set_relief(GTK_BUTTON(small), GTK_RELIEF_NONE); |
555 | 1584 gtk_button_set_relief(GTK_BUTTON(smiley), GTK_RELIEF_NONE); |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1585 } |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1586 |
66 | 1587 gtk_widget_show(toolbar); |
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1588 |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1589 gdk_pixmap_unref(link_i); |
854 | 1590 gdk_pixmap_unref(fgcolor_i); |
1591 gdk_pixmap_unref(bgcolor_i); | |
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1592 gdk_pixmap_unref(wood_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1593 gdk_pixmap_unref(speaker_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1594 gdk_pixmap_unref(strike_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1595 gdk_pixmap_unref(bold_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1596 gdk_pixmap_unref(italic_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1597 gdk_pixmap_unref(underline_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1598 gdk_pixmap_unref(small_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1599 gdk_pixmap_unref(normal_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1600 gdk_pixmap_unref(big_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1601 gdk_pixmap_unref(font_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1602 gdk_pixmap_unref(smiley_i); |
66 | 1603 |
1604 c->bold = bold; | |
1605 c->strike = strike; | |
615 | 1606 c->italic = italic; |
66 | 1607 c->underline = underline; |
615 | 1608 c->log_button = wood; |
854 | 1609 c->fgcolorbtn = fgcolorbtn; |
1610 c->bgcolorbtn = bgcolorbtn; | |
66 | 1611 c->link = link; |
608 | 1612 c->wood = wood; |
308
e5fa88351dc8
[gaim-migrate @ 318]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
1613 c->font = font; |
570 | 1614 c->smiley = smiley; |
66 | 1615 |
615 | 1616 gtk_widget_set_sensitive(c->log_button, ((general_options & OPT_GEN_LOG_ALL)) ? FALSE : TRUE); |
66 | 1617 |
1618 gtk_widget_set_sensitive(c->bold, ((font_options & OPT_FONT_BOLD)) ? FALSE : TRUE); | |
1619 gtk_widget_set_sensitive(c->italic, ((font_options & OPT_FONT_ITALIC)) ? FALSE : TRUE); | |
1620 gtk_widget_set_sensitive(c->underline, ((font_options & OPT_FONT_UNDERLINE)) ? FALSE : TRUE); | |
1621 gtk_widget_set_sensitive(c->strike, ((font_options & OPT_FONT_STRIKE)) ? FALSE : TRUE); | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1622 |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1623 return toolbar; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1624 } |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1625 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1626 static void convo_sel_send(GtkObject *m, struct gaim_connection *c) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1627 { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1628 struct conversation *cnv = gtk_object_get_user_data(m); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1629 cnv->gc = c; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1630 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1631 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1632 void update_convo_add_button(struct conversation *c) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1633 { |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1634 int dispstyle = set_dispstyle(0); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1635 GtkWidget *parent = c->add->parent; |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1636 gtk_widget_destroy(c->add); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1637 |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1638 if (c->gc && find_buddy(c->gc, c->name)) { |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1639 c->add = picture_button2(c->window, _("Remove"), gnome_remove_xpm, dispstyle); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1640 } else { |
1078
3819a5a377b2
[gaim-migrate @ 1088]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1072
diff
changeset
|
1641 c->add = picture_button2(c->window, _("Add"), gnome_add_xpm, dispstyle); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1642 } |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1643 gtk_signal_connect(GTK_OBJECT(c->add), "clicked", GTK_SIGNAL_FUNC(add_callback), c); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1644 gtk_box_pack_end(GTK_BOX(parent), c->add, dispstyle, dispstyle, 0); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1645 gtk_box_reorder_child(GTK_BOX(parent), c->add, 2); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1646 gtk_widget_show(c->add); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1647 } |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1648 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1649 static void create_convo_menu(struct conversation *cnv) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1650 { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1651 GtkWidget *menu, *opt; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1652 GSList *g = connections; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1653 struct gaim_connection *c; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1654 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1655 if (g_slist_length(g) < 2) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1656 gtk_widget_hide(cnv->menu->parent); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1657 else { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1658 menu = gtk_menu_new(); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1659 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1660 while (g) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1661 c = (struct gaim_connection *)g->data; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1662 opt = gtk_menu_item_new_with_label(c->username); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1663 gtk_object_set_user_data(GTK_OBJECT(opt), cnv); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1664 gtk_signal_connect(GTK_OBJECT(opt), "activate", |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1665 GTK_SIGNAL_FUNC(convo_sel_send), c); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1666 gtk_widget_show(opt); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1667 gtk_menu_append(GTK_MENU(menu), opt); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1668 g = g->next; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1669 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1670 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1671 gtk_option_menu_remove_menu(GTK_OPTION_MENU(cnv->menu)); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1672 gtk_option_menu_set_menu(GTK_OPTION_MENU(cnv->menu), menu); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1673 gtk_option_menu_set_history(GTK_OPTION_MENU(cnv->menu), 0); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1674 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1675 gtk_widget_show(cnv->menu); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1676 gtk_widget_show(cnv->menu->parent); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1677 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1678 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1679 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1680 void redo_convo_menus() |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1681 { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1682 GList *c = conversations; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1683 struct conversation *C; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1684 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1685 while (c) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1686 C = (struct conversation *)c->data; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1687 create_convo_menu(C); |
993
eacd93d0089a
[gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1688 |
eacd93d0089a
[gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1689 if (connections) |
eacd93d0089a
[gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1690 C->gc = (struct gaim_connection *)connections->data; |
eacd93d0089a
[gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1691 else |
eacd93d0089a
[gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1692 C->gc = NULL; |
eacd93d0089a
[gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1693 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1694 update_convo_add_button(C); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1695 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1696 c = c->next; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1697 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1698 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1699 |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1700 void show_conv(struct conversation *c) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1701 { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1702 GtkWidget *win; |
615 | 1703 char buf[256]; |
1704 GtkWidget *text; | |
1705 GtkWidget *sw; | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1706 GtkWidget *send; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1707 GtkWidget *info; |
615 | 1708 GtkWidget *warn; |
1709 GtkWidget *block; | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1710 GtkWidget *close; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1711 GtkWidget *entry; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1712 GtkWidget *bbox; |
615 | 1713 GtkWidget *vbox; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1714 GtkWidget *vbox2; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1715 GtkWidget *paned; |
615 | 1716 GtkWidget *add; |
623 | 1717 GtkWidget *toolbar; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1718 GtkWidget *hbox; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1719 GtkWidget *label; |
754 | 1720 int dispstyle; |
1721 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1722 win = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
905 | 1723 gtk_window_set_wmclass(GTK_WINDOW(win), "conversation", "Gaim"); |
615 | 1724 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1725 |
615 | 1726 gtk_widget_realize(win); |
1727 aol_icon(win->window); | |
66 | 1728 |
615 | 1729 c->window = win; |
915
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
1730 |
378c862a2381
[gaim-migrate @ 925]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
909
diff
changeset
|
1731 dispstyle = set_dispstyle(0); |
623 | 1732 |
754 | 1733 send = picture_button2(win, _("Send"), tmp_send_xpm, dispstyle); |
1734 info = picture_button2(win, _("Info"), tb_search_xpm, dispstyle); | |
1735 warn = picture_button2(win, _("Warn"), warn_xpm, dispstyle); | |
1736 close = picture_button2(win, _("Close"), cancel_xpm, dispstyle); | |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1737 if (c->gc && find_buddy(c->gc, c->name) != NULL) |
754 | 1738 add = picture_button2(win, _("Remove"), gnome_remove_xpm, dispstyle); |
615 | 1739 else |
754 | 1740 add = picture_button2(win, _("Add"), gnome_add_xpm, dispstyle); |
1741 block = picture_button2(win, _("Block"), block_xpm, dispstyle); | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1742 |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1743 /* use a slicker look if the user wants to */ |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1744 if (display_options & OPT_DISP_COOL_LOOK) |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1745 { |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1746 gtk_button_set_relief(GTK_BUTTON(send), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1747 gtk_button_set_relief(GTK_BUTTON(info), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1748 gtk_button_set_relief(GTK_BUTTON(warn), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1749 gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1750 gtk_button_set_relief(GTK_BUTTON(add), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1751 gtk_button_set_relief(GTK_BUTTON(block), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1752 } |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1753 |
623 | 1754 bbox = gtk_hbox_new(FALSE, 5); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1755 vbox = gtk_vbox_new(FALSE, 0); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1756 vbox2 = gtk_vbox_new(FALSE, 0); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1757 paned = gtk_vpaned_new(); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1758 |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1759 gtk_paned_pack1(GTK_PANED(paned), vbox, FALSE, TRUE); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1760 gtk_paned_pack2(GTK_PANED(paned), vbox2, FALSE, FALSE); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1761 gtk_widget_show(vbox2); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1762 gtk_widget_show(paned); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1763 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1764 hbox = gtk_hbox_new(FALSE, 0); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1765 gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1766 gtk_widget_show(hbox); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1767 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1768 label = gtk_label_new(_("Send message as: ")); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1769 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1770 gtk_widget_show(label); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1771 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1772 c->menu = gtk_option_menu_new(); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1773 gtk_box_pack_start(GTK_BOX(hbox), c->menu, FALSE, FALSE, 5); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1774 gtk_widget_show(c->menu); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1775 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1776 create_convo_menu(c); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1777 |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1778 entry = gtk_text_new(NULL, NULL); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1779 gtk_text_set_editable(GTK_TEXT(entry), TRUE); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1780 gtk_text_set_word_wrap(GTK_TEXT(entry), TRUE); |
66 | 1781 gtk_object_set_user_data(GTK_OBJECT(entry), c); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1782 c->entry = entry; |
615 | 1783 gtk_signal_connect(GTK_OBJECT(entry), "activate", GTK_SIGNAL_FUNC(send_callback),c); |
1784 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1785 /* Toolbar */ |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1786 toolbar = build_conv_toolbar(c); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1787 |
615 | 1788 /* Text box */ |
1789 text = gtk_html_new(NULL, NULL); | |
66 | 1790 gtk_html_set_editable(GTK_HTML(text), FALSE); |
623 | 1791 /* |
1792 gtk_html_set_transparent(GTK_HTML(text), (transparent) ? TRUE : FALSE); | |
1793 */ | |
1794 | |
615 | 1795 c->text = text; |
66 | 1796 |
615 | 1797 sw = gtk_scrolled_window_new (NULL, NULL); |
623 | 1798 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), |
1799 GTK_POLICY_NEVER, | |
624 | 1800 GTK_POLICY_ALWAYS); |
615 | 1801 gtk_widget_show(sw); |
1802 gtk_container_add(GTK_CONTAINER(sw), text); | |
1803 gtk_widget_show(text); | |
1804 | |
1805 GTK_HTML (text)->hadj->step_increment = 10.0; | |
1806 GTK_HTML (text)->vadj->step_increment = 10.0; | |
1807 gtk_widget_set_usize(sw, 320, 150); | |
66 | 1808 |
1809 /* Ready and pack buttons */ | |
1810 gtk_object_set_user_data(GTK_OBJECT(win), c); | |
1811 gtk_object_set_user_data(GTK_OBJECT(close), c); | |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1812 c->close = close; |
66 | 1813 gtk_signal_connect(GTK_OBJECT(close), "clicked", GTK_SIGNAL_FUNC(close_callback), c); |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1814 c->send = send; |
66 | 1815 gtk_signal_connect(GTK_OBJECT(send), "clicked", GTK_SIGNAL_FUNC(send_callback), c); |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1816 c->add = add; |
66 | 1817 gtk_signal_connect(GTK_OBJECT(add), "clicked", GTK_SIGNAL_FUNC(add_callback), c); |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1818 c->info = info; |
615 | 1819 gtk_signal_connect(GTK_OBJECT(info), "clicked", GTK_SIGNAL_FUNC(info_callback), c); |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1820 c->warn = warn; |
615 | 1821 gtk_signal_connect(GTK_OBJECT(warn), "clicked", GTK_SIGNAL_FUNC(warn_callback), c); |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1822 c->block = block; |
615 | 1823 gtk_signal_connect(GTK_OBJECT(block), "clicked", GTK_SIGNAL_FUNC(block_callback), c); |
66 | 1824 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1825 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(keypress_callback), c); |
864 | 1826 |
1827 if (display_options & OPT_DISP_CONV_BIG_ENTRY) | |
1828 gtk_widget_set_usize(entry, 300, 50); | |
1829 else | |
1830 gtk_widget_set_usize(entry, 300, 25); | |
66 | 1831 |
754 | 1832 gtk_box_pack_end(GTK_BOX(bbox), close, dispstyle, dispstyle, 0); |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1833 c->sep1 = gtk_vseparator_new(); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1834 gtk_widget_show(c->sep1); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1835 gtk_box_pack_end(GTK_BOX(bbox), c->sep1, dispstyle, dispstyle, 0); |
754 | 1836 gtk_box_pack_end(GTK_BOX(bbox), add, dispstyle, dispstyle, 0); |
1837 gtk_box_pack_end(GTK_BOX(bbox), block, dispstyle, dispstyle, 0); | |
1838 gtk_box_pack_end(GTK_BOX(bbox), warn, dispstyle, dispstyle, 0); | |
1839 gtk_box_pack_end(GTK_BOX(bbox), info, dispstyle, dispstyle, 0); | |
909
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1840 c->sep2 = gtk_vseparator_new(); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1841 gtk_widget_show(c->sep2); |
9f2afe5faed5
[gaim-migrate @ 919]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
907
diff
changeset
|
1842 gtk_box_pack_end(GTK_BOX(bbox), c->sep2, dispstyle, dispstyle, 0); |
754 | 1843 gtk_box_pack_end(GTK_BOX(bbox), send, dispstyle, dispstyle, 0); |
66 | 1844 |
1845 /* pack and fill the rest */ | |
1846 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 5); | |
615 | 1847 gtk_box_pack_start(GTK_BOX(vbox2), toolbar, FALSE, FALSE, 5); |
81 | 1848 gtk_box_pack_start(GTK_BOX(vbox2), entry, TRUE, TRUE, 5); |
1849 gtk_box_pack_start(GTK_BOX(vbox2), bbox, FALSE, FALSE, 5); | |
66 | 1850 |
1851 gtk_widget_show(send); | |
1852 gtk_widget_show(info); | |
1853 gtk_widget_show(warn); | |
1854 gtk_widget_show(close); | |
615 | 1855 gtk_widget_show(add); |
1856 gtk_widget_show(block); | |
66 | 1857 gtk_widget_show(bbox); |
1858 gtk_widget_show(vbox); | |
1859 gtk_widget_show(entry); | |
1860 gtk_widget_show(text); | |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1861 |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1862 c->font_dialog = NULL; |
858
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1863 c->fg_color_dialog = NULL; |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1864 c->bg_color_dialog = NULL; |
570 | 1865 c->smiley_dialog = NULL; |
608 | 1866 c->link_dialog = NULL; |
1867 c->log_dialog = NULL; | |
687
02ef523db170
[gaim-migrate @ 697]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
1868 sprintf(c->fontface, "%s", fontface); |
688
6b1345121dd3
[gaim-migrate @ 698]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
687
diff
changeset
|
1869 c->hasfont = 0; |
687
02ef523db170
[gaim-migrate @ 697]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
1870 c->bgcol = bgcolor; |
699
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1871 c->hasbg = 0; |
687
02ef523db170
[gaim-migrate @ 697]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
1872 c->fgcol = fgcolor; |
699
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1873 c->hasfg = 0; |
67 | 1874 |
81 | 1875 gtk_container_add(GTK_CONTAINER(win), paned); |
66 | 1876 gtk_container_border_width(GTK_CONTAINER(win), 10); |
1877 | |
1878 if ((find_log_info(c->name)) || ((general_options & OPT_GEN_LOG_ALL))) | |
1879 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, c->name); | |
1880 else | |
1881 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, c->name); | |
1882 gtk_window_set_title(GTK_WINDOW(win), buf); | |
1883 gtk_window_set_focus(GTK_WINDOW(win),entry); | |
1884 | |
1885 gtk_signal_connect(GTK_OBJECT(win), "delete_event", GTK_SIGNAL_FUNC(delete_event_convo), c); | |
1886 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed), entry); | |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1887 if (general_options & OPT_GEN_CHECK_SPELLING) |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1888 gtkspell_attach(GTK_TEXT(c->entry)); |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
1889 |
66 | 1890 gtk_widget_show(win); |
1891 } | |
1892 | |
1893 | |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1894 void toggle_spellchk() { |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1895 GList *cnv = conversations; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1896 GSList *cht; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1897 struct conversation *c; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1898 GSList *con = connections; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1899 struct gaim_connection *gc; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1900 |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1901 while (cnv) { |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1902 c = (struct conversation *)cnv->data; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1903 if (general_options & OPT_GEN_CHECK_SPELLING) |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1904 gtkspell_attach(GTK_TEXT(c->entry)); |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1905 else |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1906 gtkspell_detach(GTK_TEXT(c->entry)); |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1907 cnv = cnv->next; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1908 } |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1909 |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1910 while (con) { |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1911 gc = (struct gaim_connection *)con->data; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1912 cht = gc->buddy_chats; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1913 while (cht) { |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1914 c = (struct conversation *)cht->data; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1915 if (general_options & OPT_GEN_CHECK_SPELLING) |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1916 gtkspell_attach(GTK_TEXT(c->entry)); |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1917 else |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1918 gtkspell_detach(GTK_TEXT(c->entry)); |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1919 cht = cht->next; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1920 } |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1921 con = con->next; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1922 } |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
1923 } |