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