Mercurial > pidgin
annotate plugins/spellchk.c @ 9846:c28d5b45624e
[gaim-migrate @ 10724]
A patch from Nathan Fredrickson that should make Gaim not play
sounds for people joining chats when you join chat.
Um, his explanation is better:
http://sourceforge.net/tracker/index.php?func=detail&aid=1008904&group_id=235&atid=300235
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 24 Aug 2004 04:12:28 +0000 |
parents | 4a15962c344a |
children | f8e395a054e2 |
rev | line source |
---|---|
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
1 /* |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
2 * A lot of this code (especially the config code) was taken directly |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
3 * or nearly directly from xchat, version 1.4.2 by Peter Zelezny and others. |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
4 */ |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
5 #include "internal.h" |
9791 | 6 #include "gtkgaim.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
7 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
8 #include "debug.h" |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
9 #include "signals.h" |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
10 #include "util.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
11 |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
12 #include "gtkplugin.h" |
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5587
diff
changeset
|
13 #include "gtkutils.h" |
4202
59751fe608c5
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4165
diff
changeset
|
14 |
6735 | 15 #include <stdio.h> |
16 #include <string.h> | |
6849
3c885e6784ee
[gaim-migrate @ 7394]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6780
diff
changeset
|
17 #ifndef _WIN32 |
6735 | 18 #include <strings.h> |
6849
3c885e6784ee
[gaim-migrate @ 7394]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6780
diff
changeset
|
19 #endif |
6735 | 20 #include <sys/types.h> |
21 #include <sys/stat.h> | |
22 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
23 #define SPELLCHECK_PLUGIN_ID "gtk-spellcheck" |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
24 |
4348 | 25 enum { |
26 BAD_COLUMN, | |
27 GOOD_COLUMN, | |
28 N_COLUMNS | |
103 | 29 }; |
30 | |
4348 | 31 static int num_words(const char *); |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
32 static int get_word(char *, int); |
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
33 static char *have_word(char *, int); |
4348 | 34 static void substitute(char **, int, int, const char *); |
35 static GtkListStore *model; | |
103 | 36 |
6780
e9a730ad5a3c
[gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
37 static gboolean |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
38 substitute_words(GaimAccount *account, GaimConversation *conv, |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
39 char **message, void *data) |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
40 { |
103 | 41 int i, l; |
42 int word; | |
43 char *tmp; | |
44 | |
45 if (message == NULL || *message == NULL) | |
6780
e9a730ad5a3c
[gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
46 return FALSE; |
103 | 47 |
48 l = num_words(*message); | |
49 for (i = 0; i < l; i++) { | |
4348 | 50 GtkTreeIter iter; |
103 | 51 word = get_word(*message, i); |
4348 | 52 if(gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) { |
53 do { | |
54 GValue val0, val1; | |
55 const char *bad, *good; | |
56 memset(&val0, 0, sizeof(val0)); | |
57 memset(&val1, 0, sizeof(val1)); | |
58 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 0, &val0); | |
59 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 1, &val1); | |
60 tmp = have_word(*message, word); | |
61 bad = g_value_get_string(&val0); | |
62 good = g_value_get_string(&val1); | |
63 if (!strcmp(tmp, bad)) { | |
64 substitute(message, word, strlen(bad), | |
65 good); | |
66 l += num_words(good) - num_words(bad); | |
67 i += num_words(good) - num_words(bad); | |
68 } | |
69 free(tmp); | |
70 g_value_unset(&val0); | |
71 g_value_unset(&val1); | |
72 } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter)); | |
103 | 73 } |
74 } | |
6780
e9a730ad5a3c
[gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
75 |
e9a730ad5a3c
[gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents:
6735
diff
changeset
|
76 return FALSE; |
103 | 77 } |
78 | |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
79 static int buf_get_line(char *ibuf, char **buf, int *position, int len) { |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
80 int pos = *position, spos = pos; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
81 |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
82 if (pos == len) |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
83 return 0; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
84 |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
85 while (ibuf[pos++] != '\n') { |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
86 if (pos == len) |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
87 return 0; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
88 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
89 pos--; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
90 ibuf[pos] = 0; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
91 *buf = &ibuf[spos]; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
92 pos++; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
93 *position = pos; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
94 return 1; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
95 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
96 |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
97 static void load_conf() { |
4348 | 98 const char * const defaultconf = "BAD r\nGOOD are\n\n" |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
99 "BAD u\nGOOD you\n\n" |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
100 "BAD teh\nGOOD the\n\n"; |
7466 | 101 gchar *buf, *ibuf; |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
102 char name[82]; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
103 char cmd[256]; |
4348 | 104 int pnt = 0; |
105 gsize size; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
106 |
4348 | 107 model = gtk_list_store_new((gint)N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING); |
103 | 108 |
7466 | 109 buf = g_build_filename(gaim_user_dir(), "dict", NULL); |
4348 | 110 g_file_get_contents(buf, &ibuf, &size, NULL); |
7606 | 111 g_free(buf); |
4348 | 112 if(!ibuf) { |
113 ibuf = g_strdup(defaultconf); | |
114 size = strlen(defaultconf); | |
106
e05e6373ea5a
[gaim-migrate @ 116]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
103
diff
changeset
|
115 } |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
116 |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
117 cmd[0] = 0; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
118 name[0] = 0; |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
119 |
4348 | 120 while(buf_get_line(ibuf, &buf, &pnt, size)) { |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
121 if (*buf != '#') { |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
122 if (!strncasecmp(buf, "BAD ", 4)) |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
123 strncpy(name, buf + 4, 81); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
124 if (!strncasecmp(buf, "GOOD ", 5)) { |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
125 strncpy(cmd, buf + 5, 255); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
126 if (*name) { |
4348 | 127 GtkTreeIter iter; |
128 gtk_list_store_append(model, &iter); | |
129 gtk_list_store_set(model, &iter, | |
130 0, g_strdup(name), | |
131 1, g_strdup(cmd), | |
132 -1); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
133 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
134 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
135 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
136 } |
7606 | 137 g_free(ibuf); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
138 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
139 |
103 | 140 |
141 | |
4348 | 142 static int num_words(const char *m) { |
103 | 143 int count = 0; |
7631 | 144 guint pos; |
103 | 145 int state = 0; |
146 | |
147 for (pos = 0; pos < strlen(m); pos++) { | |
148 switch (state) { | |
149 case 0: /* expecting word */ | |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
150 if (!g_ascii_isspace(m[pos]) && !g_ascii_ispunct(m[pos])) { |
103 | 151 count++; |
152 state = 1; | |
153 } else if (m[pos] == '<') | |
154 state = 2; | |
155 break; | |
156 case 1: /* inside word */ | |
112
a57fd3390ee4
[gaim-migrate @ 122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
111
diff
changeset
|
157 if (m[pos] == '<') |
a57fd3390ee4
[gaim-migrate @ 122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
111
diff
changeset
|
158 state = 2; |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
159 else if (g_ascii_isspace(m[pos]) || g_ascii_ispunct(m[pos])) |
103 | 160 state = 0; |
161 break; | |
162 case 2: /* inside HTML tag */ | |
163 if (m[pos] == '>') | |
164 state = 0; | |
165 break; | |
166 } | |
167 } | |
168 return count; | |
169 } | |
170 | |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
171 static int get_word(char *m, int word) { |
103 | 172 int count = 0; |
7631 | 173 guint pos = 0; |
103 | 174 int state = 0; |
175 | |
176 for (pos = 0; pos < strlen(m) && count <= word; pos++) { | |
177 switch (state) { | |
178 case 0: | |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
179 if (!g_ascii_isspace(m[pos]) && !g_ascii_ispunct(m[pos])) { |
103 | 180 count++; |
181 state = 1; | |
182 } else if (m[pos] == '<') | |
183 state = 2; | |
184 break; | |
185 case 1: | |
112
a57fd3390ee4
[gaim-migrate @ 122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
111
diff
changeset
|
186 if (m[pos] == '<') |
a57fd3390ee4
[gaim-migrate @ 122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
111
diff
changeset
|
187 state = 2; |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
188 else if (g_ascii_isspace(m[pos]) || g_ascii_ispunct(m[pos])) |
103 | 189 state = 0; |
190 break; | |
191 case 2: | |
192 if (m[pos] == '>') | |
193 state = 0; | |
194 break; | |
195 } | |
196 } | |
197 return pos - 1; | |
198 } | |
199 | |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
200 static char *have_word(char *m, int pos) { |
3733 | 201 char *tmp = strpbrk(&m[pos], "' \t\f\r\n\"><.?!-,/"); |
103 | 202 int len = (int)(tmp - &m[pos]); |
203 | |
204 if (tmp == NULL) { | |
205 tmp = strdup(&m[pos]); | |
206 return tmp; | |
207 } | |
208 | |
209 tmp = malloc(len + 1); | |
210 tmp[0] = 0; | |
211 strncat(tmp, &m[pos], len); | |
212 | |
213 return tmp; | |
214 } | |
215 | |
4348 | 216 static void substitute(char **mes, int pos, int m, const char *text) { |
257
a93e273ca1d6
[gaim-migrate @ 267]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
208
diff
changeset
|
217 char *new = g_malloc(strlen(*mes) + strlen(text) + 1); |
8673 | 218 char *tmp; |
103 | 219 new[0] = 0; |
220 | |
221 strncat(new, *mes, pos); | |
222 strcat(new, text); | |
223 | |
224 strcat(new, &(*mes)[pos + m]); | |
8673 | 225 tmp = *mes; |
103 | 226 *mes = new; |
8673 | 227 g_free(tmp); |
103 | 228 } |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
229 |
4348 | 230 static GtkWidget *tree; |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
231 static GtkWidget *bad_entry; |
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
232 static GtkWidget *good_entry; |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
233 |
4348 | 234 static void save_list(); |
235 | |
236 static void on_edited(GtkCellRendererText *cellrenderertext, | |
6116 | 237 gchar *path, gchar *arg2, gpointer data) |
4348 | 238 { |
239 GtkTreeIter iter; | |
240 GValue val; | |
241 if(arg2[0] == '\0') { | |
242 gdk_beep(); | |
243 return; | |
244 } | |
245 memset(&val, 0, sizeof(val)); | |
246 g_return_if_fail(gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(model), &iter, path)); | |
247 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, GPOINTER_TO_INT(data), &val); | |
248 if(strcmp(arg2, g_value_get_string(&val))) { | |
249 gtk_list_store_set(model, &iter, GPOINTER_TO_INT(data), arg2, -1); | |
250 save_list(); | |
251 } | |
252 g_value_unset(&val); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
253 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
254 |
4348 | 255 static void list_add_new() |
256 { | |
257 GtkTreeIter iter; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
258 |
4348 | 259 gtk_list_store_append(model, &iter); |
260 gtk_list_store_set(model, &iter, | |
261 0, gtk_entry_get_text(GTK_ENTRY(bad_entry)), | |
262 1, gtk_entry_get_text(GTK_ENTRY(good_entry)), | |
263 -1); | |
264 gtk_editable_select_region(GTK_EDITABLE(bad_entry), 0, -1); | |
265 gtk_widget_grab_focus(bad_entry); | |
4601 | 266 |
267 save_list(); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
268 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
269 |
4348 | 270 static void add_selected_row_to_list(GtkTreeModel *model, GtkTreePath *path, |
271 GtkTreeIter *iter, gpointer data) | |
272 { | |
273 GSList **list = (GSList **)data; | |
274 *list = g_slist_append(*list, gtk_tree_path_copy(path) ); | |
275 } | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
276 |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
277 |
4348 | 278 static void remove_row(void *data1, gpointer data2) |
279 { | |
280 GtkTreePath *path = (GtkTreePath*)data1; | |
281 GtkTreeIter iter; | |
282 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path); | |
283 gtk_list_store_remove(model, &iter); | |
284 gtk_tree_path_free(path); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
285 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
286 |
4348 | 287 static void list_delete() |
288 { | |
289 GtkTreeSelection *sel; | |
290 GSList *list = NULL; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
291 |
4348 | 292 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); |
293 gtk_tree_selection_selected_foreach(sel, add_selected_row_to_list, &list); | |
294 | |
295 g_slist_foreach(list, remove_row, NULL); | |
296 g_slist_free(list); | |
4601 | 297 |
298 save_list(); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
299 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
300 |
4348 | 301 static void save_list() |
302 { | |
303 FILE *f; | |
304 char *name; | |
305 GtkTreeIter iter; | |
306 char tempfilename[BUF_LONG]; | |
307 int fd; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
308 |
8596 | 309 name = g_build_filename(gaim_user_dir(), "dict", NULL); |
4348 | 310 strcpy(tempfilename, name); |
311 strcat(tempfilename,".XXXXXX"); | |
312 fd = g_mkstemp(tempfilename); | |
313 if(fd<0) { | |
314 perror(tempfilename); | |
315 g_free(name); | |
316 return; | |
317 } | |
318 if (!(f = fdopen(fd, "w"))) { | |
319 perror("fdopen"); | |
320 close(fd); | |
321 g_free(name); | |
322 return; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
323 } |
4348 | 324 |
325 fchmod(fd, S_IRUSR | S_IWUSR); | |
4373
dcc6c130c6d9
[gaim-migrate @ 4639]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4363
diff
changeset
|
326 |
4348 | 327 if(gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) { |
328 do { | |
329 GValue val0, val1; | |
330 memset(&val0, 0, sizeof(val0)); | |
331 memset(&val1, 0, sizeof(val1)); | |
332 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 0, &val0); | |
333 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 1, &val1); | |
334 fprintf(f, "BAD %s\nGOOD %s\n\n", g_value_get_string(&val0), g_value_get_string(&val1)); | |
335 g_value_unset(&val0); | |
336 g_value_unset(&val1); | |
337 } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter)); | |
338 } | |
339 if(fclose(f)) { | |
5227
6d1707dc8c3d
[gaim-migrate @ 5597]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
340 gaim_debug(GAIM_DEBUG_ERROR, "spellchk", |
6d1707dc8c3d
[gaim-migrate @ 5597]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
341 "Error writing to %s: %m\n", tempfilename); |
4348 | 342 unlink(tempfilename); |
343 g_free(name); | |
344 return; | |
345 } | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
346 rename(tempfilename, name); |
4348 | 347 g_free(name); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
348 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
349 |
4348 | 350 static void |
351 check_if_something_is_selected(GtkTreeModel *model, | |
352 GtkTreePath *path, GtkTreeIter *iter, gpointer data) | |
353 { | |
354 *((gboolean*)data) = TRUE; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
355 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
356 |
4348 | 357 static void on_selection_changed(GtkTreeSelection *sel, |
358 gpointer data) | |
359 { | |
360 gboolean is = FALSE; | |
361 gtk_tree_selection_selected_foreach(sel, check_if_something_is_selected, &is); | |
362 gtk_widget_set_sensitive((GtkWidget*)data, is); | |
363 } | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
364 |
4348 | 365 static gboolean non_empty(const char *s) |
366 { | |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
367 while(*s && g_ascii_isspace(*s)) |
4348 | 368 s++; |
369 return *s; | |
370 } | |
371 | |
372 static void on_entry_changed(GtkEditable *editable, gpointer data) | |
373 { | |
374 gtk_widget_set_sensitive((GtkWidget*)data, | |
375 non_empty(gtk_entry_get_text(GTK_ENTRY(bad_entry))) && | |
376 non_empty(gtk_entry_get_text(GTK_ENTRY(good_entry)))); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
377 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
378 |
3630 | 379 /* |
380 * EXPORTED FUNCTIONS | |
381 */ | |
382 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
383 static gboolean |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
384 plugin_load(GaimPlugin *plugin) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
385 { |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
386 void *conv_handle = gaim_conversations_get_handle(); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
387 |
3630 | 388 load_conf(); |
389 | |
8579 | 390 gaim_signal_connect(conv_handle, "writing-im-msg", |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
391 plugin, GAIM_CALLBACK(substitute_words), NULL); |
8579 | 392 gaim_signal_connect(conv_handle, "writing-chat-msg", |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
393 plugin, GAIM_CALLBACK(substitute_words), NULL); |
3630 | 394 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
395 return TRUE; |
3630 | 396 } |
397 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
398 static GtkWidget * |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
399 get_config_frame(GaimPlugin *plugin) |
4348 | 400 { |
3565 | 401 GtkWidget *ret, *vbox, *win; |
4348 | 402 GtkWidget *hbox, *label; |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
403 GtkWidget *button; |
4348 | 404 GtkSizeGroup *sg; |
405 GtkCellRenderer *renderer; | |
406 GtkTreeViewColumn *column; | |
407 | |
408 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
3565 | 409 |
410 ret = gtk_vbox_new(FALSE, 18); | |
411 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
412 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5227
diff
changeset
|
413 vbox = gaim_gtk_make_frame(ret, _("Text Replacements")); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
414 gtk_container_set_border_width(GTK_CONTAINER(vbox), 4); |
4348 | 415 gtk_widget_set_size_request(vbox, 300, -1); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
416 gtk_widget_show (vbox); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
417 |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
418 win = gtk_scrolled_window_new(0, 0); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
419 gtk_container_add(GTK_CONTAINER(vbox), win); |
4750
03ea71acade3
[gaim-migrate @ 5065]
Christian Hammond <chipx86@chipx86.com>
parents:
4601
diff
changeset
|
420 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(win), |
03ea71acade3
[gaim-migrate @ 5065]
Christian Hammond <chipx86@chipx86.com>
parents:
4601
diff
changeset
|
421 GTK_SHADOW_IN); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
422 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (win), |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
423 GTK_POLICY_AUTOMATIC, |
4348 | 424 GTK_POLICY_AUTOMATIC); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
425 gtk_widget_show(win); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
426 |
4348 | 427 tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model)); |
428 /* gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(tree), TRUE); */ | |
429 gtk_widget_set_size_request(tree, 260,200); | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
430 |
4348 | 431 renderer = gtk_cell_renderer_text_new (); |
432 g_object_set (G_OBJECT (renderer), | |
433 "editable", TRUE, | |
434 NULL); | |
435 g_signal_connect(G_OBJECT(renderer), "edited", | |
436 G_CALLBACK(on_edited), GINT_TO_POINTER(0)); | |
437 column = gtk_tree_view_column_new_with_attributes (_("You type"), | |
438 renderer, "text", BAD_COLUMN, NULL); | |
439 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); | |
440 gtk_tree_view_column_set_fixed_width(column, 130); | |
441 /* gtk_tree_view_column_set_resizable(column, TRUE); */ | |
442 gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); | |
443 renderer = gtk_cell_renderer_text_new (); | |
444 g_object_set (G_OBJECT (renderer), | |
445 "editable", TRUE, | |
446 NULL); | |
447 g_signal_connect(G_OBJECT(renderer), "edited", | |
448 G_CALLBACK(on_edited), GINT_TO_POINTER(1)); | |
449 column = gtk_tree_view_column_new_with_attributes (_("You send"), | |
450 renderer, "text", GOOD_COLUMN, NULL); | |
451 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); | |
452 gtk_tree_view_column_set_fixed_width(column, 130); | |
453 /* gtk_tree_view_column_set_resizable(column, TRUE); */ | |
454 gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); | |
455 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)), | |
456 GTK_SELECTION_MULTIPLE); | |
457 gtk_container_add(GTK_CONTAINER(win), tree); | |
458 gtk_widget_show(tree); | |
459 | |
460 hbox = gtk_hbutton_box_new(); | |
461 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
462 gtk_widget_show(hbox); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
463 |
4348 | 464 button = gtk_button_new_from_stock(GTK_STOCK_DELETE); |
465 g_signal_connect(G_OBJECT(button), "clicked", | |
466 G_CALLBACK(list_delete), NULL); | |
467 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
468 gtk_widget_set_sensitive(button, FALSE); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
469 |
4348 | 470 g_signal_connect(G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree))), |
471 "changed", G_CALLBACK(on_selection_changed), button); | |
472 | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
473 gtk_widget_show(button); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
474 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5227
diff
changeset
|
475 vbox = gaim_gtk_make_frame(ret, _("Add a new text replacement")); |
4348 | 476 gtk_widget_set_size_request(vbox, 300, -1); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
477 |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
478 hbox = gtk_hbox_new(FALSE, 2); |
4348 | 479 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
480 gtk_widget_show(hbox); | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
481 |
4348 | 482 label = gtk_label_new_with_mnemonic(_("You _type:")); |
483 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
484 | |
485 bad_entry = gtk_entry_new(); | |
486 gtk_entry_set_max_length(GTK_ENTRY(bad_entry), 40); | |
487 gtk_box_pack_start(GTK_BOX(hbox), bad_entry, TRUE, TRUE, 0); | |
488 gtk_size_group_add_widget(sg, bad_entry); | |
489 gtk_label_set_mnemonic_widget(GTK_LABEL(label), bad_entry); | |
490 gtk_widget_show(bad_entry); | |
491 | |
492 hbox = gtk_hbox_new(FALSE, 2); | |
493 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
494 gtk_widget_show(hbox); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
495 |
4348 | 496 label = gtk_label_new_with_mnemonic(_("You _send:")); |
497 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
498 |
4348 | 499 good_entry = gtk_entry_new(); |
500 gtk_entry_set_max_length(GTK_ENTRY(good_entry), 255); | |
501 gtk_box_pack_start(GTK_BOX(hbox), good_entry, TRUE, TRUE, 0); | |
502 gtk_size_group_add_widget(sg, good_entry); | |
503 gtk_label_set_mnemonic_widget(GTK_LABEL(label), good_entry); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
504 gtk_widget_show(good_entry); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
505 |
4348 | 506 hbox = gtk_hbutton_box_new(); |
507 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
508 button = gtk_button_new_from_stock(GTK_STOCK_ADD); | |
509 g_signal_connect(G_OBJECT(button), "clicked", | |
510 G_CALLBACK(list_add_new), NULL); | |
511 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
512 g_signal_connect(G_OBJECT(bad_entry), "changed", G_CALLBACK(on_entry_changed), button); | |
513 g_signal_connect(G_OBJECT(good_entry), "changed", G_CALLBACK(on_entry_changed), button); | |
514 gtk_widget_set_sensitive(button, FALSE); | |
515 gtk_widget_show(button); | |
516 | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
517 |
3565 | 518 gtk_widget_show_all(ret); |
519 return ret; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
520 } |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
521 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
522 static GaimGtkPluginUiInfo ui_info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
523 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
524 get_config_frame |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
525 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
526 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
527 static GaimPluginInfo info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
528 { |
8749
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
8673
diff
changeset
|
529 GAIM_PLUGIN_API_VERSION, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
530 GAIM_PLUGIN_STANDARD, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
531 GAIM_GTK_PLUGIN_TYPE, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
532 0, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
533 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
534 GAIM_PRIORITY_DEFAULT, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
535 SPELLCHECK_PLUGIN_ID, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
536 N_("Text replacement"), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
537 VERSION, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
538 N_("Replaces text in outgoing messages according to user-defined rules."), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
539 N_("Replaces text in outgoing messages according to user-defined rules."), |
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
540 "Eric Warmenhoven <eric@warmenhoven.org>", |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6250
diff
changeset
|
541 GAIM_WEBSITE, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
542 plugin_load, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
543 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
544 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
545 &ui_info, |
8993 | 546 NULL, |
547 NULL, | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
548 NULL |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
549 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
550 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
551 static void |
5920
7d385de2f9cd
[gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents:
5873
diff
changeset
|
552 init_plugin(GaimPlugin *plugin) |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
553 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
554 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
555 |
6063 | 556 GAIM_INIT_PLUGIN(spellcheck, init_plugin, info) |