Mercurial > pidgin
annotate src/conversation.c @ 2483:e73ca8d8d358
[gaim-migrate @ 2496]
fine.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 11 Oct 2001 07:49:02 +0000 |
parents | 049822b93239 |
children | 43a75ca5b909 |
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 |
2090
b66aca8e8dce
[gaim-migrate @ 2100]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2048
diff
changeset
|
23 #include <config.h> |
349
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> | |
2123
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
32 #include <errno.h> |
210
ec0686b3b03f
[gaim-migrate @ 220]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
209
diff
changeset
|
33 #include <ctype.h> |
66 | 34 #include <gtk/gtk.h> |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
35 #include "gtkimhtml.h" |
66 | 36 #include <gdk/gdkkeysyms.h> |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
37 #include "convo.h" |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
38 #include "gtkspell.h" |
1235
a9cf2f61a7b1
[gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1228
diff
changeset
|
39 #include "prpl.h" |
337 | 40 |
604
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" |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
43 #include "pixmaps/underline.xpm" |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
44 #include "pixmaps/strike.xpm" |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
45 #include "pixmaps/small.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
46 #include "pixmaps/normal.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
47 #include "pixmaps/big.xpm" |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
48 #include "pixmaps/fontface.xpm" |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
49 #include "pixmaps/fgcolor.xpm" |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
50 #include "pixmaps/bgcolor.xpm" |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
51 #include "pixmaps/link.xpm" |
790 | 52 #include "pixmaps/smile_icon.xpm" |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
53 #include "pixmaps/wood.xpm" |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
54 #include "pixmaps/save_small.xpm" |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
55 #include "pixmaps/speaker.xpm" |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
56 |
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
57 #include "pixmaps/luke03.xpm" |
610
cadb51c068cb
[gaim-migrate @ 620]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
608
diff
changeset
|
58 #include "pixmaps/oneeye.xpm" |
1732
e5ba877f51f2
[gaim-migrate @ 1742]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1709
diff
changeset
|
59 #include "pixmaps/crazy4.xpm" |
1965 | 60 #include "pixmaps/mrt.xpm" |
2426 | 61 #include "pixmaps/download.xpm" |
604
0b1a132e0f75
[gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
602
diff
changeset
|
62 |
2460
049822b93239
[gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2449
diff
changeset
|
63 static gchar *ispell_cmd[] = { "ispell", "-a", NULL }; |
049822b93239
[gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2449
diff
changeset
|
64 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
65 int state_lock = 0; |
66 | 66 |
67 GdkPixmap *dark_icon_pm = NULL; | |
68 GdkBitmap *dark_icon_bm = NULL; | |
69 | |
1608
e19a2cb4190c
[gaim-migrate @ 1618]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1597
diff
changeset
|
70 GtkWidget *all_convos = NULL; |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
71 static GtkWidget *convo_notebook = NULL; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
72 |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
73 char fontface[64]; |
1441
5c67b8794991
[gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1440
diff
changeset
|
74 int fontsize = 3; |
885
db5f5c33e83f
[gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
876
diff
changeset
|
75 extern GdkColor bgcolor; |
db5f5c33e83f
[gaim-migrate @ 895]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
876
diff
changeset
|
76 extern GdkColor fgcolor; |
66 | 77 |
78 void check_everything(GtkWidget *entry); | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
79 gboolean keypress_callback(GtkWidget *entry, GdkEventKey * event, struct conversation *c); |
66 | 80 |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
81 static void update_icon(struct conversation *); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
82 static void remove_icon(struct conversation *); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
83 |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
84 static void update_checkbox(struct conversation *); |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
85 static void remove_checkbox(struct conversation *); |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
86 |
66 | 87 /*------------------------------------------------------------------------*/ |
88 /* Helpers */ | |
89 /*------------------------------------------------------------------------*/ | |
90 | |
91 | |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
92 void gaim_setup_imhtml(GtkWidget *imhtml) |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
93 { |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
94 g_return_if_fail(imhtml != NULL); |
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
95 g_return_if_fail(GTK_IS_IMHTML(imhtml)); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
96 if (!(convo_options & OPT_CONVO_SHOW_SMILEY)) |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
97 gtk_imhtml_show_smileys(GTK_IMHTML(imhtml), FALSE); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
98 gtk_signal_connect(GTK_OBJECT(imhtml), "url_clicked", GTK_SIGNAL_FUNC(open_url_nw), NULL); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
99 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:)", luke03_xpm); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
100 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "C:-)", luke03_xpm); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
101 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "O-)", oneeye_xpm); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
102 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ">:)", crazy4_xpm); |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
103 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ">:-)", crazy4_xpm); |
1965 | 104 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-o)))", mrt_xpm); |
105 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), ":-O)))", mrt_xpm); | |
2426 | 106 gtk_imhtml_associate_smiley(GTK_IMHTML(imhtml), "8-|)", download_xpm); |
1780
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
107 } |
d7cbedd1d651
[gaim-migrate @ 1790]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1772
diff
changeset
|
108 |
66 | 109 void quiet_set(GtkWidget *tb, int state) |
110 { | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
111 state_lock = 1; |
66 | 112 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(tb), state); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
113 state_lock = 0; |
66 | 114 } |
115 | |
116 | |
117 void set_state_lock(int i) | |
118 { | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
119 state_lock = i; |
66 | 120 } |
121 | |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
122 void toggle_sensitive(GtkWidget *widget, GtkWidget *to_toggle) |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
123 { |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
124 gboolean sensitivity = GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(to_toggle)); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
125 |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
126 if (sensitivity == TRUE) |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
127 gtk_widget_set_sensitive(GTK_WIDGET(to_toggle), FALSE); |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
128 else |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
129 gtk_widget_set_sensitive(GTK_WIDGET(to_toggle), TRUE); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
130 |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
131 return; |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
132 } |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
133 |
66 | 134 struct conversation *new_conversation(char *name) |
135 { | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
136 struct conversation *c; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
137 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
138 c = find_conversation(name); |
66 | 139 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
140 if (c != NULL) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
141 return c; |
66 | 142 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
143 c = (struct conversation *)g_new0(struct conversation, 1); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
144 g_snprintf(c->name, sizeof(c->name), "%s", name); |
66 | 145 |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
146 if ((logging_options & OPT_LOG_ALL) || find_log_info(c->name)) { |
66 | 147 FILE *fd; |
70 | 148 |
373
1d29321843b0
[gaim-migrate @ 383]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
363
diff
changeset
|
149 fd = open_log_file(c->name); |
2004
699ddd727a49
[gaim-migrate @ 2014]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1970
diff
changeset
|
150 if (fd) { |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
151 if (!(logging_options & OPT_LOG_STRIP_HTML)) |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
152 fprintf(fd, |
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
153 "<HR><BR><H3 Align=Center> ---- New Conversation @ %s ----</H3><BR>\n", |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
154 full_date()); |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
155 else |
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
156 fprintf(fd, " ---- New Conversation @ %s ----\n", full_date()); |
1034
1d43fda97960
[gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
157 fclose(fd); |
1d43fda97960
[gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
158 } else |
1d43fda97960
[gaim-migrate @ 1044]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1032
diff
changeset
|
159 /* do we want to do something here? */ ; |
66 | 160 } |
161 | |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
162 if (connections) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
163 c->gc = (struct gaim_connection *)connections->data; |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
164 c->history = g_string_new(""); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
165 conversations = g_list_append(conversations, c); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
166 show_conv(c); |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
167 update_icon(c); |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
168 update_checkbox(c); |
1000
91b7377e7b45
[gaim-migrate @ 1010]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
998
diff
changeset
|
169 plugin_event(event_new_conversation, name, 0, 0, 0); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
170 return c; |
66 | 171 } |
172 | |
173 | |
174 struct conversation *find_conversation(char *name) | |
175 { | |
2138
cfa83a1b3d49
[gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2124
diff
changeset
|
176 char *cuser = g_malloc(1024); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
177 struct conversation *c; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
178 GList *cnv = conversations; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
179 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
180 strcpy(cuser, normalize(name)); |
66 | 181 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
182 while (cnv) { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
183 c = (struct conversation *)cnv->data; |
2048
3366311426df
[gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2017
diff
changeset
|
184 if (!g_strcasecmp(cuser, normalize(c->name))) { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
185 g_free(cuser); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
186 return c; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
187 } |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
188 cnv = cnv->next; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
189 } |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
190 g_free(cuser); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
191 return NULL; |
66 | 192 } |
193 | |
194 /* --------------------------------------------------- | |
195 * Function to remove a log file entry | |
196 * --------------------------------------------------- | |
197 */ | |
198 | |
199 void rm_log(struct log_conversation *a) | |
200 { | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
201 struct conversation *cnv = find_conversation(a->name); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
202 char buf[128]; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
203 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
204 log_conversations = g_list_remove(log_conversations, a); |
66 | 205 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
206 save_prefs(); |
66 | 207 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
208 if (cnv) { |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
209 if (!(logging_options & OPT_LOG_ALL)) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
210 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, cnv->name); |
66 | 211 else |
212 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, cnv->name); | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
213 if (!(im_options & OPT_IM_ONE_WINDOW)) |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
214 gtk_window_set_title(GTK_WINDOW(cnv->window), buf); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
215 } |
66 | 216 } |
217 | |
218 struct log_conversation *find_log_info(char *name) | |
219 { | |
2138
cfa83a1b3d49
[gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2124
diff
changeset
|
220 char *pname = g_malloc(1024); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
221 GList *lc = log_conversations; |
66 | 222 struct log_conversation *l; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
223 |
66 | 224 |
225 strcpy(pname, normalize(name)); | |
226 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
227 while (lc) { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
228 l = (struct log_conversation *)lc->data; |
2048
3366311426df
[gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2017
diff
changeset
|
229 if (!g_strcasecmp(pname, normalize(l->name))) { |
66 | 230 g_free(pname); |
231 return l; | |
232 } | |
233 lc = lc->next; | |
234 } | |
235 g_free(pname); | |
236 return NULL; | |
237 } | |
238 | |
625
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
239 void delete_conversation(struct conversation *c) |
66 | 240 { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
241 conversations = g_list_remove(conversations, c); |
858
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
242 if (c->fg_color_dialog) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
243 gtk_widget_destroy(c->fg_color_dialog); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
244 if (c->bg_color_dialog) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
245 gtk_widget_destroy(c->bg_color_dialog); |
625
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
246 if (c->font_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
247 gtk_widget_destroy(c->font_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
248 if (c->smiley_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
249 gtk_widget_destroy(c->smiley_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
250 if (c->link_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
251 gtk_widget_destroy(c->link_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
252 if (c->log_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
253 gtk_widget_destroy(c->log_dialog); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
254 g_string_free(c->history, TRUE); |
625
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
255 g_free(c); |
66 | 256 } |
257 | |
258 void update_log_convs() | |
259 { | |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
260 GSList *C = connections; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
261 struct gaim_connection *g; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
262 GSList *bcs; |
66 | 263 GList *cnv = conversations; |
264 struct conversation *c; | |
265 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
266 while (cnv) { |
66 | 267 c = (struct conversation *)cnv->data; |
268 | |
269 if (c->log_button) | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
270 gtk_widget_set_sensitive(c->log_button, |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
271 ((logging_options & OPT_LOG_ALL)) ? FALSE : TRUE); |
66 | 272 |
273 cnv = cnv->next; | |
274 } | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
275 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
276 while (C) { |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
277 g = (struct gaim_connection *)C->data; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
278 bcs = g->buddy_chats; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
279 while (bcs) { |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
280 c = (struct conversation *)bcs->data; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
281 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
282 if (c->log_button) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
283 gtk_widget_set_sensitive(c->log_button, |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
284 ((logging_options & OPT_LOG_ALL)) ? FALSE : |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
285 TRUE); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
286 |
964
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
287 bcs = bcs->next; |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
288 } |
2cd7b73e2c9a
[gaim-migrate @ 974]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
960
diff
changeset
|
289 C = C->next; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
290 } |
66 | 291 } |
292 | |
293 void update_font_buttons() | |
294 { | |
295 GList *cnv = conversations; | |
296 struct conversation *c; | |
297 | |
298 while (cnv) { | |
299 c = (struct conversation *)cnv->data; | |
300 | |
301 if (c->bold) | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
302 gtk_widget_set_sensitive(c->bold, |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
303 ((font_options & OPT_FONT_BOLD)) ? FALSE : TRUE); |
66 | 304 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
305 if (c->italic) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
306 gtk_widget_set_sensitive(c->italic, |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
307 ((font_options & OPT_FONT_ITALIC)) ? FALSE : TRUE); |
66 | 308 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
309 if (c->underline) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
310 gtk_widget_set_sensitive(c->underline, |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
311 ((font_options & OPT_FONT_UNDERLINE)) ? FALSE : TRUE); |
66 | 312 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
313 if (c->strike) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
314 gtk_widget_set_sensitive(c->strike, |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
315 ((font_options & OPT_FONT_STRIKE)) ? FALSE : TRUE); |
66 | 316 |
317 cnv = cnv->next; | |
318 } | |
319 } | |
320 | |
321 /* | |
322 void update_transparency() | |
323 { | |
324 GList *cnv = conversations; | |
325 struct conversation *c; | |
326 | |
327 This func should be uncalled! | |
328 | |
329 while(cnv) { | |
330 c = (struct conversation *)cnv->data; | |
331 | |
332 if (c->text) | |
333 gtk_html_set_transparent(GTK_HTML(c->text), | |
334 (transparent) ? TRUE : FALSE); | |
335 | |
336 cnv = cnv->next; | |
337 } | |
338 } | |
339 */ | |
340 | |
341 | |
342 /*------------------------------------------------------------------------*/ | |
343 /* Callbacks */ | |
344 /*------------------------------------------------------------------------*/ | |
345 | |
608 | 346 void toggle_loggle(GtkWidget *loggle, struct conversation *c) |
66 | 347 { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
348 if (state_lock) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
349 return; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
350 if (find_log_info(c->name)) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
351 rm_log(find_log_info(c->name)); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
352 else if (GTK_TOGGLE_BUTTON(loggle)->active) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
353 show_log_dialog(c); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
354 else |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
355 cancel_log(NULL, c); |
66 | 356 } |
357 | |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
358 static void do_save_convo(GtkObject *obj, GtkWidget *wid) |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
359 { |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
360 struct conversation *c = gtk_object_get_user_data(obj); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
361 char *filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(wid)); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
362 FILE *f; |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
363 if (file_is_dir(filename, wid)) |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
364 return; |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
365 if (g_list_find(conversations, c)) |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
366 filename = g_strdup(filename); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
367 else |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
368 filename = NULL; |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
369 gtk_widget_destroy(wid); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
370 if (!filename) |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
371 return; |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
372 f = fopen(filename, "w+"); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
373 g_free(filename); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
374 if (!f) |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
375 return; |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
376 fprintf(f, "%s", c->history->str); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
377 fclose(f); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
378 } |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
379 |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
380 void save_convo(GtkWidget *save, struct conversation *c) |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
381 { |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
382 char buf[BUF_LONG]; |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
383 GtkWidget *window = gtk_file_selection_new(_("Gaim - Save Conversation")); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
384 g_snprintf(buf, sizeof(buf), "%s/%s.log", g_get_home_dir(), normalize(c->name)); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
385 gtk_file_selection_set_filename(GTK_FILE_SELECTION(window), buf); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
386 gtk_object_set_user_data(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button), c); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
387 gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button), |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
388 "clicked", GTK_SIGNAL_FUNC(do_save_convo), window); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
389 gtk_signal_connect_object(GTK_OBJECT(GTK_FILE_SELECTION(window)->cancel_button), |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
390 "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), (gpointer)window); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
391 gtk_widget_show(window); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
392 } |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
393 |
570 | 394 void insert_smiley(GtkWidget *smiley, struct conversation *c) |
555 | 395 { |
396 if (state_lock) | |
397 return; | |
570 | 398 if (GTK_TOGGLE_BUTTON(smiley)->active) |
399 show_smiley_dialog(c, smiley); | |
400 else if (c->smiley_dialog) | |
401 close_smiley_dialog(smiley, c); | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
402 |
555 | 403 return; |
404 } | |
405 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
406 int close_callback(GtkWidget *widget, struct conversation *c) |
66 | 407 { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
408 if (c->is_chat && (widget == c->close) && !(chat_options & OPT_CHAT_ONE_WINDOW)) { |
814
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
409 GtkWidget *tmp = c->window; |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1244
diff
changeset
|
410 debug_printf("chat clicked close button\n"); |
814
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
411 c->window = NULL; |
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
412 gtk_widget_destroy(tmp); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
413 return FALSE; |
814
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
414 } |
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
415 |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1244
diff
changeset
|
416 debug_printf("conversation close callback\n"); |
814
a636ac51d15b
[gaim-migrate @ 824]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
808
diff
changeset
|
417 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
418 if (convo_options & OPT_CONVO_CHECK_SPELLING) |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
419 gtkspell_detach(GTK_TEXT(c->entry)); |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
420 |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
421 if (!c->is_chat) { |
2246
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2245
diff
changeset
|
422 GSList *cn = connections; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2245
diff
changeset
|
423 while (cn) { |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2245
diff
changeset
|
424 struct gaim_connection *gc = cn->data; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2245
diff
changeset
|
425 cn = cn->next; |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2245
diff
changeset
|
426 if (gc->prpl->convo_closed) |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2245
diff
changeset
|
427 (*gc->prpl->convo_closed)(gc, c->name); |
933346315b9b
[gaim-migrate @ 2256]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2245
diff
changeset
|
428 } |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
429 remove_icon(c); |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
430 remove_checkbox(c); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
431 if (im_options & OPT_IM_ONE_WINDOW) { |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
432 if (g_list_length(conversations) > 1) { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
433 gtk_notebook_remove_page(GTK_NOTEBOOK(convo_notebook), |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
434 g_list_index(conversations, c)); |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
435 } else { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
436 if (c->window) |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
437 gtk_widget_destroy(c->window); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
438 c->window = NULL; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
439 all_convos = NULL; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
440 convo_notebook = NULL; |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
441 } |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
442 } else { |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
443 if (c->window) |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
444 gtk_widget_destroy(c->window); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
445 c->window = NULL; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
446 } |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
447 } else { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
448 if (chat_options & OPT_CHAT_ONE_WINDOW) { |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
449 if (g_list_length(chats) > 1) { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
450 gtk_notebook_remove_page(GTK_NOTEBOOK(chat_notebook), |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
451 g_list_index(chats, c)); |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
452 } else { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
453 if (c->window) |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
454 gtk_widget_destroy(c->window); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
455 c->window = NULL; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
456 all_chats = NULL; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
457 chat_notebook = NULL; |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
458 } |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
459 } else { |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
460 if (c->window) |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
461 gtk_widget_destroy(c->window); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
462 c->window = NULL; |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
463 } |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
464 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
465 |
858
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
466 if (c->fg_color_dialog) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
467 gtk_widget_destroy(c->fg_color_dialog); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
468 c->fg_color_dialog = NULL; |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
469 if (c->bg_color_dialog) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
470 gtk_widget_destroy(c->bg_color_dialog); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
471 c->bg_color_dialog = NULL; |
625
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
472 if (c->font_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
473 gtk_widget_destroy(c->font_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
474 c->font_dialog = NULL; |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
475 if (c->smiley_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
476 gtk_widget_destroy(c->smiley_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
477 c->smiley_dialog = NULL; |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
478 if (c->link_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
479 gtk_widget_destroy(c->link_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
480 c->link_dialog = NULL; |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
481 if (c->log_dialog) |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
482 gtk_widget_destroy(c->log_dialog); |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
483 c->log_dialog = NULL; |
ea41ca1658b5
[gaim-migrate @ 635]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
624
diff
changeset
|
484 |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
502
diff
changeset
|
485 if (c->is_chat) { |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
486 chats = g_list_remove(chats, c); |
1063
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
487 if (c->gc) |
e1408fb04c36
[gaim-migrate @ 1073]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1034
diff
changeset
|
488 serv_chat_leave(c->gc, c->id); |
2017
eee309c0de93
[gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2004
diff
changeset
|
489 else |
eee309c0de93
[gaim-migrate @ 2027]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2004
diff
changeset
|
490 delete_chat(c); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
502
diff
changeset
|
491 } else { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
492 delete_conversation(c); |
511
3133ab511d92
[gaim-migrate @ 521]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
502
diff
changeset
|
493 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
494 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
495 return TRUE; |
66 | 496 } |
497 | |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
498 void set_font_face(char *newfont, struct conversation *c) |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
499 { |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
500 char *pre_fontface; |
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
501 int alloc = 1; |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
502 |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
503 pre_fontface = g_strconcat("<FONT FACE=\"", newfont, "\">", '\0'); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
504 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
505 if (!strcmp(pre_fontface, "<FONT FACE=\"\">")) { |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
506 g_free(pre_fontface); |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
507 alloc--; |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
508 pre_fontface = "<FONT FACE=\"Helvetica\">"; |
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
509 } |
275
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
510 |
687
02ef523db170
[gaim-migrate @ 697]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
666
diff
changeset
|
511 sprintf(c->fontface, "%s", newfont ? (newfont[0] ? newfont : "Helvetica") : "Helvetica"); |
688
6b1345121dd3
[gaim-migrate @ 698]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
687
diff
changeset
|
512 c->hasfont = 1; |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
513 surround(c->entry, pre_fontface, "</FONT>"); |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
514 gtk_widget_grab_focus(c->entry); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
515 |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
516 if (alloc) |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
517 g_free(pre_fontface); |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
518 } |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
519 |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
520 static gint delete_all_convo(GtkWidget *w, GdkEventAny *e, gpointer d) |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
521 { |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
522 while (conversations) { |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
523 struct conversation *c = conversations->data; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
524 close_callback(c->close, c); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
525 } |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
526 return FALSE; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
527 } |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
528 |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
529 static gint delete_event_convo(GtkWidget *w, GdkEventAny *e, struct conversation *c) |
66 | 530 { |
531 delete_conversation(c); | |
532 return FALSE; | |
533 } | |
534 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
535 void add_callback(GtkWidget *widget, struct conversation *c) |
66 | 536 { |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
537 if (c->gc && find_buddy(c->gc, c->name) != NULL) { |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1244
diff
changeset
|
538 debug_printf(_("Removing '%s' from buddylist.\n"), c->name); |
2334
b53cd5b63a99
[gaim-migrate @ 2347]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
539 serv_remove_buddy(c->gc, c->name); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
540 remove_buddy(c->gc, find_group_by_buddy(c->gc, c->name), find_buddy(c->gc, c->name)); |
2334
b53cd5b63a99
[gaim-migrate @ 2347]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2323
diff
changeset
|
541 do_export(c->gc); |
66 | 542 build_edit_tree(); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
543 update_convo_add_button(c); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
544 } else { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
545 if (c->gc) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
546 show_add_buddy(c->gc, c->name, NULL); |
66 | 547 } |
548 | |
549 gtk_widget_grab_focus(c->entry); | |
550 } | |
551 | |
552 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
553 void block_callback(GtkWidget *widget, struct conversation *c) |
66 | 554 { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
555 if (c->gc) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
556 show_add_perm(c->gc, c->name, FALSE); |
66 | 557 gtk_widget_grab_focus(c->entry); |
558 } | |
559 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
560 void warn_callback(GtkWidget *widget, struct conversation *c) |
66 | 561 { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
562 show_warn_dialog(c->gc, c->name); |
66 | 563 gtk_widget_grab_focus(c->entry); |
564 } | |
565 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
566 void info_callback(GtkWidget *w, struct conversation *c) |
66 | 567 { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
568 if (c->is_chat) { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
569 char *name; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
570 GList *i; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
571 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
572 i = GTK_LIST(c->list)->selection; |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
573 if (i) { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
574 name = (char *)gtk_object_get_user_data(GTK_OBJECT(i->data)); |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
575 } else { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
576 return; |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
577 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
578 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
579 serv_get_info(c->gc, name); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
580 } else { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
581 serv_get_info(c->gc, c->name); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
582 gtk_widget_grab_focus(c->entry); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
583 } |
66 | 584 } |
585 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
586 gboolean keypress_callback(GtkWidget *entry, GdkEventKey * event, struct conversation *c) |
66 | 587 { |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
588 int pos; |
1411
a3e472534370
[gaim-migrate @ 1421]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1403
diff
changeset
|
589 if (event->keyval == GDK_Escape) { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
590 if (convo_options & OPT_CONVO_ESC_CAN_CLOSE) { |
1411
a3e472534370
[gaim-migrate @ 1421]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1403
diff
changeset
|
591 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
1464
ae075ecc7c34
[gaim-migrate @ 1474]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1456
diff
changeset
|
592 close_callback(c->close, c); |
1411
a3e472534370
[gaim-migrate @ 1421]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1403
diff
changeset
|
593 } |
2363
08c66712364c
[gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2345
diff
changeset
|
594 } else if (event->keyval == GDK_Page_Up) { |
08c66712364c
[gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2345
diff
changeset
|
595 gtk_imhtml_page_up(GTK_IMHTML(c->text)); |
08c66712364c
[gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2345
diff
changeset
|
596 } else if (event->keyval == GDK_Page_Down) { |
08c66712364c
[gaim-migrate @ 2376]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2345
diff
changeset
|
597 gtk_imhtml_page_down(GTK_IMHTML(c->text)); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
598 } else if ((event->keyval == GDK_F2) && (convo_options & OPT_CONVO_F2_TOGGLES)) { |
1455
d113c7e2c5f1
[gaim-migrate @ 1465]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1453
diff
changeset
|
599 gtk_imhtml_show_comments(GTK_IMHTML(c->text), !GTK_IMHTML(c->text)->comments); |
1872
efc899af4912
[gaim-migrate @ 1882]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1867
diff
changeset
|
600 } else if ((event->keyval == GDK_Return) || (event->keyval == GDK_KP_Enter)) { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
601 if ((event->state & GDK_CONTROL_MASK) && (convo_options & OPT_CONVO_CTL_ENTER)) { |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
602 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c); |
1442
2f4e6269b001
[gaim-migrate @ 1452]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
603 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
604 } else if (!(event->state & GDK_SHIFT_MASK) && (convo_options & OPT_CONVO_ENTER_SENDS)) { |
1442
2f4e6269b001
[gaim-migrate @ 1452]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1441
diff
changeset
|
605 gtk_signal_emit_by_name(GTK_OBJECT(entry), "activate", c); |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
606 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
|
607 } else { |
2483
e73ca8d8d358
[gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2460
diff
changeset
|
608 int oldpos; |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
609 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
2483
e73ca8d8d358
[gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2460
diff
changeset
|
610 oldpos = pos = gtk_editable_get_position(GTK_EDITABLE(entry)); |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
611 gtk_editable_insert_text(GTK_EDITABLE(entry), "\n", 1, &pos); |
2483
e73ca8d8d358
[gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2460
diff
changeset
|
612 if (oldpos == pos) |
e73ca8d8d358
[gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2460
diff
changeset
|
613 gtk_editable_set_position(GTK_EDITABLE(entry), pos + 1); |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
614 } |
2483
e73ca8d8d358
[gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2460
diff
changeset
|
615 } else if ((event->state & GDK_CONTROL_MASK) && (event->keyval == 'm')) { |
e73ca8d8d358
[gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2460
diff
changeset
|
616 int oldpos; |
e73ca8d8d358
[gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2460
diff
changeset
|
617 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
e73ca8d8d358
[gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2460
diff
changeset
|
618 oldpos = pos = gtk_editable_get_position(GTK_EDITABLE(entry)); |
e73ca8d8d358
[gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2460
diff
changeset
|
619 gtk_editable_insert_text(GTK_EDITABLE(entry), "\n", 1, &pos); |
e73ca8d8d358
[gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2460
diff
changeset
|
620 if (oldpos == pos) |
e73ca8d8d358
[gaim-migrate @ 2496]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2460
diff
changeset
|
621 gtk_editable_set_position(GTK_EDITABLE(entry), pos + 1); |
830
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
622 } else if (event->state & GDK_CONTROL_MASK) { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
623 if (convo_options & OPT_CONVO_CTL_CHARS) { |
830
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
624 switch (event->keyval) { |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
625 case 'i': |
1621
cf2071b095ca
[gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1617
diff
changeset
|
626 case 'I': |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
627 quiet_set(c->italic, |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
628 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->italic))); |
830
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
629 do_italic(c->italic, c->entry); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
630 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
|
631 break; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
632 case 'u': /* ctl-u is GDK_Clear, which clears the line */ |
1621
cf2071b095ca
[gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1617
diff
changeset
|
633 case 'U': |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
634 quiet_set(c->underline, |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
635 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
636 (c->underline))); |
830
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
637 do_underline(c->underline, c->entry); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
638 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
|
639 break; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
640 case 'b': /* ctl-b is GDK_Left, which moves backwards */ |
1621
cf2071b095ca
[gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1617
diff
changeset
|
641 case 'B': |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
642 quiet_set(c->bold, |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
643 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->bold))); |
830
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
644 do_bold(c->bold, c->entry); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
645 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
|
646 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
647 case 's': |
1621
cf2071b095ca
[gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1617
diff
changeset
|
648 case 'S': |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
649 quiet_set(c->strike, |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
650 !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->strike))); |
830
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
651 do_strike(c->strike, c->entry); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
652 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
|
653 break; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
654 } |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
655 } |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
656 if (convo_options & OPT_CONVO_CTL_SMILEYS) { |
830
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
657 char buf[7]; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
658 buf[0] = '\0'; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
659 switch (event->keyval) { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
660 case '1': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
661 sprintf(buf, ":-)"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
662 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
663 case '2': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
664 sprintf(buf, ":-("); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
665 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
666 case '3': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
667 sprintf(buf, ";-)"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
668 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
669 case '4': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
670 sprintf(buf, ":-P"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
671 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
672 case '5': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
673 sprintf(buf, "=-O"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
674 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
675 case '6': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
676 sprintf(buf, ":-*"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
677 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
678 case '7': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
679 sprintf(buf, ">:o"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
680 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
681 case '8': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
682 sprintf(buf, "8-)"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
683 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
684 case '!': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
685 sprintf(buf, ":-$"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
686 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
687 case '@': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
688 sprintf(buf, ":-!"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
689 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
690 case '#': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
691 sprintf(buf, ":-["); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
692 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
693 case '$': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
694 sprintf(buf, "O:-)"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
695 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
696 case '%': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
697 sprintf(buf, ":-/"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
698 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
699 case '^': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
700 sprintf(buf, ":'("); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
701 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
702 case '&': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
703 sprintf(buf, ":-X"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
704 break; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
705 case '*': |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
706 sprintf(buf, ":-D"); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
707 break; |
830
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
708 } |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
709 if (buf[0]) { |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
710 if (GTK_EDITABLE(c->entry)->has_selection) { |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
711 int finish = GTK_EDITABLE(c->entry)->selection_end_pos; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
712 gtk_editable_insert_text(GTK_EDITABLE(c->entry), |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
713 buf, strlen(buf), &finish); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
714 } else { |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
715 pos = GTK_EDITABLE(c->entry)->current_pos; |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
716 gtk_editable_insert_text(GTK_EDITABLE(c->entry), |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
717 buf, strlen(buf), &pos); |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
718 } |
60284aef22f0
[gaim-migrate @ 840]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
829
diff
changeset
|
719 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
|
720 } |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
721 } |
2340
b16642ac87b2
[gaim-migrate @ 2353]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2335
diff
changeset
|
722 if (event->keyval == 'l') |
b16642ac87b2
[gaim-migrate @ 2353]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2335
diff
changeset
|
723 gtk_imhtml_clear(GTK_IMHTML(c->text)); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
724 if ((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW)) || |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
725 (c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW))) { |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
726 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); |
1595
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
727 if (event->keyval == '[') { |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
728 gtk_notebook_prev_page(GTK_NOTEBOOK(notebook)); |
1587
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
729 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
1595
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
730 } else if (event->keyval == ']') { |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
731 gtk_notebook_next_page(GTK_NOTEBOOK(notebook)); |
1587
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
732 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
1595
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
733 } else if (event->keyval == GDK_Tab) { |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
734 GList *ws = (c->is_chat ? chats : conversations); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
735 GList *cnv = g_list_nth(ws, |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
736 gtk_notebook_get_current_page(GTK_NOTEBOOK |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
737 (notebook))); |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
738 struct conversation *d = NULL; |
1587
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
739 while (cnv) { |
1595
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
740 d = cnv->data; |
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
741 if (d->unseen) |
1587
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
742 break; |
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
743 cnv = cnv->next; |
1595
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
744 d = NULL; |
1587
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
745 } |
1595
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
746 if (d) { |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
747 gtk_notebook_set_page(GTK_NOTEBOOK(notebook), |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
748 g_list_index(ws, d)); |
1595
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
749 } else { |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
750 cnv = ws; |
1595
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
751 while (cnv) { |
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
752 d = cnv->data; |
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
753 if (d->unseen) |
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
754 break; |
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
755 cnv = cnv->next; |
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
756 d = NULL; |
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
757 } |
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
758 if (d) { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
759 gtk_notebook_set_page(GTK_NOTEBOOK(notebook), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
760 g_list_index(ws, d)); |
1595
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
761 } else { |
1702
70f9d7cdb127
[gaim-migrate @ 1712]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1692
diff
changeset
|
762 cnv = g_list_last(ws); |
1595
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
763 if (c == cnv->data) |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
764 gtk_notebook_set_page(GTK_NOTEBOOK(notebook), 0); |
1595
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
765 else |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
766 gtk_notebook_next_page(GTK_NOTEBOOK(notebook)); |
1595
f281f4d94973
[gaim-migrate @ 1605]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1594
diff
changeset
|
767 } |
1587
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
768 } |
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
769 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
770 } |
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
771 } |
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
772 } else if ((event->keyval == GDK_Tab) && c->is_chat && (chat_options & OPT_CHAT_TAB_COMPLETE)) { |
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
773 tab_complete(c); |
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
774 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
775 } else if (((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW)) || |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
776 (c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW))) && |
2421
95b4ec08abec
[gaim-migrate @ 2434]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2386
diff
changeset
|
777 (event->state & GDK_MOD1_MASK) && (event->keyval > '0') && (event->keyval <= '9')) { |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
778 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
779 gtk_notebook_set_page(GTK_NOTEBOOK(notebook), event->keyval - '1'); |
1621
cf2071b095ca
[gaim-migrate @ 1631]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1617
diff
changeset
|
780 gtk_signal_emit_stop_by_name(GTK_OBJECT(entry), "key_press_event"); |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
781 } |
66 | 782 |
573
9566a53cde23
[gaim-migrate @ 583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
570
diff
changeset
|
783 return TRUE; |
66 | 784 } |
785 | |
786 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
787 void send_callback(GtkWidget *widget, struct conversation *c) |
66 | 788 { |
2102
899c22dcee42
[gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2094
diff
changeset
|
789 char *buf, *buf2; |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
790 int limit; |
2123
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
791 int err = 0; |
66 | 792 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
793 if (!c->gc) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
794 return; |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
795 |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
796 buf2 = gtk_editable_get_chars(GTK_EDITABLE(c->entry), 0, -1); |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
797 limit = 32 * 1024; /* you shouldn't be sending more than 32k in your messages. that's a book. */ |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
798 buf = g_malloc(limit); |
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
799 g_snprintf(buf, limit, "%s", buf2); |
753
cd62f69d187e
[gaim-migrate @ 763]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
745
diff
changeset
|
800 g_free(buf2); |
796
4783a3b6859d
[gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
795
diff
changeset
|
801 if (!strlen(buf)) { |
4783a3b6859d
[gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
795
diff
changeset
|
802 g_free(buf); |
4783a3b6859d
[gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
795
diff
changeset
|
803 return; |
4783a3b6859d
[gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
795
diff
changeset
|
804 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
805 |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
806 buf2 = g_malloc(limit); |
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
807 |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
808 if (c->gc->prpl->options & OPT_PROTO_HTML) { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
809 if (convo_options & OPT_CONVO_SEND_LINKS) |
1889
c81f3dd0e58e
[gaim-migrate @ 1899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1881
diff
changeset
|
810 linkify_text(buf); |
c81f3dd0e58e
[gaim-migrate @ 1899]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1881
diff
changeset
|
811 |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
812 if (font_options & OPT_FONT_BOLD) { |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
813 g_snprintf(buf2, limit, "<B>%s</B>", buf); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
814 strcpy(buf, buf2); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
815 } |
66 | 816 |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
817 if (font_options & OPT_FONT_ITALIC) { |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
818 g_snprintf(buf2, limit, "<I>%s</I>", buf); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
819 strcpy(buf, buf2); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
820 } |
66 | 821 |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
822 if (font_options & OPT_FONT_UNDERLINE) { |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
823 g_snprintf(buf2, limit, "<U>%s</U>", buf); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
824 strcpy(buf, buf2); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
825 } |
66 | 826 |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
827 if (font_options & OPT_FONT_STRIKE) { |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
828 g_snprintf(buf2, limit, "<STRIKE>%s</STRIKE>", buf); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
829 strcpy(buf, buf2); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
830 } |
101
a9aa982272f9
[gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
88
diff
changeset
|
831 |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
832 if ((font_options & OPT_FONT_FACE) || c->hasfont) { |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
833 g_snprintf(buf2, limit, "<FONT FACE=\"%s\">%s</FONT>", c->fontface, buf); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
834 strcpy(buf, buf2); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
835 } |
488
0fcb7e7a263c
[gaim-migrate @ 498]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
474
diff
changeset
|
836 |
1441
5c67b8794991
[gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1440
diff
changeset
|
837 if ((font_options & OPT_FONT_SIZE) || c->hassize) { |
5c67b8794991
[gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1440
diff
changeset
|
838 g_snprintf(buf2, limit, "<FONT SIZE=\"%d\">%s</FONT>", c->fontsize, buf); |
5c67b8794991
[gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1440
diff
changeset
|
839 strcpy(buf, buf2); |
5c67b8794991
[gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1440
diff
changeset
|
840 } |
5c67b8794991
[gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1440
diff
changeset
|
841 |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
842 if ((font_options & OPT_FONT_FGCOL) || c->hasfg) { |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
843 g_snprintf(buf2, limit, "<FONT COLOR=\"#%02X%02X%02X\">%s</FONT>", c->fgcol.red, |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
844 c->fgcol.green, c->fgcol.blue, buf); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
845 strcpy(buf, buf2); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
846 } |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
847 |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
848 if ((font_options & OPT_FONT_BGCOL) || c->hasbg) { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
849 g_snprintf(buf2, limit, "<BODY BGCOLOR=\"#%02X%02X%02X\">%s</BODY>", |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
850 c->bgcol.red, c->bgcol.green, c->bgcol.blue, buf); |
1370
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
851 strcpy(buf, buf2); |
776bb4c6c0b8
[gaim-migrate @ 1380]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1352
diff
changeset
|
852 } |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
853 } |
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
854 |
1881
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1872
diff
changeset
|
855 quiet_set(c->bold, FALSE); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1872
diff
changeset
|
856 quiet_set(c->strike, FALSE); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1872
diff
changeset
|
857 quiet_set(c->italic, FALSE); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1872
diff
changeset
|
858 quiet_set(c->underline, FALSE); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1872
diff
changeset
|
859 quiet_set(c->font, FALSE); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1872
diff
changeset
|
860 quiet_set(c->fgcolorbtn, FALSE); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1872
diff
changeset
|
861 quiet_set(c->bgcolorbtn, FALSE); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1872
diff
changeset
|
862 quiet_set(c->link, FALSE); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1872
diff
changeset
|
863 gtk_widget_grab_focus(c->entry); |
a02584b98823
[gaim-migrate @ 1891]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1872
diff
changeset
|
864 |
101
a9aa982272f9
[gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
88
diff
changeset
|
865 { |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
389
diff
changeset
|
866 char *buffy = g_strdup(buf); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
867 enum gaim_event evnt = c->is_chat ? event_chat_send : event_im_send; |
2345
a49e8f1afbc4
[gaim-migrate @ 2358]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2340
diff
changeset
|
868 int plugin_return = plugin_event(evnt, c->gc, |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
869 c->is_chat ? (void *)c->id : c->name, |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
870 &buffy, 0); |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
389
diff
changeset
|
871 if (!buffy) { |
102
8c301530b2a3
[gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
101
diff
changeset
|
872 g_free(buf2); |
796
4783a3b6859d
[gaim-migrate @ 806]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
795
diff
changeset
|
873 g_free(buf); |
102
8c301530b2a3
[gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
101
diff
changeset
|
874 return; |
8c301530b2a3
[gaim-migrate @ 112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
101
diff
changeset
|
875 } |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
876 if (plugin_return) { |
2139
a14e8459c233
[gaim-migrate @ 2149]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2138
diff
changeset
|
877 gtk_editable_delete_text(GTK_EDITABLE(c->entry), 0, -1); |
1100
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
878 g_free(buffy); |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
879 g_free(buf2); |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
880 g_free(buf); |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
881 return; |
f168625b63fe
[gaim-migrate @ 1110]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1078
diff
changeset
|
882 } |
738
97c7b2f61cb5
[gaim-migrate @ 748]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
700
diff
changeset
|
883 g_snprintf(buf, limit, "%s", buffy); |
391
be408b41c172
[gaim-migrate @ 401]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
389
diff
changeset
|
884 g_free(buffy); |
101
a9aa982272f9
[gaim-migrate @ 111]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
88
diff
changeset
|
885 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
886 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
887 if (!c->is_chat) { |
2102
899c22dcee42
[gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2094
diff
changeset
|
888 char *buffy; |
899c22dcee42
[gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2094
diff
changeset
|
889 |
899c22dcee42
[gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2094
diff
changeset
|
890 buffy = g_strdup(buf); |
2104
0b81421021fd
[gaim-migrate @ 2114]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2102
diff
changeset
|
891 plugin_event(event_im_displayed_sent, c->gc, c->name, &buffy, 0); |
2102
899c22dcee42
[gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2094
diff
changeset
|
892 if (buffy) { |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
893 int imflags = 0; |
2239
b7ff2ca1d653
[gaim-migrate @ 2249]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2231
diff
changeset
|
894 if (c->check && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->check))) |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
895 imflags = IM_FLAG_CHECKBOX; |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
896 err = serv_send_im(c->gc, c->name, buffy, imflags); |
2102
899c22dcee42
[gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2094
diff
changeset
|
897 g_free(buffy); |
899c22dcee42
[gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2094
diff
changeset
|
898 } |
899c22dcee42
[gaim-migrate @ 2112]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2094
diff
changeset
|
899 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
900 |
2303
f5bf315e6104
[gaim-migrate @ 2313]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2270
diff
changeset
|
901 if (err > 0) { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
902 write_to_conv(c, buf, WFLAG_SEND, NULL, time(NULL)); |
2124
a1922ad52304
[gaim-migrate @ 2134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2123
diff
changeset
|
903 |
a1922ad52304
[gaim-migrate @ 2134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2123
diff
changeset
|
904 if (c->makesound && (sound_options & OPT_SOUND_SEND)) |
a1922ad52304
[gaim-migrate @ 2134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2123
diff
changeset
|
905 play_sound(SEND); |
a1922ad52304
[gaim-migrate @ 2134]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2123
diff
changeset
|
906 } |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
907 } else { |
2167
edf8c5a70e5b
[gaim-migrate @ 2177]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2160
diff
changeset
|
908 err = serv_chat_send(c->gc, c->id, buf); |
502
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
909 |
4d1e39112cbd
[gaim-migrate @ 512]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
494
diff
changeset
|
910 /* 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
|
911 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
912 |
2123
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
913 g_free(buf2); |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
914 g_free(buf); |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
915 |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
916 if (err < 0) { |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
917 if (err == -E2BIG) |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
918 do_error_dialog(_("Unable to send message: too large"), _("Message Error")); |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
919 else |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
920 do_error_dialog(_("Unable to send message: Unknown reason"), _("Message Error")); |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
921 } else { |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
922 gtk_editable_delete_text(GTK_EDITABLE(c->entry), 0, -1); |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
923 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
924 if (away_options & OPT_AWAY_BACK_ON_IM) { |
2123
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
925 if (awaymessage != NULL) { |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
926 do_im_back(); |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
927 } else if (c->gc->away) { |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
928 serv_set_away(c->gc, GAIM_AWAY_CUSTOM, NULL); |
56c4382f2909
[gaim-migrate @ 2133]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2111
diff
changeset
|
929 } |
1403
c0aa7fdc0a93
[gaim-migrate @ 1413]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1401
diff
changeset
|
930 } |
66 | 931 } |
932 } | |
933 | |
907
08d5037c9296
[gaim-migrate @ 917]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
905
diff
changeset
|
934 int entry_key_pressed(GtkWidget *w, GtkWidget *entry) |
66 | 935 { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
936 check_everything(w); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
937 return TRUE; |
66 | 938 } |
939 | |
940 /*------------------------------------------------------------------------*/ | |
941 /* HTML-type stuff */ | |
942 /*------------------------------------------------------------------------*/ | |
943 | |
944 int count_tag(GtkWidget *entry, char *s1, char *s2) | |
945 { | |
946 char *p1, *p2; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
947 int res = 0; |
66 | 948 char *tmp, *tmpo, h; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
949 tmpo = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); |
66 | 950 h = tmpo[GTK_EDITABLE(entry)->current_pos]; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
951 tmpo[GTK_EDITABLE(entry)->current_pos] = '\0'; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
952 tmp = tmpo; |
66 | 953 do { |
954 p1 = strstr(tmp, s1); | |
955 p2 = strstr(tmp, s2); | |
956 if (p1 && p2) { | |
957 if (p1 < p2) { | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
958 res = 1; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
959 tmp = p1 + strlen(s1); |
66 | 960 } else if (p2 < p1) { |
961 res = 0; | |
962 tmp = p2 + strlen(s2); | |
963 } | |
964 } else { | |
965 if (p1) { | |
966 res = 1; | |
967 tmp = p1 + strlen(s1); | |
968 } else if (p2) { | |
969 res = 0; | |
970 tmp = p2 + strlen(s2); | |
971 } | |
972 } | |
973 } while (p1 || p2); | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
974 tmpo[GTK_EDITABLE(entry)->current_pos] = h; |
66 | 975 g_free(tmpo); |
976 return res; | |
977 } | |
978 | |
979 | |
980 int invert_tags(GtkWidget *entry, char *s1, char *s2, int really) | |
981 { | |
982 int start = GTK_EDITABLE(entry)->selection_start_pos; | |
983 int finish = GTK_EDITABLE(entry)->selection_end_pos; | |
984 char *s; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
985 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
986 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); |
2048
3366311426df
[gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2017
diff
changeset
|
987 if (!g_strncasecmp(&s[start], s1, strlen(s1)) && |
3366311426df
[gaim-migrate @ 2058]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2017
diff
changeset
|
988 !g_strncasecmp(&s[finish - strlen(s2)], s2, strlen(s2))) { |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
989 if (really) { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
990 gtk_editable_delete_text(GTK_EDITABLE(entry), start, start + strlen(s1)); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
991 gtk_editable_delete_text(GTK_EDITABLE(entry), finish - strlen(s2) - strlen(s1), |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
992 finish - strlen(s1)); |
66 | 993 } |
994 g_free(s); | |
995 return 1; | |
996 } | |
997 g_free(s); | |
998 return 0; | |
999 } | |
1000 | |
1001 | |
1002 void remove_tags(GtkWidget *entry, char *tag) | |
1003 { | |
275
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
1004 char *s, *t; |
66 | 1005 int start = GTK_EDITABLE(entry)->selection_start_pos; |
1006 int finish = GTK_EDITABLE(entry)->selection_end_pos; | |
275
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
1007 int temp; |
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
1008 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); |
66 | 1009 t = s; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1010 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1011 if (start > finish) { |
275
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
1012 temp = start; |
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
1013 start = finish; |
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
1014 finish = temp; |
f9eb3eb9ffde
[gaim-migrate @ 285]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
234
diff
changeset
|
1015 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1016 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1017 if (strstr(tag, "<FONT SIZE=")) { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1018 while ((t = strstr(t, "<FONT SIZE="))) { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1019 if (((t - s) < finish) && ((t - s) >= start)) { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1020 gtk_editable_delete_text(GTK_EDITABLE(entry), (t - s), |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1021 (t - s) + strlen(tag)); |
846
4b05985bae5e
[gaim-migrate @ 856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
843
diff
changeset
|
1022 g_free(s); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
1023 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
1024 t = s; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1025 } else |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1026 t++; |
68 | 1027 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1028 } else { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1029 while ((t = strstr(t, tag))) { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1030 if (((t - s) < finish) && ((t - s) >= start)) { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1031 gtk_editable_delete_text(GTK_EDITABLE(entry), (t - s), |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1032 (t - s) + strlen(tag)); |
846
4b05985bae5e
[gaim-migrate @ 856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
843
diff
changeset
|
1033 g_free(s); |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
1034 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
1035 t = s; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1036 } else |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1037 t++; |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
1038 } |
66 | 1039 } |
1040 g_free(s); | |
1041 } | |
1042 | |
1440
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1043 static char *html_logize(char *p) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1044 { |
1103
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
1045 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1046 char *temp_p = p; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1047 char *buffer_p; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1048 char *buffer_start; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1049 int num_cr = 0; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1050 int char_len = 0; |
1103
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
1051 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1052 while (*temp_p != '\0') { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1053 char_len++; |
1440
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1054 if ((*temp_p == '\n') || ((*temp_p == '<') && (*(temp_p + 1) == '!'))) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1055 num_cr++; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1056 ++temp_p; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1057 } |
1103
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
1058 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1059 temp_p = p; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1060 buffer_p = g_malloc(char_len + (4 * num_cr) + 1); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1061 buffer_start = buffer_p; |
1103
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
1062 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1063 while (*temp_p != '\0') { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1064 if (*temp_p == '\n') { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1065 *buffer_p++ = '<'; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1066 *buffer_p++ = 'B'; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1067 *buffer_p++ = 'R'; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1068 *buffer_p++ = '>'; |
1440
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1069 *buffer_p++ = '\n'; |
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1070 } else if ((*temp_p == '<') && (*(temp_p + 1) == '!')) { |
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1071 *buffer_p++ = '&'; |
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1072 *buffer_p++ = 'g'; |
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1073 *buffer_p++ = 't'; |
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1074 *buffer_p++ = ';'; |
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1075 } else |
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1076 *buffer_p++ = *temp_p; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1077 ++temp_p; |
1103
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
1078 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1079 *buffer_p = '\0'; |
1103
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
1080 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1081 return buffer_start; |
1103
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
1082 } |
7aabbbaae829
[gaim-migrate @ 1113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1100
diff
changeset
|
1083 |
66 | 1084 void surround(GtkWidget *entry, char *pre, char *post) |
1085 { | |
649 | 1086 int temp, pos = GTK_EDITABLE(entry)->current_pos; |
66 | 1087 int dummy; |
1088 int start, finish; | |
1133 | 1089 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
1090 if (convo_options & OPT_CONVO_CHECK_SPELLING) { |
1133 | 1091 gtkspell_detach(GTK_TEXT(entry)); |
1092 } | |
1093 | |
66 | 1094 if (GTK_EDITABLE(entry)->has_selection) { |
1095 remove_tags(entry, pre); | |
1096 remove_tags(entry, post); | |
1097 start = GTK_EDITABLE(entry)->selection_start_pos; | |
1098 finish = GTK_EDITABLE(entry)->selection_end_pos; | |
1099 if (start > finish) { | |
1100 dummy = finish; | |
1101 finish = start; | |
1102 start = dummy; | |
1103 } | |
1104 dummy = start; | |
1105 gtk_editable_insert_text(GTK_EDITABLE(entry), pre, strlen(pre), &dummy); | |
1106 dummy = finish + strlen(pre); | |
1107 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy); | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1108 gtk_editable_select_region(GTK_EDITABLE(entry), start, |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1109 finish + strlen(pre) + strlen(post)); |
66 | 1110 } else { |
649 | 1111 temp = pos; |
66 | 1112 gtk_editable_insert_text(GTK_EDITABLE(entry), pre, strlen(pre), &pos); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1113 if (temp == pos) { |
649 | 1114 dummy = pos + strlen(pre); |
1115 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy); | |
1116 gtk_editable_set_position(GTK_EDITABLE(entry), dummy); | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1117 } else { |
649 | 1118 dummy = pos; |
1119 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &dummy); | |
1120 gtk_editable_set_position(GTK_EDITABLE(entry), pos); | |
1121 } | |
66 | 1122 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1123 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
1124 if (convo_options & OPT_CONVO_CHECK_SPELLING) { |
1133 | 1125 gtkspell_attach(GTK_TEXT(entry)); |
1126 } | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1127 |
66 | 1128 gtk_widget_grab_focus(entry); |
1129 } | |
1130 | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1131 void advance_past(GtkWidget *entry, char *pre, char *post) |
66 | 1132 { |
1133 char *s, *s2; | |
1134 int pos; | |
1135 if (invert_tags(entry, pre, post, 1)) | |
1136 return; | |
1137 s = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1); | |
1138 pos = GTK_EDITABLE(entry)->current_pos; | |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1244
diff
changeset
|
1139 debug_printf(_("Currently at %d, "), pos); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1140 s2 = strstr(&s[pos], post); |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
520
diff
changeset
|
1141 if (s2) { |
66 | 1142 pos = s2 - s + strlen(post); |
523
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
520
diff
changeset
|
1143 } else { |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
520
diff
changeset
|
1144 gtk_editable_insert_text(GTK_EDITABLE(entry), post, strlen(post), &pos); |
023c3851db0a
[gaim-migrate @ 533]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
520
diff
changeset
|
1145 } |
846
4b05985bae5e
[gaim-migrate @ 856]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
843
diff
changeset
|
1146 g_free(s); |
1250
b5783215b245
[gaim-migrate @ 1260]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1244
diff
changeset
|
1147 debug_printf(_("Setting position to %d\n"), pos); |
66 | 1148 gtk_editable_set_position(GTK_EDITABLE(entry), pos); |
1149 gtk_widget_grab_focus(entry); | |
1150 } | |
1151 | |
858
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1152 void toggle_fg_color(GtkWidget *color, struct conversation *c) |
66 | 1153 { |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1154 if (state_lock) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1155 return; |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1156 if (GTK_TOGGLE_BUTTON(color)->active) |
858
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1157 show_fgcolor_dialog(c, color); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1158 else if (c->fg_color_dialog) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1159 cancel_fgcolor(color, c); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1160 else |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1161 advance_past(c->entry, "<FONT COLOR>", "</FONT>"); |
858
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1162 } |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1163 |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1164 void toggle_bg_color(GtkWidget *color, struct conversation *c) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1165 { |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1166 if (state_lock) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1167 return; |
858
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1168 if (GTK_TOGGLE_BUTTON(color)->active) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1169 show_bgcolor_dialog(c, color); |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1170 else if (c->bg_color_dialog) |
3de6e98e8898
[gaim-migrate @ 868]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
856
diff
changeset
|
1171 cancel_bgcolor(color, c); |
189
50dc3db25513
[gaim-migrate @ 199]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
187
diff
changeset
|
1172 else |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1173 advance_past(c->entry, "<BODY BGCOLOR>", "</BODY>"); |
66 | 1174 } |
1175 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1176 void toggle_font(GtkWidget *font, struct conversation *c) |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
1177 { |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1178 if (state_lock) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1179 return; |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1180 if (GTK_TOGGLE_BUTTON(font)->active) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1181 show_font_dialog(c, font); |
563
8d6e2de1fb64
[gaim-migrate @ 573]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
557
diff
changeset
|
1182 else if (c->font_dialog) |
8d6e2de1fb64
[gaim-migrate @ 573]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
557
diff
changeset
|
1183 cancel_font(font, c); |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1184 else |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1185 advance_past(c->entry, "<FONT FACE>", "</FONT>"); |
234
985635758c33
[gaim-migrate @ 244]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
230
diff
changeset
|
1186 } |
611
0f7e5ff95f71
[gaim-migrate @ 621]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
610
diff
changeset
|
1187 |
608 | 1188 void toggle_link(GtkWidget *linky, struct conversation *c) |
1189 { | |
1190 if (state_lock) | |
1191 return; | |
1192 if (GTK_TOGGLE_BUTTON(linky)->active) | |
1193 show_add_link(linky, c); | |
1194 else if (c->link_dialog) | |
1195 cancel_link(linky, c); | |
1196 else | |
1197 advance_past(c->entry, "<A HREF>", "</A>"); | |
1198 } | |
66 | 1199 |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1200 void do_strike(GtkWidget *strike, GtkWidget *entry) |
66 | 1201 { |
1202 if (state_lock) | |
1203 return; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1204 |
66 | 1205 if (GTK_TOGGLE_BUTTON(strike)->active) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1206 surround(entry, "<STRIKE>", "</STRIKE>"); |
66 | 1207 else |
1208 advance_past(entry, "<STRIKE>", "</STRIKE>"); | |
1133 | 1209 |
66 | 1210 } |
1211 | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1212 void do_bold(GtkWidget *bold, GtkWidget *entry) |
66 | 1213 { |
1214 if (state_lock) | |
1215 return; | |
1216 if (GTK_TOGGLE_BUTTON(bold)->active) | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1217 surround(entry, "<B>", "</B>"); |
66 | 1218 else |
1219 advance_past(entry, "<B>", "</B>"); | |
1220 } | |
1221 | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1222 void do_underline(GtkWidget *underline, GtkWidget *entry) |
66 | 1223 { |
1224 if (state_lock) | |
1225 return; | |
1226 if (GTK_TOGGLE_BUTTON(underline)->active) | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1227 surround(entry, "<U>", "</U>"); |
66 | 1228 else |
1229 advance_past(entry, "<U>", "</U>"); | |
1230 } | |
1231 | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1232 void do_italic(GtkWidget *italic, GtkWidget *entry) |
66 | 1233 { |
1234 if (state_lock) | |
1235 return; | |
1236 if (GTK_TOGGLE_BUTTON(italic)->active) | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1237 surround(entry, "<I>", "</I>"); |
66 | 1238 else |
1239 advance_past(entry, "<I>", "</I>"); | |
1240 } | |
1241 | |
230
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
1242 /* 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
|
1243 /* currently set to 15 chars */ |
83dd297aa363
[gaim-migrate @ 240]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
210
diff
changeset
|
1244 |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1245 void do_small(GtkWidget *small, GtkWidget *entry) |
66 | 1246 { |
1247 if (state_lock) | |
1248 return; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1249 surround(entry, "<FONT SIZE=\"1\">", "</FONT>"); |
66 | 1250 } |
1251 | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1252 void do_normal(GtkWidget *normal, GtkWidget *entry) |
66 | 1253 { |
1254 if (state_lock) | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1255 return; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1256 surround(entry, "<FONT SIZE=\"3\">", "</FONT>"); |
66 | 1257 } |
1258 | |
344
2434adbb8703
[gaim-migrate @ 354]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
337
diff
changeset
|
1259 void do_big(GtkWidget *big, GtkWidget *entry) |
66 | 1260 { |
1261 if (state_lock) | |
1262 return; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1263 surround(entry, "<FONT SIZE=\"5\">", "</FONT>"); |
66 | 1264 } |
1265 | |
1266 void check_everything(GtkWidget *entry) | |
1267 { | |
1268 struct conversation *c; | |
206 | 1269 |
66 | 1270 c = (struct conversation *)gtk_object_get_user_data(GTK_OBJECT(entry)); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1271 if (!c) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1272 return; |
66 | 1273 if (invert_tags(entry, "<B>", "</B>", 0)) |
1274 quiet_set(c->bold, TRUE); | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1275 else if (count_tag(entry, "<B>", "</B>")) |
66 | 1276 quiet_set(c->bold, TRUE); |
1277 else | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1278 quiet_set(c->bold, FALSE); |
66 | 1279 if (invert_tags(entry, "<I>", "</I>", 0)) |
1280 quiet_set(c->italic, TRUE); | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1281 else if (count_tag(entry, "<I>", "</I>")) |
66 | 1282 quiet_set(c->italic, TRUE); |
1283 else | |
1284 quiet_set(c->italic, FALSE); | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1285 |
66 | 1286 if (invert_tags(entry, "<FONT COLOR", "</FONT>", 0)) |
854 | 1287 quiet_set(c->fgcolorbtn, TRUE); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1288 else if (count_tag(entry, "<FONT COLOR", "</FONT>")) |
854 | 1289 quiet_set(c->fgcolorbtn, TRUE); |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1290 else |
854 | 1291 quiet_set(c->fgcolorbtn, FALSE); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1292 |
861
00fb90babcb2
[gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
860
diff
changeset
|
1293 if (invert_tags(entry, "<BODY BGCOLOR", "</BODY>", 0)) |
00fb90babcb2
[gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
860
diff
changeset
|
1294 quiet_set(c->bgcolorbtn, TRUE); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1295 else if (count_tag(entry, "<BODY BGCOLOR", "</BODY>")) |
861
00fb90babcb2
[gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
860
diff
changeset
|
1296 quiet_set(c->bgcolorbtn, TRUE); |
00fb90babcb2
[gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
860
diff
changeset
|
1297 else |
00fb90babcb2
[gaim-migrate @ 871]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
860
diff
changeset
|
1298 quiet_set(c->bgcolorbtn, FALSE); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1299 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1300 if (invert_tags(entry, "<FONT FACE", "</FONT>", 0)) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1301 quiet_set(c->font, TRUE); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1302 else if (count_tag(entry, "<FONT FACE", "</FONT>")) |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1303 quiet_set(c->font, TRUE); |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1304 else |
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1305 quiet_set(c->font, FALSE); |
66 | 1306 |
1307 if (invert_tags(entry, "<A HREF", "</A>", 0)) | |
1308 quiet_set(c->link, TRUE); | |
1309 else if (count_tag(entry, "<A HREF", "</A>")) | |
1310 quiet_set(c->link, TRUE); | |
1311 else | |
1312 quiet_set(c->link, FALSE); | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1313 |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1314 if (invert_tags(entry, "<U>", "</U>", 0)) |
66 | 1315 quiet_set(c->underline, TRUE); |
1316 else if (count_tag(entry, "<U>", "</U>")) | |
1317 quiet_set(c->underline, TRUE); | |
1318 else | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1319 quiet_set(c->underline, FALSE); |
66 | 1320 |
1321 if (invert_tags(entry, "<STRIKE>", "</STRIKE>", 0)) | |
1322 quiet_set(c->strike, TRUE); | |
1323 else if (count_tag(entry, "<STRIKE>", "</STRIKE>")) | |
1324 quiet_set(c->strike, TRUE); | |
1325 else | |
1326 quiet_set(c->strike, FALSE); | |
1327 } | |
1328 | |
1329 | |
1330 /*------------------------------------------------------------------------*/ | |
1331 /* Takin care of the window.. */ | |
1332 /*------------------------------------------------------------------------*/ | |
1333 | |
1334 | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1335 /* 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
|
1336 * normal IM conversation or a chat window. but hopefully it won't matter */ |
1764 | 1337 void write_to_conv(struct conversation *c, char *what, int flags, char *who, time_t mtime) |
66 | 1338 { |
1735
00f74db70f2d
[gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1732
diff
changeset
|
1339 char buf[BUF_LONG]; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1340 char *str; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1341 FILE *fd; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1342 char colour[10]; |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
738
diff
changeset
|
1343 struct buddy *b; |
1244 | 1344 int gtk_font_options = 0; |
1440
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1345 GString *logstr; |
1735
00f74db70f2d
[gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1732
diff
changeset
|
1346 char buf2[BUF_LONG]; |
1764 | 1347 char mdate[64]; |
1348 | |
2270
d82efea341ef
[gaim-migrate @ 2280]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2267
diff
changeset
|
1349 if (c->is_chat && (!c->gc || !g_slist_find(c->gc->buddy_chats, c))) |
2267
837aa71710c5
[gaim-migrate @ 2277]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2264
diff
changeset
|
1350 return; |
837aa71710c5
[gaim-migrate @ 2277]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2264
diff
changeset
|
1351 |
2447
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1352 if (!c->is_chat && !g_list_find(conversations, c)) |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1353 return; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1354 |
1772
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1355 if (!c->is_chat || !(c->gc->prpl->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1356 if (!who) { |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1357 if (flags & WFLAG_SEND) { |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1358 b = find_buddy(c->gc, c->gc->username); |
2213
a226ebf4be47
[gaim-migrate @ 2223]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2210
diff
changeset
|
1359 if (b && strcmp(b->name, b->show)) |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1360 who = b->show; |
2210
3a6fd1e8f00a
[gaim-migrate @ 2220]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2202
diff
changeset
|
1361 else if (c->gc->displayname[0]) |
3a6fd1e8f00a
[gaim-migrate @ 2220]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2202
diff
changeset
|
1362 who = c->gc->displayname; |
1772
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1363 else |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1364 who = c->gc->username; |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1365 } else { |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1366 b = find_buddy(c->gc, c->name); |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1367 if (b) |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1368 who = b->show; |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1369 else |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1370 who = c->name; |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1371 } |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1372 } else { |
896432d66303
[gaim-migrate @ 1782]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1764
diff
changeset
|
1373 b = find_buddy(c->gc, who); |
745
d693b83e4933
[gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
1374 if (b) |
d693b83e4933
[gaim-migrate @ 755]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
741
diff
changeset
|
1375 who = b->show; |
741
58a6e6e26695
[gaim-migrate @ 751]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
738
diff
changeset
|
1376 } |
474
7720d0f9da8e
[gaim-migrate @ 484]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
473
diff
changeset
|
1377 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1378 |
2447
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1379 /* XXX CUI: this is really bad and should be moved somewhere else later. */ |
2448
dab1bf4a8392
[gaim-migrate @ 2461]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2447
diff
changeset
|
1380 if (!c->is_chat && c->gc) { |
2447
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1381 int index = g_slist_index(connections, c->gc); |
2449
cbac74881be9
[gaim-migrate @ 2462]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2448
diff
changeset
|
1382 int sconv = strlen(c->name); |
2447
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1383 int sname = strlen(who); |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1384 int swhat = strlen(what); |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1385 UI_build_broadcast(CUI_TYPE_MESSAGE, CUI_MESSAGE_RECV, |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1386 sizeof(index), &index, |
2449
cbac74881be9
[gaim-migrate @ 2462]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2448
diff
changeset
|
1387 sizeof(sconv), &sconv, |
cbac74881be9
[gaim-migrate @ 2462]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2448
diff
changeset
|
1388 sconv, c->name, |
2447
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1389 sizeof(sname), &sname, |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1390 sname, who, |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1391 sizeof(flags), &flags, |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1392 sizeof(swhat), &swhat, |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1393 swhat, what, |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1394 sizeof(mtime), &mtime, -1); |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1395 } |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1396 |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1397 strftime(mdate, sizeof(mdate), "%H:%M:%S", localtime(&mtime)); |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1398 |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1399 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COMMENTS; |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1400 |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1401 if (convo_options & OPT_CONVO_IGNORE_COLOUR) |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1402 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_COLOURS; |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1403 |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1404 if (convo_options & OPT_CONVO_IGNORE_FONTS) |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1405 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_FONTS; |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1406 |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1407 if (convo_options & OPT_CONVO_IGNORE_SIZES) |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1408 gtk_font_options = gtk_font_options ^ GTK_IMHTML_NO_SIZES; |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1409 |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1410 if (!(logging_options & OPT_LOG_STRIP_HTML)) |
6bdeb91abe4e
[gaim-migrate @ 2460]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2426
diff
changeset
|
1411 gtk_font_options = gtk_font_options ^ GTK_IMHTML_RETURN_LOG; |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1412 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1413 if (flags & WFLAG_SYSTEM) { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
1414 if (convo_options & OPT_CONVO_SHOW_TIME) |
1764 | 1415 g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s) </FONT><B>%s</B>", mdate, what); |
1735
00f74db70f2d
[gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1732
diff
changeset
|
1416 else |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
1417 g_snprintf(buf, BUF_LONG, "<B>%s</B>", what); |
1735
00f74db70f2d
[gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1732
diff
changeset
|
1418 g_snprintf(buf2, sizeof(buf2), "<FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B><BR>", |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1419 mdate, what); |
66 | 1420 |
1735
00f74db70f2d
[gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1732
diff
changeset
|
1421 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, 0); |
66 | 1422 |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
1423 if (logging_options & OPT_LOG_STRIP_HTML) { |
1735
00f74db70f2d
[gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1732
diff
changeset
|
1424 char *t1 = strip_html(buf); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1425 c->history = g_string_append(c->history, t1); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1426 c->history = g_string_append(c->history, "\n"); |
1486
b72a33d07ce8
[gaim-migrate @ 1496]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1479
diff
changeset
|
1427 g_free(t1); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1428 } else { |
1735
00f74db70f2d
[gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1732
diff
changeset
|
1429 c->history = g_string_append(c->history, buf); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1430 c->history = g_string_append(c->history, "<BR>\n"); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1431 } |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1432 |
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1433 if (!(flags & WFLAG_NOLOG) && ((logging_options & OPT_LOG_ALL) || find_log_info(c->name))) { |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1434 char *t1; |
699
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1435 char nm[256]; |
66 | 1436 |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
1437 if (logging_options & OPT_LOG_STRIP_HTML) { |
1735
00f74db70f2d
[gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1732
diff
changeset
|
1438 t1 = strip_html(buf); |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1439 } else { |
1735
00f74db70f2d
[gaim-migrate @ 1745]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1732
diff
changeset
|
1440 t1 = buf; |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1441 } |
699
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1442 if (c->is_chat) |
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1443 g_snprintf(nm, 256, "%s.chat", c->name); |
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1444 else |
f8acdd22065a
[gaim-migrate @ 709]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
698
diff
changeset
|
1445 g_snprintf(nm, 256, "%s", c->name); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1446 fd = open_log_file(nm); |
2004
699ddd727a49
[gaim-migrate @ 2014]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1970
diff
changeset
|
1447 if (fd) { |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
1448 if (logging_options & OPT_LOG_STRIP_HTML) { |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1449 fprintf(fd, "%s\n", t1); |
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1450 } else { |
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1451 fprintf(fd, "%s<BR>\n", t1); |
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1452 } |
1067
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1453 fclose(fd); |
936 | 1454 } |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
1455 if (logging_options & OPT_LOG_STRIP_HTML) { |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1456 g_free(t1); |
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1457 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1458 } |
2385
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1459 } else if (flags & WFLAG_NOLOG) { |
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1460 g_snprintf(buf, BUF_LONG, "<B><FONT COLOR=\"#777777\">%s</FONT></B><BR>", what); |
bdc74764245c
[gaim-migrate @ 2398]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2379
diff
changeset
|
1461 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf, 0); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1462 } else { |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1463 if (flags & WFLAG_WHISPER) { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1464 /* if we're whispering, it's not an autoresponse */ |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1465 if (meify(what)) { |
2138
cfa83a1b3d49
[gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2124
diff
changeset
|
1466 str = g_malloc(1024); |
cfa83a1b3d49
[gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2124
diff
changeset
|
1467 g_snprintf(str, 1024, "***%s", who); |
2374
9e9385cddcc6
[gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1468 strcpy(colour, "#6C2585"); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1469 } else { |
2138
cfa83a1b3d49
[gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2124
diff
changeset
|
1470 str = g_malloc(1024); |
cfa83a1b3d49
[gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2124
diff
changeset
|
1471 g_snprintf(str, 1024, "*%s*:", who); |
2374
9e9385cddcc6
[gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1472 strcpy(colour, "#00ff00"); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1473 } |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1474 } else { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1475 if (meify(what)) { |
2138
cfa83a1b3d49
[gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2124
diff
changeset
|
1476 str = g_malloc(1024); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1477 if (flags & WFLAG_AUTO) |
2138
cfa83a1b3d49
[gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2124
diff
changeset
|
1478 g_snprintf(str, 1024, "%s ***%s", AUTO_RESPONSE, who); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1479 else |
2138
cfa83a1b3d49
[gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2124
diff
changeset
|
1480 g_snprintf(str, 1024, "***%s", who); |
2374
9e9385cddcc6
[gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1481 if (flags & WFLAG_NICK) |
2375
09fe1b00d31f
[gaim-migrate @ 2388]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2374
diff
changeset
|
1482 strcpy(colour, "#af7f00"); |
2374
9e9385cddcc6
[gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1483 else |
9e9385cddcc6
[gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1484 strcpy(colour, "#062585"); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1485 } else { |
2138
cfa83a1b3d49
[gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2124
diff
changeset
|
1486 str = g_malloc(1024); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1487 if (flags & WFLAG_AUTO) |
2138
cfa83a1b3d49
[gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2124
diff
changeset
|
1488 g_snprintf(str, 1024, "%s %s", who, AUTO_RESPONSE); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1489 else |
2138
cfa83a1b3d49
[gaim-migrate @ 2148]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2124
diff
changeset
|
1490 g_snprintf(str, 1024, "%s:", who); |
2374
9e9385cddcc6
[gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1491 if (flags & WFLAG_NICK) |
2375
09fe1b00d31f
[gaim-migrate @ 2388]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2374
diff
changeset
|
1492 strcpy(colour, "#af7f00"); |
2374
9e9385cddcc6
[gaim-migrate @ 2387]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2372
diff
changeset
|
1493 else if (flags & WFLAG_RECV) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1494 strcpy(colour, "#ff0000"); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1495 else if (flags & WFLAG_SEND) |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1496 strcpy(colour, "#0000ff"); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1497 } |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1498 } |
66 | 1499 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
1500 if (convo_options & OPT_CONVO_SHOW_TIME) |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1501 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\">(%s) </FONT>" |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1502 "<B>%s</B></FONT> ", colour, mdate, str); |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1503 else |
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1504 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"%s\"><B>%s</B></FONT> ", colour, str); |
1439
06a21ec0e269
[gaim-migrate @ 1449]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1438
diff
changeset
|
1505 g_snprintf(buf2, BUF_LONG, "<FONT COLOR=\"%s\"><FONT SIZE=\"2\"><!--(%s) --></FONT>" |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1506 "<B>%s</B></FONT> ", colour, mdate, str); |
66 | 1507 |
473
f9bb7761c52b
[gaim-migrate @ 483]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
472
diff
changeset
|
1508 g_free(str); |
f9bb7761c52b
[gaim-migrate @ 483]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
472
diff
changeset
|
1509 |
1439
06a21ec0e269
[gaim-migrate @ 1449]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1438
diff
changeset
|
1510 gtk_imhtml_append_text(GTK_IMHTML(c->text), buf2, 0); |
337 | 1511 |
1440
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1512 logstr = gtk_imhtml_append_text(GTK_IMHTML(c->text), what, gtk_font_options); |
66 | 1513 |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
1514 gtk_imhtml_append_text(GTK_IMHTML(c->text), "<BR>", 0); |
66 | 1515 |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
1516 if (logging_options & OPT_LOG_STRIP_HTML) { |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1517 char *t1, *t2; |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1518 t1 = strip_html(buf); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1519 t2 = strip_html(what); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1520 c->history = g_string_append(c->history, t1); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1521 c->history = g_string_append(c->history, t2); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1522 c->history = g_string_append(c->history, "\n"); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1523 g_free(t1); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1524 g_free(t2); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1525 } else { |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1526 char *t1, *t2; |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1527 t1 = html_logize(buf); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1528 t2 = html_logize(what); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1529 c->history = g_string_append(c->history, t1); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1530 c->history = g_string_append(c->history, t2); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1531 c->history = g_string_append(c->history, "\n"); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1532 c->history = g_string_append(c->history, logstr->str); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1533 c->history = g_string_append(c->history, "<BR>\n"); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1534 g_free(t1); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1535 g_free(t2); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1536 } |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1537 |
2386
437ae28a1172
[gaim-migrate @ 2399]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2385
diff
changeset
|
1538 if ((logging_options & OPT_LOG_ALL) || find_log_info(c->name)) { |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1539 char *t1, *t2; |
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1540 char *nm = g_malloc(256); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1541 if (c->is_chat) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1542 g_snprintf(nm, 256, "%s.chat", c->name); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1543 else |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1544 g_snprintf(nm, 256, "%s", c->name); |
66 | 1545 |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
1546 if (logging_options & OPT_LOG_STRIP_HTML) { |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1547 t1 = strip_html(buf); |
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1548 t2 = strip_html(what); |
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1549 } else { |
1440
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1550 t1 = html_logize(buf); |
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1551 t2 = html_logize(what); |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1552 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1553 fd = open_log_file(nm); |
2004
699ddd727a49
[gaim-migrate @ 2014]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1970
diff
changeset
|
1554 if (fd) { |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
1555 if (logging_options & OPT_LOG_STRIP_HTML) { |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1556 fprintf(fd, "%s%s\n", t1, t2); |
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1557 } else { |
1440
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1558 fprintf(fd, "%s%s%s<BR>\n", t1, t2, logstr->str); |
6330d0bb309f
[gaim-migrate @ 1450]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1439
diff
changeset
|
1559 g_string_free(logstr, TRUE); |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1560 } |
1067
649199f4730e
[gaim-migrate @ 1077]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1063
diff
changeset
|
1561 fclose(fd); |
936 | 1562 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1563 g_free(t1); |
1437
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1564 g_free(t2); |
1f0660a2c893
[gaim-migrate @ 1447]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1434
diff
changeset
|
1565 g_free(nm); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1566 } |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1567 } |
66 | 1568 |
1569 /* if (!GTK_WIDGET_MAPPED(c->window)) { | |
1570 | |
1571 if (dark_icon_pm == NULL) | |
1572 dark_icon_pm = gdk_pixmap_create_from_xpm_d(c->window->window, &dark_icon_bm, | |
1573 NULL, (gchar **)aimicon2_xpm); | |
1574 gdk_window_set_icon(c->window->window, NULL, dark_icon_pm, dark_icon_bm); | |
1575 } | |
1576 */ | |
1577 | |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
1578 if ((c->is_chat && (chat_options & OPT_CHAT_POPUP)) || |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
1579 (!c->is_chat && (im_options & OPT_IM_POPUP))) |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1580 gdk_window_show(c->window->window); |
66 | 1581 |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
1582 if (((flags & WFLAG_RECV) || (flags & WFLAG_SYSTEM)) && |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
1583 ((!c->is_chat && (im_options & OPT_IM_ONE_WINDOW) && |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
1584 (gtk_notebook_get_current_page(GTK_NOTEBOOK(convo_notebook)) |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1585 != g_list_index(conversations, c))) || |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1586 (c->is_chat && (chat_options & OPT_CHAT_ONE_WINDOW) && |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
1587 (gtk_notebook_get_current_page(GTK_NOTEBOOK(chat_notebook)) |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1588 != g_list_index(chats, c))))) { |
1692
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
1589 GtkWidget *notebook = (c->is_chat ? chat_notebook : convo_notebook); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
1590 GList *ws = (c->is_chat ? chats : conversations); |
a312d64a995d
[gaim-migrate @ 1702]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1663
diff
changeset
|
1591 GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook), |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1592 gtk_notebook_get_nth_page(GTK_NOTEBOOK |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1593 (notebook), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1594 g_list_index(ws, |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1595 c))); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1596 GtkStyle *style = gtk_style_new(); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1597 if (!GTK_WIDGET_REALIZED(label)) |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1598 gtk_widget_realize(label); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1599 gdk_font_unref(style->font); |
1587
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
1600 style->font = gdk_font_ref(label->style->font); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1601 style->fg[0].red = 0xcccc; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1602 style->fg[0].green = 0x0000; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1603 style->fg[0].blue = 0x0000; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1604 gtk_widget_set_style(label, style); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1605 gtk_style_unref(style); |
1587
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
1606 c->unseen = TRUE; |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
1607 } |
66 | 1608 } |
1609 | |
1610 | |
1611 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1612 GtkWidget *build_conv_toolbar(struct conversation *c) |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1613 { |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1614 GdkPixmap *strike_i, *small_i, *normal_i, *big_i, *bold_i, *italic_i, *underline_i, *speaker_i, |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1615 *wood_i, *fgcolor_i, *bgcolor_i, *link_i, *font_i, *smiley_i, *save_i; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1616 GtkWidget *strike_p, *small_p, *normal_p, *big_p, *bold_p, *italic_p, *underline_p, *speaker_p, |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1617 *wood_p, *fgcolor_p, *bgcolor_p, *link_p, *font_p, *smiley_p, *save_p; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1618 GtkWidget *strike, *small, *normal, *big, *bold, *italic, *underline, *speaker, *wood, |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1619 *fgcolorbtn, *bgcolorbtn, *link, *font, *smiley, *save; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1620 GdkBitmap *mask; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1621 GtkWidget *toolbar; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1622 GtkWidget *win; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1623 GtkWidget *entry; |
66 | 1624 |
1625 toolbar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS); | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1626 win = c->window; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1627 entry = c->entry; |
66 | 1628 |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1629 bold_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, bold_xpm); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1630 bold_p = gtk_pixmap_new(bold_i, mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1631 gtk_widget_show(bold_p); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1632 gdk_bitmap_unref(mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1633 |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1634 italic_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, italic_xpm); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1635 italic_p = gtk_pixmap_new(italic_i, mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1636 gtk_widget_show(italic_p); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1637 gdk_bitmap_unref(mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1638 |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1639 underline_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1640 &win->style->white, underline_xpm); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1641 underline_p = gtk_pixmap_new(underline_i, mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1642 gtk_widget_show(underline_p); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1643 gdk_bitmap_unref(mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1644 |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1645 strike_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, strike_xpm); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1646 strike_p = gtk_pixmap_new(strike_i, mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1647 gtk_widget_show(strike_p); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1648 gdk_bitmap_unref(mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1649 |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1650 small_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, small_xpm); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1651 small_p = gtk_pixmap_new(small_i, mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1652 gtk_widget_show(small_p); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1653 gdk_bitmap_unref(mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1654 |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1655 normal_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, normal_xpm); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1656 normal_p = gtk_pixmap_new(normal_i, mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1657 gtk_widget_show(normal_p); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1658 gdk_bitmap_unref(mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1659 |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1660 big_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, big_xpm); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1661 big_p = gtk_pixmap_new(big_i, mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1662 gtk_widget_show(big_p); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1663 gdk_bitmap_unref(mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1664 |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1665 font_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, fontface_xpm); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1666 font_p = gtk_pixmap_new(font_i, mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1667 gtk_widget_show(font_p); |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1668 gdk_bitmap_unref(mask); |
66 | 1669 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1670 fgcolor_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, fgcolor_xpm); |
854 | 1671 fgcolor_p = gtk_pixmap_new(fgcolor_i, mask); |
1672 gtk_widget_show(fgcolor_p); | |
1673 gdk_bitmap_unref(mask); | |
1674 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1675 bgcolor_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, bgcolor_xpm); |
854 | 1676 bgcolor_p = gtk_pixmap_new(bgcolor_i, mask); |
1677 gtk_widget_show(bgcolor_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1678 gdk_bitmap_unref(mask); |
66 | 1679 |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1680 link_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, link_xpm); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1681 link_p = gtk_pixmap_new(link_i, mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1682 gtk_widget_show(link_p); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1683 gdk_bitmap_unref(mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1684 |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1685 smiley_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, smile_icon_xpm); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1686 smiley_p = gtk_pixmap_new(smiley_i, mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1687 gtk_widget_show(smiley_p); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1688 gdk_bitmap_unref(mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1689 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1690 wood_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, wood_xpm); |
66 | 1691 wood_p = gtk_pixmap_new(wood_i, mask); |
1692 gtk_widget_show(wood_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1693 gdk_bitmap_unref(mask); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1694 |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1695 save_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, save_small_xpm); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1696 save_p = gtk_pixmap_new(save_i, mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1697 gtk_widget_show(save_p); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1698 gdk_bitmap_unref(mask); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1699 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1700 speaker_i = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, speaker_xpm); |
66 | 1701 speaker_p = gtk_pixmap_new(speaker_i, mask); |
1702 gtk_widget_show(speaker_p); | |
804
17def2bb9720
[gaim-migrate @ 814]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
801
diff
changeset
|
1703 gdk_bitmap_unref(mask); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1704 c->makesound = 1; |
66 | 1705 |
1706 bold = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1707 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1708 NULL, _("Bold Text"), _("Bold"), bold_p, |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1709 GTK_SIGNAL_FUNC(do_bold), entry); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1710 italic = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1711 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1712 NULL, NULL, _("Italics Text"), |
350
fd3cc0a28d5d
[gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
349
diff
changeset
|
1713 _("Italics"), italic_p, GTK_SIGNAL_FUNC(do_italic), entry); |
66 | 1714 underline = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1715 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1716 NULL, NULL, _("Underline Text"), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1717 _("Underline"), underline_p, |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1718 GTK_SIGNAL_FUNC(do_underline), entry); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1719 strike = |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1720 gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1721 NULL, _("Strike through Text"), _("Strike"), strike_p, |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1722 GTK_SIGNAL_FUNC(do_strike), entry); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1723 |
66 | 1724 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1725 |
615 | 1726 small = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1727 NULL, _("Decrease font size"), _("Small"), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1728 small_p, GTK_SIGNAL_FUNC(do_small), entry); |
615 | 1729 normal = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1730 NULL, _("Normal font size"), _("Normal"), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1731 normal_p, GTK_SIGNAL_FUNC(do_normal), entry); |
615 | 1732 big = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1733 NULL, _("Increase font size"), _("Big"), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1734 big_p, GTK_SIGNAL_FUNC(do_big), entry); |
862
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1735 |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1736 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1737 |
311
0a8b4edc4732
[gaim-migrate @ 321]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
309
diff
changeset
|
1738 font = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1739 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1740 NULL, NULL, _("Select Font"), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1741 _("Font"), font_p, GTK_SIGNAL_FUNC(toggle_font), c); |
862
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1742 fgcolorbtn = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1743 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1744 NULL, NULL, _("Text Color"), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1745 _("Color"), fgcolor_p, GTK_SIGNAL_FUNC(toggle_fg_color), |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1746 c); |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1747 bgcolorbtn = |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1748 gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL, |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1749 NULL, _("Background Color"), _("Color"), bgcolor_p, |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1750 GTK_SIGNAL_FUNC(toggle_bg_color), c); |
862
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1751 |
66 | 1752 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); |
862
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1753 |
66 | 1754 link = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1755 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1756 NULL, NULL, _("Insert Link"), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1757 _("Link"), link_p, GTK_SIGNAL_FUNC(toggle_link), c); |
862
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1758 smiley = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1759 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1760 NULL, NULL, _("Insert smiley face"), _("Smiley"), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1761 smiley_p, GTK_SIGNAL_FUNC(insert_smiley), c); |
862
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1762 |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1763 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); |
2ee4e61832a4
[gaim-migrate @ 872]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
861
diff
changeset
|
1764 |
66 | 1765 wood = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1766 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1767 NULL, NULL, _("Enable logging"), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1768 _("Logging"), wood_p, GTK_SIGNAL_FUNC(toggle_loggle), c); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1769 state_lock = 1; |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1770 if (find_log_info(c->name)) |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1771 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), TRUE); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1772 else |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1773 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(wood), FALSE); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1774 state_lock = 0; |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1775 |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1776 save = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1777 NULL, _("Save Conversation"), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
1778 _("Save"), save_p, GTK_SIGNAL_FUNC(save_convo), c); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1779 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1780 speaker = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1781 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
1970
43a55969523f
[gaim-migrate @ 1980]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1965
diff
changeset
|
1782 NULL, NULL, _("Enable sounds"), |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1783 _("Sound"), speaker_p, GTK_SIGNAL_FUNC(set_option), |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1784 &c->makesound); |
1709
11d0deb44a36
[gaim-migrate @ 1719]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1705
diff
changeset
|
1785 c->makesound = 0; |
66 | 1786 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(speaker), TRUE); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1787 |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1788 /* use a slicker look if the user wants to */ |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
1789 if (misc_options & OPT_MISC_COOL_LOOK) { |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1790 gtk_button_set_relief(GTK_BUTTON(bold), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1791 gtk_button_set_relief(GTK_BUTTON(italic), GTK_RELIEF_NONE); |
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1792 gtk_button_set_relief(GTK_BUTTON(underline), GTK_RELIEF_NONE); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1793 gtk_button_set_relief(GTK_BUTTON(strike), GTK_RELIEF_NONE); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1794 gtk_button_set_relief(GTK_BUTTON(small), GTK_RELIEF_NONE); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1795 gtk_button_set_relief(GTK_BUTTON(normal), GTK_RELIEF_NONE); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1796 gtk_button_set_relief(GTK_BUTTON(big), GTK_RELIEF_NONE); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1797 gtk_button_set_relief(GTK_BUTTON(font), GTK_RELIEF_NONE); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1798 gtk_button_set_relief(GTK_BUTTON(fgcolorbtn), GTK_RELIEF_NONE); |
854 | 1799 gtk_button_set_relief(GTK_BUTTON(bgcolorbtn), GTK_RELIEF_NONE); |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1800 gtk_button_set_relief(GTK_BUTTON(link), GTK_RELIEF_NONE); |
555 | 1801 gtk_button_set_relief(GTK_BUTTON(smiley), GTK_RELIEF_NONE); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1802 gtk_button_set_relief(GTK_BUTTON(wood), GTK_RELIEF_NONE); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1803 gtk_button_set_relief(GTK_BUTTON(save), GTK_RELIEF_NONE); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1804 gtk_button_set_relief(GTK_BUTTON(speaker), GTK_RELIEF_NONE); |
535
f03f041c1aa9
[gaim-migrate @ 545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
523
diff
changeset
|
1805 } |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1806 |
66 | 1807 gtk_widget_show(toolbar); |
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1808 |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1809 gdk_pixmap_unref(bold_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1810 gdk_pixmap_unref(italic_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1811 gdk_pixmap_unref(underline_i); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1812 gdk_pixmap_unref(strike_i); |
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1813 gdk_pixmap_unref(small_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1814 gdk_pixmap_unref(normal_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1815 gdk_pixmap_unref(big_i); |
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1816 gdk_pixmap_unref(font_i); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1817 gdk_pixmap_unref(fgcolor_i); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1818 gdk_pixmap_unref(bgcolor_i); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1819 gdk_pixmap_unref(link_i); |
644
b3900e312d8e
[gaim-migrate @ 654]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
636
diff
changeset
|
1820 gdk_pixmap_unref(smiley_i); |
1479
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1821 gdk_pixmap_unref(wood_i); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1822 gdk_pixmap_unref(save_i); |
4c62ead808a2
[gaim-migrate @ 1489]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1464
diff
changeset
|
1823 gdk_pixmap_unref(speaker_i); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1824 |
66 | 1825 c->bold = bold; |
1826 c->strike = strike; | |
615 | 1827 c->italic = italic; |
66 | 1828 c->underline = underline; |
615 | 1829 c->log_button = wood; |
854 | 1830 c->fgcolorbtn = fgcolorbtn; |
1831 c->bgcolorbtn = bgcolorbtn; | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1832 c->link = link; |
608 | 1833 c->wood = wood; |
308
e5fa88351dc8
[gaim-migrate @ 318]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
1834 c->font = font; |
570 | 1835 c->smiley = smiley; |
66 | 1836 |
1525
ba8e6e211af5
[gaim-migrate @ 1535]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1486
diff
changeset
|
1837 gtk_widget_set_sensitive(c->log_button, ((logging_options & OPT_LOG_ALL)) ? FALSE : TRUE); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1838 |
66 | 1839 gtk_widget_set_sensitive(c->bold, ((font_options & OPT_FONT_BOLD)) ? FALSE : TRUE); |
1840 gtk_widget_set_sensitive(c->italic, ((font_options & OPT_FONT_ITALIC)) ? FALSE : TRUE); | |
1841 gtk_widget_set_sensitive(c->underline, ((font_options & OPT_FONT_UNDERLINE)) ? FALSE : TRUE); | |
1842 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
|
1843 |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1844 return toolbar; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1845 } |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
1846 |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1847 static void convo_sel_send(GtkObject *m, struct gaim_connection *c) |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1848 { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1849 struct conversation *cnv = gtk_object_get_user_data(m); |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1850 |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1851 if (cnv->gc == c) |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1852 return; |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1853 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1854 cnv->gc = c; |
1340 | 1855 |
1342 | 1856 update_buttons_by_protocol(cnv); |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1857 |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
1858 update_icon(cnv); |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
1859 update_checkbox(cnv); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1860 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1861 |
2379
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1862 int set_dispstyle(int chat) |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1863 { |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1864 int dispstyle; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1865 |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1866 if (chat) { |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1867 switch (chat_options & (OPT_CHAT_BUTTON_TEXT | OPT_CHAT_BUTTON_XPM)) { |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1868 case OPT_CHAT_BUTTON_TEXT: |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1869 dispstyle = 1; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1870 break; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1871 case OPT_CHAT_BUTTON_XPM: |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1872 dispstyle = 0; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1873 break; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1874 default: /* both or neither */ |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1875 dispstyle = 2; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1876 break; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1877 } |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1878 } else { |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1879 switch (im_options & (OPT_IM_BUTTON_TEXT | OPT_IM_BUTTON_XPM)) { |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1880 case OPT_IM_BUTTON_TEXT: |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1881 dispstyle = 1; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1882 break; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1883 case OPT_IM_BUTTON_XPM: |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1884 dispstyle = 0; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1885 break; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1886 default: /* both or neither */ |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1887 dispstyle = 2; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1888 break; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1889 } |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1890 } |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1891 return dispstyle; |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1892 } |
cacaf7ace3a5
[gaim-migrate @ 2392]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2375
diff
changeset
|
1893 |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1894 void update_convo_add_button(struct conversation *c) |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1895 { |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1896 int dispstyle = set_dispstyle(0); |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1897 GtkWidget *parent = c->add->parent; |
1663
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1898 gboolean rebuild = FALSE; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
1899 |
1352 | 1900 if (find_buddy(c->gc, c->name)) { |
1663
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1901 if (!gtk_object_get_user_data(GTK_OBJECT(c->add))) { |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1902 gtk_widget_destroy(c->add); |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1903 c->add = picture_button2(c->window, _("Remove"), gnome_remove_xpm, dispstyle); |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1904 rebuild = TRUE; |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1905 } |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1906 if (c->gc) { |
1352 | 1907 if (c->gc->prpl->remove_buddy == NULL) |
1908 gtk_widget_set_sensitive(c->add, FALSE); | |
1909 else | |
1910 gtk_widget_set_sensitive(c->add, TRUE); | |
1663
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1911 } else |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1912 gtk_widget_set_sensitive(c->add, FALSE); |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1913 gtk_object_set_user_data(GTK_OBJECT(c->add), c); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1914 } else { |
1663
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1915 if (gtk_object_get_user_data(GTK_OBJECT(c->add))) { |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1916 gtk_widget_destroy(c->add); |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1917 c->add = picture_button2(c->window, _("Add"), gnome_add_xpm, dispstyle); |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1918 rebuild = TRUE; |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1919 } |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1920 if (c->gc) { |
1352 | 1921 if (c->gc->prpl->add_buddy == NULL) |
1922 gtk_widget_set_sensitive(c->add, FALSE); | |
1923 else | |
1924 gtk_widget_set_sensitive(c->add, TRUE); | |
1663
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1925 } else |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1926 gtk_widget_set_sensitive(c->add, FALSE); |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1927 } |
1352 | 1928 |
1663
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1929 if (rebuild) { |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1930 gtk_signal_connect(GTK_OBJECT(c->add), "clicked", GTK_SIGNAL_FUNC(add_callback), c); |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1931 gtk_box_pack_end(GTK_BOX(parent), c->add, dispstyle, dispstyle, 0); |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1932 gtk_box_reorder_child(GTK_BOX(parent), c->add, 2); |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1933 gtk_widget_show(c->add); |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
1934 } |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1935 } |
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
1936 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1937 static void create_convo_menu(struct conversation *cnv) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1938 { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1939 GtkWidget *menu, *opt; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1940 GSList *g = connections; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1941 struct gaim_connection *c; |
1235
a9cf2f61a7b1
[gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1228
diff
changeset
|
1942 char buf[2048]; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1943 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1944 if (g_slist_length(g) < 2) |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1945 gtk_widget_hide(cnv->menu->parent); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1946 else { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1947 menu = gtk_menu_new(); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1948 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1949 while (g) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1950 c = (struct gaim_connection *)g->data; |
1235
a9cf2f61a7b1
[gaim-migrate @ 1245]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1228
diff
changeset
|
1951 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
|
1952 opt = gtk_menu_item_new_with_label(buf); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1953 gtk_object_set_user_data(GTK_OBJECT(opt), cnv); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1954 gtk_signal_connect(GTK_OBJECT(opt), "activate", |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1955 GTK_SIGNAL_FUNC(convo_sel_send), c); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1956 gtk_widget_show(opt); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1957 gtk_menu_append(GTK_MENU(menu), opt); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1958 g = g->next; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1959 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1960 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1961 gtk_option_menu_remove_menu(GTK_OPTION_MENU(cnv->menu)); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1962 gtk_option_menu_set_menu(GTK_OPTION_MENU(cnv->menu), menu); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1963 gtk_option_menu_set_history(GTK_OPTION_MENU(cnv->menu), 0); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1964 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1965 gtk_widget_show(cnv->menu); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1966 gtk_widget_show(cnv->menu->parent); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1967 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1968 } |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1969 |
2111
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1970 void redo_convo_menus() |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1971 { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1972 GList *c = conversations; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1973 struct conversation *C; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1974 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1975 while (c) { |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1976 C = (struct conversation *)c->data; |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1977 c = c->next; |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1978 |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
1979 create_convo_menu(C); |
993
eacd93d0089a
[gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
1980 |
2111
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1981 if (g_slist_find(connections, C->gc)) |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1982 continue; |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1983 |
2111
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1984 set_convo_gc(C, connections ? connections->data : NULL); |
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1985 } |
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1986 } |
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1987 |
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1988 void convo_menu_remove(struct gaim_connection *gc) |
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1989 { |
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1990 GList *c = conversations; |
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1991 struct conversation *C; |
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1992 |
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1993 while (c) { |
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1994 C = (struct conversation *)c->data; |
109669b3887e
[gaim-migrate @ 2121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2109
diff
changeset
|
1995 c = c->next; |
2109
3110ea142888
[gaim-migrate @ 2119]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2104
diff
changeset
|
1996 |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
1997 remove_icon(C); |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
1998 remove_checkbox(C); |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
1999 } |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2000 } |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2001 |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2002 void set_convo_gc(struct conversation *c, struct gaim_connection *gc) |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2003 { |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2004 if (c->gc == gc) |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2005 return; |
993
eacd93d0089a
[gaim-migrate @ 1003]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
980
diff
changeset
|
2006 |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2007 c->gc = gc; |
1030
38452403563b
[gaim-migrate @ 1040]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1002
diff
changeset
|
2008 |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2009 if (gc) |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2010 gtk_option_menu_set_history(GTK_OPTION_MENU(c->menu), g_slist_index(connections, gc)); |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2011 |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2012 update_buttons_by_protocol(c); |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2013 |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2014 update_icon(c); |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2015 update_checkbox(c); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2016 } |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2017 |
1340 | 2018 void update_buttons_by_protocol(struct conversation *c) |
2019 { | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2020 if (!c->gc) { |
1352 | 2021 gtk_widget_set_sensitive(c->info, FALSE); |
2022 gtk_widget_set_sensitive(c->send, FALSE); | |
2023 gtk_widget_set_sensitive(c->warn, FALSE); | |
2024 gtk_widget_set_sensitive(c->block, FALSE); | |
2025 gtk_widget_set_sensitive(c->add, FALSE); | |
2026 | |
2027 return; | |
2028 } | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2029 |
1532
249a770bebd7
[gaim-migrate @ 1542]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1525
diff
changeset
|
2030 if (c->gc->prpl->get_info == NULL && c->info) |
1340 | 2031 gtk_widget_set_sensitive(c->info, FALSE); |
1398
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1370
diff
changeset
|
2032 else if (c->info) |
1340 | 2033 gtk_widget_set_sensitive(c->info, TRUE); |
1341 | 2034 |
2094
be10a1243ed7
[gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2090
diff
changeset
|
2035 if (c->is_chat) { |
be10a1243ed7
[gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2090
diff
changeset
|
2036 if (c->gc->prpl->chat_send == NULL && c->send) |
be10a1243ed7
[gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2090
diff
changeset
|
2037 gtk_widget_set_sensitive(c->send, FALSE); |
be10a1243ed7
[gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2090
diff
changeset
|
2038 else |
be10a1243ed7
[gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2090
diff
changeset
|
2039 gtk_widget_set_sensitive(c->send, TRUE); |
be10a1243ed7
[gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2090
diff
changeset
|
2040 } else { |
be10a1243ed7
[gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2090
diff
changeset
|
2041 if (c->gc->prpl->send_im == NULL && c->send) |
be10a1243ed7
[gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2090
diff
changeset
|
2042 gtk_widget_set_sensitive(c->send, FALSE); |
be10a1243ed7
[gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2090
diff
changeset
|
2043 else |
be10a1243ed7
[gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2090
diff
changeset
|
2044 gtk_widget_set_sensitive(c->send, TRUE); |
be10a1243ed7
[gaim-migrate @ 2104]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2090
diff
changeset
|
2045 } |
1341 | 2046 |
1343 | 2047 if (c->gc->prpl->warn == NULL && c->warn) |
1341 | 2048 gtk_widget_set_sensitive(c->warn, FALSE); |
1398
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1370
diff
changeset
|
2049 else if (c->warn) |
1341 | 2050 gtk_widget_set_sensitive(c->warn, TRUE); |
2051 | |
1343 | 2052 if (c->gc->prpl->add_permit == NULL && c->block) |
1341 | 2053 gtk_widget_set_sensitive(c->block, FALSE); |
1398
f6b0cf1f4c3b
[gaim-migrate @ 1408]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1370
diff
changeset
|
2054 else if (c->block) |
1341 | 2055 gtk_widget_set_sensitive(c->block, TRUE); |
2056 | |
1343 | 2057 if (c->add) |
2058 update_convo_add_button(c); | |
2059 | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2060 if (c->whisper) { |
1343 | 2061 if (c->gc->prpl->chat_whisper == NULL) |
2062 gtk_widget_set_sensitive(c->whisper, FALSE); | |
2063 else | |
2064 gtk_widget_set_sensitive(c->whisper, TRUE); | |
2065 } | |
2066 | |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2067 if (c->invite) { |
1343 | 2068 if (c->gc->prpl->chat_invite == NULL) |
2069 gtk_widget_set_sensitive(c->invite, FALSE); | |
2070 else | |
2071 gtk_widget_set_sensitive(c->invite, TRUE); | |
2072 } | |
1340 | 2073 } |
2074 | |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2075 static void convo_switch(GtkNotebook *notebook, GtkWidget *page, gint page_num, gpointer data) |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2076 { |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2077 GtkWidget *label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(convo_notebook), |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2078 gtk_notebook_get_nth_page(GTK_NOTEBOOK |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2079 (convo_notebook), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2080 page_num)); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2081 GtkStyle *style; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2082 struct conversation *c = g_list_nth_data(conversations, page_num); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2083 if (c && c->window && c->entry) |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2084 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2085 if (!GTK_WIDGET_REALIZED(label)) |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2086 return; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2087 style = gtk_style_new(); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2088 gdk_font_unref(style->font); |
1587
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
2089 style->font = gdk_font_ref(label->style->font); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2090 gtk_widget_set_style(label, style); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2091 gtk_style_unref(style); |
1587
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
2092 c->unseen = FALSE; |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2093 } |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2094 |
1340 | 2095 |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2096 void show_conv(struct conversation *c) |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2097 { |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2098 GtkWidget *win; |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2099 GtkWidget *cont; |
615 | 2100 char buf[256]; |
2101 GtkWidget *text; | |
2102 GtkWidget *sw; | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2103 GtkWidget *send; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2104 GtkWidget *info; |
615 | 2105 GtkWidget *warn; |
2106 GtkWidget *block; | |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2107 GtkWidget *close; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2108 GtkWidget *entry; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2109 GtkWidget *bbox; |
615 | 2110 GtkWidget *vbox; |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2111 GtkWidget *vbox2; |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2112 GtkWidget *paned; |
615 | 2113 GtkWidget *add; |
623 | 2114 GtkWidget *toolbar; |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2115 GtkWidget *hbox; |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2116 GtkWidget *label; |
1647
23b734cf1161
[gaim-migrate @ 1657]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1625
diff
changeset
|
2117 GtkStyle *style; |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2118 int dispstyle = set_dispstyle(0); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
2119 |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2120 c->font_dialog = NULL; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
2121 c->fg_color_dialog = NULL; |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
2122 c->bg_color_dialog = NULL; |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2123 c->smiley_dialog = NULL; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2124 c->link_dialog = NULL; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2125 c->log_dialog = NULL; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2126 sprintf(c->fontface, "%s", fontface); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2127 c->hasfont = 0; |
1441
5c67b8794991
[gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1440
diff
changeset
|
2128 c->fontsize = fontsize; |
5c67b8794991
[gaim-migrate @ 1451]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1440
diff
changeset
|
2129 c->hassize = 0; |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2130 c->bgcol = bgcolor; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2131 c->hasbg = 0; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2132 c->fgcol = fgcolor; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2133 c->hasfg = 0; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2134 |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2135 if (im_options & OPT_IM_ONE_WINDOW) { |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2136 if (!all_convos) { |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2137 win = all_convos = c->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2138 gtk_window_set_wmclass(GTK_WINDOW(win), "conversation", "Gaim"); |
2335
2c595fc5f1f8
[gaim-migrate @ 2348]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2334
diff
changeset
|
2139 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, FALSE); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2140 gtk_container_border_width(GTK_CONTAINER(win), 0); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2141 gtk_widget_realize(win); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2142 aol_icon(win->window); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2143 gtk_window_set_title(GTK_WINDOW(win), _("Gaim - Conversations")); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2144 gtk_signal_connect(GTK_OBJECT(win), "delete_event", |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2145 GTK_SIGNAL_FUNC(delete_all_convo), NULL); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2146 |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2147 convo_notebook = gtk_notebook_new(); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2148 if (im_options & OPT_IM_SIDE_TAB) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2149 if (im_options & OPT_IM_BR_TAB) { |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2150 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2151 GTK_POS_RIGHT); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2152 } else { |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2153 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2154 GTK_POS_LEFT); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2155 } |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2156 } else { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2157 if (im_options & OPT_IM_BR_TAB) { |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2158 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2159 GTK_POS_BOTTOM); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2160 } else { |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2161 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2162 GTK_POS_TOP); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2163 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2164 } |
1596
f5845007e3bc
[gaim-migrate @ 1606]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1595
diff
changeset
|
2165 gtk_notebook_set_scrollable(GTK_NOTEBOOK(convo_notebook), TRUE); |
1597
c1a8a7c40424
[gaim-migrate @ 1607]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1596
diff
changeset
|
2166 gtk_notebook_popup_enable(GTK_NOTEBOOK(convo_notebook)); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2167 gtk_container_add(GTK_CONTAINER(win), convo_notebook); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2168 gtk_signal_connect(GTK_OBJECT(convo_notebook), "switch-page", |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2169 GTK_SIGNAL_FUNC(convo_switch), NULL); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2170 gtk_widget_show(convo_notebook); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2171 } else |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2172 win = c->window = all_convos; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2173 |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2174 cont = gtk_vbox_new(FALSE, 5); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2175 gtk_container_set_border_width(GTK_CONTAINER(cont), 5); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2176 gtk_notebook_append_page(GTK_NOTEBOOK(convo_notebook), cont, gtk_label_new(c->name)); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2177 gtk_widget_show(cont); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2178 } else { |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2179 cont = win = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2180 c->window = win; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2181 gtk_object_set_user_data(GTK_OBJECT(win), c); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2182 gtk_window_set_wmclass(GTK_WINDOW(win), "conversation", "Gaim"); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2183 gtk_window_set_policy(GTK_WINDOW(win), TRUE, TRUE, TRUE); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2184 gtk_container_border_width(GTK_CONTAINER(win), 10); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2185 gtk_widget_realize(win); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2186 aol_icon(win->window); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2187 if ((find_log_info(c->name)) || ((logging_options & OPT_LOG_ALL))) |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2188 g_snprintf(buf, sizeof(buf), LOG_CONVERSATION_TITLE, c->name); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2189 else |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2190 g_snprintf(buf, sizeof(buf), CONVERSATION_TITLE, c->name); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2191 gtk_window_set_title(GTK_WINDOW(win), buf); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2192 gtk_signal_connect(GTK_OBJECT(win), "delete_event", |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2193 GTK_SIGNAL_FUNC(delete_event_convo), c); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2194 } |
623 | 2195 |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2196 paned = gtk_vpaned_new(); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
2197 gtk_paned_set_gutter_size(GTK_PANED(paned), 15); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2198 gtk_container_add(GTK_CONTAINER(cont), paned); |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2199 gtk_widget_show(paned); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2200 |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
2201 vbox = gtk_vbox_new(FALSE, 5); |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2202 gtk_paned_pack1(GTK_PANED(paned), vbox, FALSE, TRUE); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2203 gtk_widget_show(vbox); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2204 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
2205 sw = gtk_scrolled_window_new(NULL, NULL); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2206 c->sw = sw; |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
2207 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
2208 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1780
diff
changeset
|
2209 gtk_widget_set_usize(sw, conv_size.width, conv_size.height); |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2210 gtk_widget_show(sw); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2211 |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2212 text = gtk_imhtml_new(NULL, NULL); |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2213 c->text = text; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2214 gtk_container_add(GTK_CONTAINER(sw), text); |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2215 GTK_LAYOUT(text)->hadjustment->step_increment = 10.0; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2216 GTK_LAYOUT(text)->vadjustment->step_increment = 10.0; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2217 if (convo_options & OPT_CONVO_SHOW_TIME) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2218 gtk_imhtml_show_comments(GTK_IMHTML(text), TRUE); |
1815
f15d449b3167
[gaim-migrate @ 1825]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1813
diff
changeset
|
2219 gaim_setup_imhtml(text); |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2220 gtk_widget_show(text); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2221 |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
2222 vbox2 = gtk_vbox_new(FALSE, 5); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2223 gtk_paned_pack2(GTK_PANED(paned), vbox2, FALSE, FALSE); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2224 gtk_widget_show(vbox2); |
960
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2225 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2226 hbox = gtk_hbox_new(FALSE, 0); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2227 gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2228 gtk_widget_show(hbox); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2229 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2230 label = gtk_label_new(_("Send message as: ")); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2231 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2232 gtk_widget_show(label); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2233 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2234 c->menu = gtk_option_menu_new(); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2235 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
|
2236 gtk_widget_show(c->menu); |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2237 |
fa681641643d
[gaim-migrate @ 970]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
936
diff
changeset
|
2238 create_convo_menu(c); |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2239 |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2240 c->lbox = gtk_hbox_new(FALSE, 0); |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2241 gtk_box_pack_start(GTK_BOX(vbox2), c->lbox, FALSE, FALSE, 0); |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2242 gtk_widget_show(c->lbox); |
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2243 |
1227
25611364a504
[gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1219
diff
changeset
|
2244 entry = gtk_text_new(NULL, NULL); |
25611364a504
[gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1219
diff
changeset
|
2245 c->entry = entry; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2246 if (!(im_options & OPT_IM_ONE_WINDOW)) |
1594
ac8eddd16e89
[gaim-migrate @ 1604]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1592
diff
changeset
|
2247 gtk_window_set_focus(GTK_WINDOW(c->window), c->entry); |
1227
25611364a504
[gaim-migrate @ 1237]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1219
diff
changeset
|
2248 |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2249 toolbar = build_conv_toolbar(c); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
2250 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
|
2251 |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2252 gtk_object_set_user_data(GTK_OBJECT(entry), c); |
472
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2253 gtk_text_set_editable(GTK_TEXT(entry), TRUE); |
6a92cd7322cc
[gaim-migrate @ 482]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
411
diff
changeset
|
2254 gtk_text_set_word_wrap(GTK_TEXT(entry), TRUE); |
1813
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1780
diff
changeset
|
2255 gtk_widget_set_usize(entry, conv_size.width - 20, conv_size.entry_height); |
998a6a032874
[gaim-migrate @ 1823]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1780
diff
changeset
|
2256 |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
2257 gtk_signal_connect(GTK_OBJECT(entry), "activate", GTK_SIGNAL_FUNC(send_callback), c); |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2258 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(keypress_callback), c); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
2259 gtk_signal_connect(GTK_OBJECT(entry), "key_press_event", GTK_SIGNAL_FUNC(entry_key_pressed), |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
2260 entry); |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2261 if (convo_options & OPT_CONVO_CHECK_SPELLING) |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2262 gtkspell_attach(GTK_TEXT(c->entry)); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
2263 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
|
2264 gtk_widget_show(entry); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2265 |
1898
73d73939f698
[gaim-migrate @ 1908]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1889
diff
changeset
|
2266 c->bbox = bbox = gtk_hbox_new(FALSE, 5); |
1228
6773043cf9f6
[gaim-migrate @ 1238]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1227
diff
changeset
|
2267 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
|
2268 gtk_widget_show(bbox); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2269 |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2270 close = picture_button2(win, _("Close"), cancel_xpm, dispstyle); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2271 c->close = close; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2272 gtk_object_set_user_data(GTK_OBJECT(close), c); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2273 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
|
2274 gtk_box_pack_end(GTK_BOX(bbox), close, dispstyle, dispstyle, 0); |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
2275 gtk_widget_show(close); |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2276 |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2277 c->sep1 = gtk_vseparator_new(); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2278 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
|
2279 gtk_widget_show(c->sep1); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2280 |
1663
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
2281 if (c->gc && find_buddy(c->gc, c->name) != NULL) { |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
2282 add = picture_button2(win, _("Remove"), gnome_remove_xpm, dispstyle); |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
2283 gtk_object_set_user_data(GTK_OBJECT(add), c); |
0f7d2284296f
[gaim-migrate @ 1673]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1647
diff
changeset
|
2284 } else |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2285 add = picture_button2(win, _("Add"), gnome_add_xpm, dispstyle); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2286 c->add = add; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2287 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
|
2288 gtk_box_pack_end(GTK_BOX(bbox), add, dispstyle, dispstyle, 0); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2289 gtk_widget_show(add); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2290 |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2291 block = picture_button2(win, _("Block"), block_xpm, dispstyle); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2292 c->block = block; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2293 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
|
2294 gtk_box_pack_end(GTK_BOX(bbox), block, dispstyle, dispstyle, 0); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2295 gtk_widget_show(block); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2296 |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2297 warn = picture_button2(win, _("Warn"), warn_xpm, dispstyle); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2298 c->warn = warn; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2299 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
|
2300 gtk_box_pack_end(GTK_BOX(bbox), warn, dispstyle, dispstyle, 0); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2301 gtk_widget_show(warn); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2302 |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2303 info = picture_button2(win, _("Info"), tb_search_xpm, dispstyle); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2304 c->info = info; |
1340 | 2305 |
1219
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2306 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
|
2307 gtk_box_pack_end(GTK_BOX(bbox), info, dispstyle, dispstyle, 0); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2308 gtk_widget_show(info); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2309 |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2310 c->sep2 = gtk_vseparator_new(); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2311 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
|
2312 gtk_widget_show(c->sep2); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2313 |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2314 send = picture_button2(win, _("Send"), tmp_send_xpm, dispstyle); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2315 c->send = send; |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2316 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
|
2317 gtk_box_pack_end(GTK_BOX(bbox), send, dispstyle, dispstyle, 0); |
2528fc35aa32
[gaim-migrate @ 1229]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1215
diff
changeset
|
2318 gtk_widget_show(send); |
666
71ea550c22ac
[gaim-migrate @ 676]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
661
diff
changeset
|
2319 |
1340 | 2320 update_buttons_by_protocol(c); |
2321 | |
1647
23b734cf1161
[gaim-migrate @ 1657]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1625
diff
changeset
|
2322 style = gtk_widget_get_style(GTK_WIDGET(entry)); |
23b734cf1161
[gaim-migrate @ 1657]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1625
diff
changeset
|
2323 gtk_imhtml_set_defaults(GTK_IMHTML(text), 0, &style->fg[GTK_STATE_NORMAL], |
23b734cf1161
[gaim-migrate @ 1657]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1625
diff
changeset
|
2324 &style->base[GTK_STATE_NORMAL]); |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2325 |
66 | 2326 gtk_widget_show(win); |
2327 } | |
2328 | |
2329 | |
1253
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
2330 void toggle_spellchk() |
8342d3aab1f1
[gaim-migrate @ 1263]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1250
diff
changeset
|
2331 { |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2332 GList *cnv = conversations; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2333 GSList *cht; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2334 struct conversation *c; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2335 GSList *con = connections; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2336 struct gaim_connection *gc; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2337 |
2460
049822b93239
[gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2449
diff
changeset
|
2338 if (convo_options & OPT_CONVO_CHECK_SPELLING) |
049822b93239
[gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2449
diff
changeset
|
2339 gtkspell_start(NULL, ispell_cmd); |
049822b93239
[gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2449
diff
changeset
|
2340 |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2341 while (cnv) { |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2342 c = (struct conversation *)cnv->data; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2343 if (convo_options & OPT_CONVO_CHECK_SPELLING) |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2344 gtkspell_attach(GTK_TEXT(c->entry)); |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2345 else |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2346 gtkspell_detach(GTK_TEXT(c->entry)); |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2347 cnv = cnv->next; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2348 } |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2349 |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2350 while (con) { |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2351 gc = (struct gaim_connection *)con->data; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2352 cht = gc->buddy_chats; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2353 while (cht) { |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2354 c = (struct conversation *)cht->data; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2355 if (convo_options & OPT_CONVO_CHECK_SPELLING) |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2356 gtkspell_attach(GTK_TEXT(c->entry)); |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2357 else |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2358 gtkspell_detach(GTK_TEXT(c->entry)); |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2359 cht = cht->next; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2360 } |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2361 con = con->next; |
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2362 } |
2460
049822b93239
[gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2449
diff
changeset
|
2363 |
049822b93239
[gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2449
diff
changeset
|
2364 if (!(convo_options & OPT_CONVO_CHECK_SPELLING)) |
049822b93239
[gaim-migrate @ 2473]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2449
diff
changeset
|
2365 gtkspell_stop(); |
1117
f3e0f41beddb
[gaim-migrate @ 1127]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1103
diff
changeset
|
2366 } |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2367 |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2368 void toggle_timestamps() |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2369 { |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2370 GList *cnv = conversations; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2371 GSList *cht; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2372 struct conversation *c; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2373 GSList *con = connections; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2374 struct gaim_connection *gc; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2375 |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2376 while (cnv) { |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2377 c = (struct conversation *)cnv->data; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2378 if (convo_options & OPT_CONVO_SHOW_TIME) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2379 gtk_imhtml_show_comments(GTK_IMHTML(c->text), TRUE); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2380 else |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2381 gtk_imhtml_show_comments(GTK_IMHTML(c->text), FALSE); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2382 cnv = cnv->next; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2383 } |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2384 |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2385 while (con) { |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2386 gc = (struct gaim_connection *)con->data; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2387 cht = gc->buddy_chats; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2388 while (cht) { |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2389 c = (struct conversation *)cht->data; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2390 if (convo_options & OPT_CONVO_SHOW_TIME) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2391 gtk_imhtml_show_comments(GTK_IMHTML(c->text), TRUE); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2392 else |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2393 gtk_imhtml_show_comments(GTK_IMHTML(c->text), FALSE); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2394 cht = cht->next; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2395 } |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2396 con = con->next; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2397 } |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2398 } |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2399 |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2400 void toggle_smileys() |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2401 { |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2402 GList *cnv = conversations; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2403 GSList *cht; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2404 struct conversation *c; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2405 GSList *con = connections; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2406 struct gaim_connection *gc; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2407 |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2408 while (cnv) { |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2409 c = (struct conversation *)cnv->data; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2410 if (convo_options & OPT_CONVO_SHOW_SMILEY) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2411 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), TRUE); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2412 else |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2413 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), FALSE); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2414 cnv = cnv->next; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2415 } |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2416 |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2417 while (con) { |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2418 gc = (struct gaim_connection *)con->data; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2419 cht = gc->buddy_chats; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2420 while (cht) { |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2421 c = (struct conversation *)cht->data; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2422 if (convo_options & OPT_CONVO_SHOW_SMILEY) |
1428
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2423 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), TRUE); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2424 else |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2425 gtk_imhtml_show_smileys(GTK_IMHTML(c->text), FALSE); |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2426 cht = cht->next; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2427 } |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2428 con = con->next; |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2429 } |
00b3d02a2168
[gaim-migrate @ 1438]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1414
diff
changeset
|
2430 } |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2431 |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2432 void tabize() |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2433 { |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2434 /* evil, evil i tell you! evil! */ |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2435 if (im_options & OPT_IM_ONE_WINDOW) { |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2436 GList *x = conversations; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2437 while (x) { |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2438 struct conversation *c = x->data; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2439 GtkWidget *imhtml, *win; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2440 |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2441 imhtml = c->text; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2442 win = c->window; |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2443 remove_icon(c); |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2444 remove_checkbox(c); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2445 show_conv(c); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2446 gtk_widget_destroy(c->text); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2447 gtk_widget_reparent(imhtml, c->sw); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2448 c->text = imhtml; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2449 gtk_widget_destroy(win); |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2450 update_icon(c); |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2451 update_checkbox(c); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2452 |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2453 x = x->next; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2454 } |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2455 } else { |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2456 GList *x, *m; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2457 x = m = conversations; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2458 conversations = NULL; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2459 while (x) { |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2460 struct conversation *c = x->data; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2461 GtkWidget *imhtml; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2462 |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2463 imhtml = c->text; |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2464 remove_icon(c); |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2465 remove_checkbox(c); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2466 show_conv(c); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2467 gtk_widget_destroy(c->text); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2468 gtk_widget_reparent(imhtml, c->sw); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2469 c->text = imhtml; |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2470 update_icon(c); |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2471 update_checkbox(c); |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2472 |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2473 x = x->next; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2474 } |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2475 if (all_convos) |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2476 gtk_widget_destroy(all_convos); |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2477 all_convos = NULL; |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2478 convo_notebook = NULL; |
1573
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2479 conversations = m; |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2480 } |
3a8bd72f431f
[gaim-migrate @ 1583]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1532
diff
changeset
|
2481 } |
1587
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
2482 |
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
2483 void set_convo_tab_label(struct conversation *c, char *text) |
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
2484 { |
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
2485 gtk_label_set_text(GTK_LABEL(gtk_notebook_get_tab_label(GTK_NOTEBOOK(convo_notebook), |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2486 gtk_notebook_get_nth_page(GTK_NOTEBOOK |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2487 (convo_notebook), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2488 g_list_index |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2489 (conversations, |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2490 c)))), text); |
1587
69a004b5820a
[gaim-migrate @ 1597]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1583
diff
changeset
|
2491 } |
1590
b4e54a752676
[gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1587
diff
changeset
|
2492 |
b4e54a752676
[gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1587
diff
changeset
|
2493 void raise_convo_tab(struct conversation *c) |
b4e54a752676
[gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1587
diff
changeset
|
2494 { |
b4e54a752676
[gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1587
diff
changeset
|
2495 gtk_notebook_set_page(GTK_NOTEBOOK(convo_notebook), g_list_index(conversations, c)); |
1617
f30f719e5933
[gaim-migrate @ 1627]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1608
diff
changeset
|
2496 gdk_window_show(c->window->window); |
1590
b4e54a752676
[gaim-migrate @ 1600]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1587
diff
changeset
|
2497 } |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2498 |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2499 void update_im_tabs() |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2500 { |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2501 if (!convo_notebook || !all_convos) |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2502 return; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2503 if (im_options & OPT_IM_SIDE_TAB) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2504 if (im_options & OPT_IM_BR_TAB) { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2505 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), GTK_POS_RIGHT); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2506 } else { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2507 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), GTK_POS_LEFT); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2508 } |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2509 } else { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2510 if (im_options & OPT_IM_BR_TAB) { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2511 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), GTK_POS_BOTTOM); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2512 } else { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2513 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(convo_notebook), GTK_POS_TOP); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2514 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2515 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2516 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2517 |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2518 void update_chat_tabs() |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2519 { |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2520 if (!chat_notebook || !all_chats) |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2521 return; |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2522 if (chat_options & OPT_CHAT_SIDE_TAB) { |
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2523 if (chat_options & OPT_CHAT_BR_TAB) { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2524 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), GTK_POS_RIGHT); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2525 } else { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2526 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), GTK_POS_LEFT); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2527 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2528 } else { |
2313
bd9d403fb15b
[gaim-migrate @ 2323]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2303
diff
changeset
|
2529 if (chat_options & OPT_CHAT_BR_TAB) { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2530 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), GTK_POS_BOTTOM); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2531 } else { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2532 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(chat_notebook), GTK_POS_TOP); |
1757
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2533 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2534 } |
3dfe4aefd366
[gaim-migrate @ 1767]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1735
diff
changeset
|
2535 } |
1759
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2536 |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2537 void update_convo_color(gboolean fg) |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2538 { |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2539 GList *c = conversations; |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2540 struct conversation *b; |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2541 |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2542 while (c) { |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2543 b = c->data; |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2544 c = c->next; |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2545 if (fg) { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2546 if (b->hasfg) |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2547 continue; |
1759
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2548 b->fgcol = fgcolor; |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2549 } else { |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2550 if (b->hasbg) |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2551 continue; |
1759
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2552 b->bgcol = bgcolor; |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2553 } |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2554 } |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2555 } |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2556 |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2557 void update_convo_font() |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2558 { |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2559 GList *c = conversations; |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2560 struct conversation *b; |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2561 |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2562 while (c) { |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2563 b = c->data; |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2564 c = c->next; |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2565 if (b->hasfont) |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2566 continue; |
1759
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2567 sprintf(b->fontface, "%s", fontface); |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2568 } |
e0f936b4c91a
[gaim-migrate @ 1769]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1757
diff
changeset
|
2569 } |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2570 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2571 #if USE_PIXBUF |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2572 #include <gdk-pixbuf/gdk-pixbuf.h> |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2573 #include <gdk-pixbuf/gdk-pixbuf-loader.h> |
2227
a93a6fe22330
[gaim-migrate @ 2237]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2213
diff
changeset
|
2574 |
a93a6fe22330
[gaim-migrate @ 2237]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2213
diff
changeset
|
2575 #define SCALE(x) ((gdk_pixbuf_animation_get_width(x) <= 48 && gdk_pixbuf_animation_get_height(x) <= 48) \ |
a93a6fe22330
[gaim-migrate @ 2237]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2213
diff
changeset
|
2576 ? 48 : 50) |
a93a6fe22330
[gaim-migrate @ 2237]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2213
diff
changeset
|
2577 #define SCALEBUF(x) ((gdk_pixbuf_get_width(x) <= 48 && gdk_pixbuf_get_height(x) <= 48) ? 48 : 50) |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2578 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2579 static gboolean redraw_icon(gpointer data) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2580 { |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2581 struct conversation *c = data; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2582 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2583 GList *frames; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2584 GdkPixbufFrame *frame; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2585 GdkPixbuf *buf; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2586 GdkPixbuf *scale; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2587 GdkPixmap *src; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2588 GdkPixmap *pm; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2589 GdkBitmap *bm; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2590 GdkGC *gc; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2591 gint delay; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2592 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2593 if (!g_list_find(conversations, c)) { |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2594 debug_printf("I think this is a bug.\n"); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2595 return FALSE; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2596 } |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2597 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2598 frames = gdk_pixbuf_animation_get_frames(c->anim); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2599 frame = g_list_nth_data(frames, c->frame); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2600 switch (gdk_pixbuf_frame_get_action(frame)) { |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2601 case GDK_PIXBUF_FRAME_RETAIN: |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2602 buf = gdk_pixbuf_frame_get_pixbuf(frame); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2603 scale = gdk_pixbuf_scale_simple(buf, |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2604 MAX(gdk_pixbuf_get_width(buf) * SCALE(c->anim) / |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2605 gdk_pixbuf_animation_get_width(c->anim), 1), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2606 MAX(gdk_pixbuf_get_height(buf) * SCALE(c->anim) / |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2607 gdk_pixbuf_animation_get_height(c->anim), 1), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2608 GDK_INTERP_NEAREST); |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2609 gdk_pixbuf_render_pixmap_and_mask(scale, &src, NULL, 0); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2610 gdk_pixbuf_unref(scale); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2611 gtk_pixmap_get(GTK_PIXMAP(c->icon), &pm, &bm); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2612 gc = gdk_gc_new(pm); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2613 gdk_draw_pixmap(pm, gc, src, 0, 0, |
2227
a93a6fe22330
[gaim-migrate @ 2237]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2213
diff
changeset
|
2614 MAX(gdk_pixbuf_frame_get_x_offset(frame) * SCALE(c->anim) / |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2615 gdk_pixbuf_animation_get_width(c->anim), 1), |
2227
a93a6fe22330
[gaim-migrate @ 2237]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2213
diff
changeset
|
2616 MAX(gdk_pixbuf_frame_get_y_offset(frame) * SCALE(c->anim) / |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2617 gdk_pixbuf_animation_get_height(c->anim), 1), -1, -1); |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2618 gdk_pixmap_unref(src); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2619 gtk_widget_queue_draw(c->icon); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2620 gdk_gc_unref(gc); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2621 break; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2622 case GDK_PIXBUF_FRAME_DISPOSE: |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2623 buf = gdk_pixbuf_frame_get_pixbuf(frame); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2624 scale = gdk_pixbuf_scale_simple(buf, |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2625 MAX(gdk_pixbuf_get_width(buf) * SCALE(c->anim) / |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2626 gdk_pixbuf_animation_get_width(c->anim), 1), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2627 MAX(gdk_pixbuf_get_height(buf) * SCALE(c->anim) / |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2628 gdk_pixbuf_animation_get_height(c->anim), 1), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2629 GDK_INTERP_NEAREST); |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2630 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2631 gdk_pixbuf_unref(scale); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2632 gtk_pixmap_set(GTK_PIXMAP(c->icon), pm, bm); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2633 gdk_pixmap_unref(pm); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2634 if (bm) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2635 gdk_bitmap_unref(bm); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2636 break; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2637 case GDK_PIXBUF_FRAME_REVERT: |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2638 frame = frames->data; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2639 buf = gdk_pixbuf_frame_get_pixbuf(frame); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2640 scale = gdk_pixbuf_scale_simple(buf, |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2641 MAX(gdk_pixbuf_get_width(buf) * SCALE(c->anim) / |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2642 gdk_pixbuf_animation_get_width(c->anim), 1), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2643 MAX(gdk_pixbuf_get_height(buf) * SCALE(c->anim) / |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2644 gdk_pixbuf_animation_get_height(c->anim), 1), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2645 GDK_INTERP_NEAREST); |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2646 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2647 gdk_pixbuf_unref(scale); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2648 gtk_pixmap_set(GTK_PIXMAP(c->icon), pm, bm); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2649 gdk_pixmap_unref(pm); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2650 if (bm) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2651 gdk_bitmap_unref(bm); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2652 break; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2653 } |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2654 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2655 c->frame = (c->frame + 1) % g_list_length(frames); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2656 delay = MAX(gdk_pixbuf_frame_get_delay_time(frame), 13); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2657 c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2658 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2659 return FALSE; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2660 } |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2661 #endif |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2662 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2663 void remove_icon(struct conversation *c) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2664 { |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2665 #if USE_PIXBUF |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2666 if (c->icon) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2667 gtk_container_remove(GTK_CONTAINER(c->bbox), c->icon); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2668 c->icon = NULL; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2669 if (c->anim) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2670 gdk_pixbuf_animation_unref(c->anim); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2671 c->anim = NULL; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2672 if (c->unanim) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2673 gdk_pixbuf_unref(c->unanim); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2674 c->unanim = NULL; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2675 if (c->icon_timer) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2676 gtk_timeout_remove(c->icon_timer); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2677 c->icon_timer = 0; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2678 c->frame = 0; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2679 #endif |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2680 } |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2681 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2682 void update_icon(struct conversation *c) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2683 { |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2684 #if USE_PIXBUF |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2685 void *data; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2686 int len; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2687 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2688 GdkPixbufLoader *load; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2689 GdkPixbuf *scale; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2690 GdkPixmap *pm; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2691 GdkBitmap *bm; |
2264
2993b6091a53
[gaim-migrate @ 2274]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
2692 int sf = 0; |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2693 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2694 if (!c) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2695 return; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2696 |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2697 remove_icon(c); |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2698 |
2323
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
2699 if (im_options & OPT_IM_HIDE_ICONS) |
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
2700 return; |
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
2701 |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2702 if (!c->gc) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2703 return; |
2195
d615f7e2d8c4
[gaim-migrate @ 2205]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2191
diff
changeset
|
2704 |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2705 data = get_icon_data(c->gc, normalize(c->name), &len); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2706 if (!data) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2707 return; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2708 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2709 load = gdk_pixbuf_loader_new(); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2710 gdk_pixbuf_loader_write(load, data, len); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2711 c->anim = gdk_pixbuf_loader_get_animation(load); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2712 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2713 if (c->anim) { |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2714 GList *frames = gdk_pixbuf_animation_get_frames(c->anim); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2715 GdkPixbuf *buf = gdk_pixbuf_frame_get_pixbuf(frames->data); |
2264
2993b6091a53
[gaim-migrate @ 2274]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
2716 sf = SCALE(c->anim); |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2717 scale = gdk_pixbuf_scale_simple(buf, |
2372
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2718 MAX(gdk_pixbuf_get_width(buf) * sf / |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2719 gdk_pixbuf_animation_get_width(c->anim), 1), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2720 MAX(gdk_pixbuf_get_height(buf) * sf / |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2721 gdk_pixbuf_animation_get_height(c->anim), 1), |
2927c2c26fe6
[gaim-migrate @ 2385]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2363
diff
changeset
|
2722 GDK_INTERP_NEAREST); |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2723 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2724 if (gdk_pixbuf_animation_get_num_frames(c->anim) > 1) { |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2725 int delay = MAX(gdk_pixbuf_frame_get_delay_time(frames->data), 13); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2726 c->frame = 1; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2727 c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2728 } |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2729 } else { |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2730 c->unanim = gdk_pixbuf_loader_get_pixbuf(load); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2731 if (!c->unanim) { |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2732 gdk_pixbuf_loader_close(load); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2733 return; |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2734 } |
2264
2993b6091a53
[gaim-migrate @ 2274]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
2735 sf = SCALEBUF(c->unanim); |
2993b6091a53
[gaim-migrate @ 2274]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
2736 scale = gdk_pixbuf_scale_simple(c->unanim, sf, sf, GDK_INTERP_NEAREST); |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2737 } |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2738 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2739 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2740 gdk_pixbuf_unref(scale); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2741 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2742 c->icon = gtk_pixmap_new(pm, bm); |
2264
2993b6091a53
[gaim-migrate @ 2274]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2246
diff
changeset
|
2743 gtk_widget_set_usize(c->icon, sf, sf); |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2744 gtk_box_pack_start(GTK_BOX(c->bbox), c->icon, FALSE, FALSE, 5); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2745 gtk_widget_show(c->icon); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2746 gdk_pixmap_unref(pm); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2747 if (bm) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2748 gdk_bitmap_unref(bm); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2749 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2750 gdk_pixbuf_loader_close(load); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2751 #endif |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2752 } |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2753 |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2754 void got_new_icon(struct gaim_connection *gc, char *who) |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2755 { |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2756 struct conversation *c = find_conversation(who); |
2245
31157c54fe6e
[gaim-migrate @ 2255]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2239
diff
changeset
|
2757 if (c && (c->gc == gc)) |
2191
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2758 update_icon(c); |
657dbe515608
[gaim-migrate @ 2201]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2167
diff
changeset
|
2759 } |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2760 |
2323
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
2761 void set_hide_icons() |
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
2762 { |
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
2763 GList *c = conversations; |
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
2764 while (c) { |
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
2765 update_icon(c->data); |
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
2766 c = c->next; |
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
2767 } |
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
2768 } |
bde2481bb4db
[gaim-migrate @ 2333]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2313
diff
changeset
|
2769 |
2231
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2770 static void remove_checkbox(struct conversation *c) |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2771 { |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2772 if (c->check) |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2773 gtk_container_remove(GTK_CONTAINER(c->lbox), c->check); |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2774 c->check = NULL; |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2775 } |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2776 |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2777 static void update_checkbox(struct conversation *c) |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2778 { |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2779 if (!c) |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2780 return; |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2781 |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2782 remove_checkbox(c); |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2783 |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2784 if (!c->gc) |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2785 return; |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2786 |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2787 if (!c->gc->prpl->checkbox) |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2788 return; |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2789 |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2790 c->check = gtk_check_button_new_with_label(c->gc->prpl->checkbox); |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2791 gtk_box_pack_start(GTK_BOX(c->lbox), c->check, FALSE, FALSE, 5); |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2792 gtk_widget_show(c->check); |
8c4ff1a368bd
[gaim-migrate @ 2241]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2227
diff
changeset
|
2793 } |