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