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