Mercurial > pidgin.yaz
annotate plugins/spellchk.c @ 10711:00483ba950bf
[gaim-migrate @ 12301]
Add some comments to the proxy code, rename some functions, and shuffle
things around in a way that I think makes it much more readable.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 21 Mar 2005 02:14:46 +0000 |
parents | 0f7452b1f777 |
children | c932d96a7c69 |
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); |
10532
8f2b74c5aa24
[gaim-migrate @ 11860]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10234
diff
changeset
|
139 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model), |
8f2b74c5aa24
[gaim-migrate @ 11860]
Etan Reisner <pidgin@unreliablesource.net>
parents:
10234
diff
changeset
|
140 0, GTK_SORT_ASCENDING); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
141 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
142 |
103 | 143 |
144 | |
4348 | 145 static int num_words(const char *m) { |
103 | 146 int count = 0; |
7631 | 147 guint pos; |
103 | 148 int state = 0; |
149 | |
150 for (pos = 0; pos < strlen(m); pos++) { | |
151 switch (state) { | |
152 case 0: /* expecting word */ | |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
153 if (!g_ascii_isspace(m[pos]) && !g_ascii_ispunct(m[pos])) { |
103 | 154 count++; |
155 state = 1; | |
156 } else if (m[pos] == '<') | |
157 state = 2; | |
158 break; | |
159 case 1: /* inside word */ | |
112
a57fd3390ee4
[gaim-migrate @ 122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
111
diff
changeset
|
160 if (m[pos] == '<') |
a57fd3390ee4
[gaim-migrate @ 122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
111
diff
changeset
|
161 state = 2; |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
162 else if (g_ascii_isspace(m[pos]) || g_ascii_ispunct(m[pos])) |
103 | 163 state = 0; |
164 break; | |
165 case 2: /* inside HTML tag */ | |
166 if (m[pos] == '>') | |
167 state = 0; | |
168 break; | |
169 } | |
170 } | |
171 return count; | |
172 } | |
173 | |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
174 static int get_word(char *m, int word) { |
103 | 175 int count = 0; |
7631 | 176 guint pos = 0; |
103 | 177 int state = 0; |
178 | |
179 for (pos = 0; pos < strlen(m) && count <= word; pos++) { | |
180 switch (state) { | |
181 case 0: | |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
182 if (!g_ascii_isspace(m[pos]) && !g_ascii_ispunct(m[pos])) { |
103 | 183 count++; |
184 state = 1; | |
185 } else if (m[pos] == '<') | |
186 state = 2; | |
187 break; | |
188 case 1: | |
112
a57fd3390ee4
[gaim-migrate @ 122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
111
diff
changeset
|
189 if (m[pos] == '<') |
a57fd3390ee4
[gaim-migrate @ 122]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
111
diff
changeset
|
190 state = 2; |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
191 else if (g_ascii_isspace(m[pos]) || g_ascii_ispunct(m[pos])) |
103 | 192 state = 0; |
193 break; | |
194 case 2: | |
195 if (m[pos] == '>') | |
196 state = 0; | |
197 break; | |
198 } | |
199 } | |
200 return pos - 1; | |
201 } | |
202 | |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
203 static char *have_word(char *m, int pos) { |
3733 | 204 char *tmp = strpbrk(&m[pos], "' \t\f\r\n\"><.?!-,/"); |
103 | 205 int len = (int)(tmp - &m[pos]); |
206 | |
207 if (tmp == NULL) { | |
208 tmp = strdup(&m[pos]); | |
209 return tmp; | |
210 } | |
211 | |
212 tmp = malloc(len + 1); | |
213 tmp[0] = 0; | |
214 strncat(tmp, &m[pos], len); | |
215 | |
216 return tmp; | |
217 } | |
218 | |
4348 | 219 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
|
220 char *new = g_malloc(strlen(*mes) + strlen(text) + 1); |
8673 | 221 char *tmp; |
103 | 222 new[0] = 0; |
223 | |
224 strncat(new, *mes, pos); | |
225 strcat(new, text); | |
226 | |
227 strcat(new, &(*mes)[pos + m]); | |
8673 | 228 tmp = *mes; |
103 | 229 *mes = new; |
8673 | 230 g_free(tmp); |
103 | 231 } |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
232 |
4348 | 233 static GtkWidget *tree; |
1081
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
234 static GtkWidget *bad_entry; |
efcacae6acdb
[gaim-migrate @ 1091]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1047
diff
changeset
|
235 static GtkWidget *good_entry; |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
236 |
4348 | 237 static void save_list(); |
238 | |
239 static void on_edited(GtkCellRendererText *cellrenderertext, | |
6116 | 240 gchar *path, gchar *arg2, gpointer data) |
4348 | 241 { |
242 GtkTreeIter iter; | |
243 GValue val; | |
244 if(arg2[0] == '\0') { | |
245 gdk_beep(); | |
246 return; | |
247 } | |
248 memset(&val, 0, sizeof(val)); | |
249 g_return_if_fail(gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(model), &iter, path)); | |
250 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, GPOINTER_TO_INT(data), &val); | |
251 if(strcmp(arg2, g_value_get_string(&val))) { | |
252 gtk_list_store_set(model, &iter, GPOINTER_TO_INT(data), arg2, -1); | |
253 save_list(); | |
254 } | |
255 g_value_unset(&val); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
256 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
257 |
4348 | 258 static void list_add_new() |
259 { | |
260 GtkTreeIter iter; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
261 |
4348 | 262 gtk_list_store_append(model, &iter); |
263 gtk_list_store_set(model, &iter, | |
264 0, gtk_entry_get_text(GTK_ENTRY(bad_entry)), | |
265 1, gtk_entry_get_text(GTK_ENTRY(good_entry)), | |
266 -1); | |
10234 | 267 gtk_editable_delete_text(GTK_EDITABLE(bad_entry), 0, -1); |
268 gtk_editable_delete_text(GTK_EDITABLE(good_entry), 0, -1); | |
4348 | 269 gtk_widget_grab_focus(bad_entry); |
4601 | 270 |
271 save_list(); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
272 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
273 |
4348 | 274 static void add_selected_row_to_list(GtkTreeModel *model, GtkTreePath *path, |
275 GtkTreeIter *iter, gpointer data) | |
276 { | |
277 GSList **list = (GSList **)data; | |
278 *list = g_slist_append(*list, gtk_tree_path_copy(path) ); | |
279 } | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
280 |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
281 |
4348 | 282 static void remove_row(void *data1, gpointer data2) |
283 { | |
284 GtkTreePath *path = (GtkTreePath*)data1; | |
285 GtkTreeIter iter; | |
286 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path); | |
287 gtk_list_store_remove(model, &iter); | |
288 gtk_tree_path_free(path); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
289 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
290 |
4348 | 291 static void list_delete() |
292 { | |
293 GtkTreeSelection *sel; | |
294 GSList *list = NULL; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
295 |
4348 | 296 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); |
297 gtk_tree_selection_selected_foreach(sel, add_selected_row_to_list, &list); | |
298 | |
299 g_slist_foreach(list, remove_row, NULL); | |
300 g_slist_free(list); | |
4601 | 301 |
302 save_list(); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
303 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
304 |
4348 | 305 static void save_list() |
306 { | |
307 FILE *f; | |
308 char *name; | |
309 GtkTreeIter iter; | |
310 char tempfilename[BUF_LONG]; | |
311 int fd; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
312 |
8596 | 313 name = g_build_filename(gaim_user_dir(), "dict", NULL); |
4348 | 314 strcpy(tempfilename, name); |
315 strcat(tempfilename,".XXXXXX"); | |
316 fd = g_mkstemp(tempfilename); | |
317 if(fd<0) { | |
318 perror(tempfilename); | |
319 g_free(name); | |
320 return; | |
321 } | |
322 if (!(f = fdopen(fd, "w"))) { | |
323 perror("fdopen"); | |
324 close(fd); | |
325 g_free(name); | |
326 return; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
327 } |
4348 | 328 |
329 fchmod(fd, S_IRUSR | S_IWUSR); | |
4373
dcc6c130c6d9
[gaim-migrate @ 4639]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
4363
diff
changeset
|
330 |
4348 | 331 if(gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) { |
332 do { | |
333 GValue val0, val1; | |
334 memset(&val0, 0, sizeof(val0)); | |
335 memset(&val1, 0, sizeof(val1)); | |
336 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 0, &val0); | |
337 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 1, &val1); | |
338 fprintf(f, "BAD %s\nGOOD %s\n\n", g_value_get_string(&val0), g_value_get_string(&val1)); | |
339 g_value_unset(&val0); | |
340 g_value_unset(&val1); | |
341 } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter)); | |
342 } | |
343 if(fclose(f)) { | |
5227
6d1707dc8c3d
[gaim-migrate @ 5597]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
344 gaim_debug(GAIM_DEBUG_ERROR, "spellchk", |
6d1707dc8c3d
[gaim-migrate @ 5597]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
345 "Error writing to %s: %m\n", tempfilename); |
10589
0f7452b1f777
[gaim-migrate @ 11994]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10532
diff
changeset
|
346 g_unlink(tempfilename); |
4348 | 347 g_free(name); |
348 return; | |
349 } | |
10589
0f7452b1f777
[gaim-migrate @ 11994]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10532
diff
changeset
|
350 g_rename(tempfilename, name); |
4348 | 351 g_free(name); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
352 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
353 |
4348 | 354 static void |
355 check_if_something_is_selected(GtkTreeModel *model, | |
356 GtkTreePath *path, GtkTreeIter *iter, gpointer data) | |
357 { | |
358 *((gboolean*)data) = TRUE; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
359 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
360 |
4348 | 361 static void on_selection_changed(GtkTreeSelection *sel, |
362 gpointer data) | |
363 { | |
364 gboolean is = FALSE; | |
365 gtk_tree_selection_selected_foreach(sel, check_if_something_is_selected, &is); | |
366 gtk_widget_set_sensitive((GtkWidget*)data, is); | |
367 } | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
368 |
4348 | 369 static gboolean non_empty(const char *s) |
370 { | |
6250
1c8caacac1de
[gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
6116
diff
changeset
|
371 while(*s && g_ascii_isspace(*s)) |
4348 | 372 s++; |
373 return *s; | |
374 } | |
375 | |
376 static void on_entry_changed(GtkEditable *editable, gpointer data) | |
377 { | |
378 gtk_widget_set_sensitive((GtkWidget*)data, | |
379 non_empty(gtk_entry_get_text(GTK_ENTRY(bad_entry))) && | |
380 non_empty(gtk_entry_get_text(GTK_ENTRY(good_entry)))); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
381 } |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
382 |
3630 | 383 /* |
384 * EXPORTED FUNCTIONS | |
385 */ | |
386 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
387 static gboolean |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
388 plugin_load(GaimPlugin *plugin) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
389 { |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
390 void *conv_handle = gaim_conversations_get_handle(); |
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
391 |
3630 | 392 load_conf(); |
393 | |
8579 | 394 gaim_signal_connect(conv_handle, "writing-im-msg", |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
395 plugin, GAIM_CALLBACK(substitute_words), NULL); |
8579 | 396 gaim_signal_connect(conv_handle, "writing-chat-msg", |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
397 plugin, GAIM_CALLBACK(substitute_words), NULL); |
3630 | 398 |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
399 return TRUE; |
3630 | 400 } |
401 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
402 static GtkWidget * |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
403 get_config_frame(GaimPlugin *plugin) |
4348 | 404 { |
3565 | 405 GtkWidget *ret, *vbox, *win; |
4348 | 406 GtkWidget *hbox, *label; |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
407 GtkWidget *button; |
4348 | 408 GtkSizeGroup *sg; |
409 GtkCellRenderer *renderer; | |
410 GtkTreeViewColumn *column; | |
411 | |
412 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | |
3565 | 413 |
414 ret = gtk_vbox_new(FALSE, 18); | |
415 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
416 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5227
diff
changeset
|
417 vbox = gaim_gtk_make_frame(ret, _("Text Replacements")); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
418 gtk_container_set_border_width(GTK_CONTAINER(vbox), 4); |
4348 | 419 gtk_widget_set_size_request(vbox, 300, -1); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
420 gtk_widget_show (vbox); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
421 |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
422 win = gtk_scrolled_window_new(0, 0); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
423 gtk_container_add(GTK_CONTAINER(vbox), win); |
4750
03ea71acade3
[gaim-migrate @ 5065]
Christian Hammond <chipx86@chipx86.com>
parents:
4601
diff
changeset
|
424 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(win), |
03ea71acade3
[gaim-migrate @ 5065]
Christian Hammond <chipx86@chipx86.com>
parents:
4601
diff
changeset
|
425 GTK_SHADOW_IN); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
426 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (win), |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
427 GTK_POLICY_AUTOMATIC, |
4348 | 428 GTK_POLICY_AUTOMATIC); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
429 gtk_widget_show(win); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
430 |
4348 | 431 tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model)); |
432 /* gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(tree), TRUE); */ | |
433 gtk_widget_set_size_request(tree, 260,200); | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
434 |
4348 | 435 renderer = gtk_cell_renderer_text_new (); |
436 g_object_set (G_OBJECT (renderer), | |
437 "editable", TRUE, | |
438 NULL); | |
439 g_signal_connect(G_OBJECT(renderer), "edited", | |
440 G_CALLBACK(on_edited), GINT_TO_POINTER(0)); | |
441 column = gtk_tree_view_column_new_with_attributes (_("You type"), | |
442 renderer, "text", BAD_COLUMN, NULL); | |
443 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); | |
444 gtk_tree_view_column_set_fixed_width(column, 130); | |
445 /* gtk_tree_view_column_set_resizable(column, TRUE); */ | |
446 gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); | |
447 renderer = gtk_cell_renderer_text_new (); | |
448 g_object_set (G_OBJECT (renderer), | |
449 "editable", TRUE, | |
450 NULL); | |
451 g_signal_connect(G_OBJECT(renderer), "edited", | |
452 G_CALLBACK(on_edited), GINT_TO_POINTER(1)); | |
453 column = gtk_tree_view_column_new_with_attributes (_("You send"), | |
454 renderer, "text", GOOD_COLUMN, NULL); | |
455 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); | |
456 gtk_tree_view_column_set_fixed_width(column, 130); | |
457 /* gtk_tree_view_column_set_resizable(column, TRUE); */ | |
458 gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column); | |
459 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)), | |
460 GTK_SELECTION_MULTIPLE); | |
461 gtk_container_add(GTK_CONTAINER(win), tree); | |
462 gtk_widget_show(tree); | |
463 | |
464 hbox = gtk_hbutton_box_new(); | |
465 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
|
466 gtk_widget_show(hbox); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
467 |
4348 | 468 button = gtk_button_new_from_stock(GTK_STOCK_DELETE); |
469 g_signal_connect(G_OBJECT(button), "clicked", | |
470 G_CALLBACK(list_delete), NULL); | |
471 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
472 gtk_widget_set_sensitive(button, FALSE); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
473 |
4348 | 474 g_signal_connect(G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree))), |
475 "changed", G_CALLBACK(on_selection_changed), button); | |
476 | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
477 gtk_widget_show(button); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
478 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5227
diff
changeset
|
479 vbox = gaim_gtk_make_frame(ret, _("Add a new text replacement")); |
4348 | 480 gtk_widget_set_size_request(vbox, 300, -1); |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
481 |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
482 hbox = gtk_hbox_new(FALSE, 2); |
4348 | 483 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
484 gtk_widget_show(hbox); | |
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
485 |
4348 | 486 label = gtk_label_new_with_mnemonic(_("You _type:")); |
487 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
488 | |
489 bad_entry = gtk_entry_new(); | |
490 gtk_entry_set_max_length(GTK_ENTRY(bad_entry), 40); | |
491 gtk_box_pack_start(GTK_BOX(hbox), bad_entry, TRUE, TRUE, 0); | |
492 gtk_size_group_add_widget(sg, bad_entry); | |
493 gtk_label_set_mnemonic_widget(GTK_LABEL(label), bad_entry); | |
494 gtk_widget_show(bad_entry); | |
495 | |
496 hbox = gtk_hbox_new(FALSE, 2); | |
497 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
|
498 gtk_widget_show(hbox); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
499 |
4348 | 500 label = gtk_label_new_with_mnemonic(_("You _send:")); |
501 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
|
502 |
4348 | 503 good_entry = gtk_entry_new(); |
504 gtk_entry_set_max_length(GTK_ENTRY(good_entry), 255); | |
505 gtk_box_pack_start(GTK_BOX(hbox), good_entry, TRUE, TRUE, 0); | |
506 gtk_size_group_add_widget(sg, good_entry); | |
507 gtk_label_set_mnemonic_widget(GTK_LABEL(label), good_entry); | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
508 gtk_widget_show(good_entry); |
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
509 |
4348 | 510 hbox = gtk_hbutton_box_new(); |
511 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
512 button = gtk_button_new_from_stock(GTK_STOCK_ADD); | |
513 g_signal_connect(G_OBJECT(button), "clicked", | |
514 G_CALLBACK(list_add_new), NULL); | |
515 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
516 g_signal_connect(G_OBJECT(bad_entry), "changed", G_CALLBACK(on_entry_changed), button); | |
517 g_signal_connect(G_OBJECT(good_entry), "changed", G_CALLBACK(on_entry_changed), button); | |
518 gtk_widget_set_sensitive(button, FALSE); | |
519 gtk_widget_show(button); | |
520 | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
521 |
3565 | 522 gtk_widget_show_all(ret); |
523 return ret; | |
111
d927bb34e2c6
[gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
106
diff
changeset
|
524 } |
5205
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 GaimGtkPluginUiInfo ui_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 get_config_frame |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
529 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
530 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
531 static GaimPluginInfo info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
532 { |
9943 | 533 GAIM_PLUGIN_MAGIC, |
534 GAIM_MAJOR_VERSION, | |
535 GAIM_MINOR_VERSION, | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
536 GAIM_PLUGIN_STANDARD, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
537 GAIM_GTK_PLUGIN_TYPE, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
538 0, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
539 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
540 GAIM_PRIORITY_DEFAULT, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
541 SPELLCHECK_PLUGIN_ID, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
542 N_("Text replacement"), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
543 VERSION, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
544 N_("Replaces text in outgoing messages according to user-defined rules."), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
545 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
|
546 "Eric Warmenhoven <eric@warmenhoven.org>", |
6371
8f94cce8faa5
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6250
diff
changeset
|
547 GAIM_WEBSITE, |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
548 plugin_load, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
549 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
550 NULL, |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
551 &ui_info, |
8993 | 552 NULL, |
553 NULL, | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
554 NULL |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
555 }; |
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 static void |
5920
7d385de2f9cd
[gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents:
5873
diff
changeset
|
558 init_plugin(GaimPlugin *plugin) |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
559 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
560 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
4750
diff
changeset
|
561 |
6063 | 562 GAIM_INIT_PLUGIN(spellcheck, init_plugin, info) |