annotate plugins/spellchk.c @ 10418:bed2c96bc1fb

[gaim-migrate @ 11669] I split the status-saving code into it's own little API, because it really is separate from the other status.c savedstatuses.c sits on top of the rest of the status API. And you can delete saved statuses now. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 26 Dec 2004 00:46:26 +0000
parents d672afd04dcd
children 8f2b74c5aa24
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
4a15962c344a [gaim-migrate @ 10659]
Mark Doliner <mark@kingant.net>
parents: 8993
diff changeset
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
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9791
diff changeset
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
b0913ab92893 [gaim-migrate @ 7267]
Mark Doliner <mark@kingant.net>
parents: 6485
diff changeset
16 #include <stdio.h>
b0913ab92893 [gaim-migrate @ 7267]
Mark Doliner <mark@kingant.net>
parents: 6485
diff changeset
17 #include <string.h>
6849
3c885e6784ee [gaim-migrate @ 7394]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6780
diff changeset
18 #ifndef _WIN32
6735
b0913ab92893 [gaim-migrate @ 7267]
Mark Doliner <mark@kingant.net>
parents: 6485
diff changeset
19 #include <strings.h>
6849
3c885e6784ee [gaim-migrate @ 7394]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6780
diff changeset
20 #endif
6735
b0913ab92893 [gaim-migrate @ 7267]
Mark Doliner <mark@kingant.net>
parents: 6485
diff changeset
21 #include <sys/types.h>
b0913ab92893 [gaim-migrate @ 7267]
Mark Doliner <mark@kingant.net>
parents: 6485
diff changeset
22 #include <sys/stat.h>
b0913ab92893 [gaim-migrate @ 7267]
Mark Doliner <mark@kingant.net>
parents: 6485
diff changeset
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
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
26 enum {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
27 BAD_COLUMN,
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
28 GOOD_COLUMN,
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
29 N_COLUMNS
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 };
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
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
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
35 static void substitute(char **, int, int, const char *);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
36 static GtkListStore *model;
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 int i, l;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43 int word;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44 char *tmp;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 if (message == NULL || *message == NULL)
6780
e9a730ad5a3c [gaim-migrate @ 7319]
Christian Hammond <chipx86@chipx86.com>
parents: 6735
diff changeset
47 return FALSE;
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49 l = num_words(*message);
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50 for (i = 0; i < l; i++) {
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
51 GtkTreeIter iter;
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52 word = get_word(*message, i);
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
53 if(gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
54 do {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
55 GValue val0, val1;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
56 const char *bad, *good;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
57 memset(&val0, 0, sizeof(val0));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
58 memset(&val1, 0, sizeof(val1));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
59 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 0, &val0);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
60 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 1, &val1);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
61 tmp = have_word(*message, word);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
62 bad = g_value_get_string(&val0);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
63 good = g_value_get_string(&val1);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
64 if (!strcmp(tmp, bad)) {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
65 substitute(message, word, strlen(bad),
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
66 good);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
67 l += num_words(good) - num_words(bad);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
68 i += num_words(good) - num_words(bad);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
69 }
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
70 free(tmp);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
71 g_value_unset(&val0);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
72 g_value_unset(&val1);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
73 } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter));
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 }
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78 }
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
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
fa0324675ed9 [gaim-migrate @ 8079]
Mark Doliner <mark@kingant.net>
parents: 6849
diff changeset
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
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
105 int pnt = 0;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
106 gsize size;
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
107
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
108 model = gtk_list_store_new((gint)N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109
7466
fa0324675ed9 [gaim-migrate @ 8079]
Mark Doliner <mark@kingant.net>
parents: 6849
diff changeset
110 buf = g_build_filename(gaim_user_dir(), "dict", NULL);
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
111 g_file_get_contents(buf, &ibuf, &size, NULL);
7606
08c9d0dcf906 [gaim-migrate @ 8229]
Luke Schierer <lschiere@pidgin.im>
parents: 7466
diff changeset
112 g_free(buf);
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
113 if(!ibuf) {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
114 ibuf = g_strdup(defaultconf);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
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
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
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
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
128 GtkTreeIter iter;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
129 gtk_list_store_append(model, &iter);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
130 gtk_list_store_set(model, &iter,
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
131 0, g_strdup(name),
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
132 1, g_strdup(cmd),
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
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
08c9d0dcf906 [gaim-migrate @ 8229]
Luke Schierer <lschiere@pidgin.im>
parents: 7466
diff changeset
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
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
141
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
142
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
143 static int num_words(const char *m) {
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
144 int count = 0;
7631
ea2d07ad05a9 [gaim-migrate @ 8255]
Nathan Walp <nwalp@pidgin.im>
parents: 7606
diff changeset
145 guint pos;
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
146 int state = 0;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
147
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
148 for (pos = 0; pos < strlen(m); pos++) {
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
149 switch (state) {
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
152 count++;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
153 state = 1;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
154 } else if (m[pos] == '<')
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
155 state = 2;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
156 break;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
161 state = 0;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
162 break;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
163 case 2: /* inside HTML tag */
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
164 if (m[pos] == '>')
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
165 state = 0;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
166 break;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
167 }
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
168 }
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
169 return count;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
170 }
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
173 int count = 0;
7631
ea2d07ad05a9 [gaim-migrate @ 8255]
Nathan Walp <nwalp@pidgin.im>
parents: 7606
diff changeset
174 guint pos = 0;
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
175 int state = 0;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
176
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
177 for (pos = 0; pos < strlen(m) && count <= word; pos++) {
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
178 switch (state) {
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
181 count++;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
182 state = 1;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
183 } else if (m[pos] == '<')
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
184 state = 2;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
185 break;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
190 state = 0;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
191 break;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
192 case 2:
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
193 if (m[pos] == '>')
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
194 state = 0;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
195 break;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
196 }
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
197 }
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
198 return pos - 1;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
199 }
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
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
871bdebc3037 [gaim-migrate @ 3871]
Sean Egan <seanegan@gmail.com>
parents: 3728
diff changeset
202 char *tmp = strpbrk(&m[pos], "' \t\f\r\n\"><.?!-,/");
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
203 int len = (int)(tmp - &m[pos]);
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
204
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
205 if (tmp == NULL) {
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
206 tmp = strdup(&m[pos]);
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
207 return tmp;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
208 }
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
209
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
210 tmp = malloc(len + 1);
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
211 tmp[0] = 0;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
212 strncat(tmp, &m[pos], len);
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
213
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
214 return tmp;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
215 }
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
216
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
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
5891a1a6fc7e [gaim-migrate @ 9425]
Luke Schierer <lschiere@pidgin.im>
parents: 8672
diff changeset
219 char *tmp;
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
220 new[0] = 0;
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
221
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
222 strncat(new, *mes, pos);
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
223 strcat(new, text);
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
224
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
225 strcat(new, &(*mes)[pos + m]);
8673
5891a1a6fc7e [gaim-migrate @ 9425]
Luke Schierer <lschiere@pidgin.im>
parents: 8672
diff changeset
226 tmp = *mes;
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
227 *mes = new;
8673
5891a1a6fc7e [gaim-migrate @ 9425]
Luke Schierer <lschiere@pidgin.im>
parents: 8672
diff changeset
228 g_free(tmp);
103
c5a1a1b05c26 [gaim-migrate @ 113]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
229 }
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
230
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
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
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
235 static void save_list();
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
236
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
237 static void on_edited(GtkCellRendererText *cellrenderertext,
6116
de49cfd8fd59 [gaim-migrate @ 6579]
Mark Doliner <mark@kingant.net>
parents: 6063
diff changeset
238 gchar *path, gchar *arg2, gpointer data)
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
239 {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
240 GtkTreeIter iter;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
241 GValue val;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
242 if(arg2[0] == '\0') {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
243 gdk_beep();
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
244 return;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
245 }
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
246 memset(&val, 0, sizeof(val));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
247 g_return_if_fail(gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(model), &iter, path));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
248 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, GPOINTER_TO_INT(data), &val);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
249 if(strcmp(arg2, g_value_get_string(&val))) {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
250 gtk_list_store_set(model, &iter, GPOINTER_TO_INT(data), arg2, -1);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
251 save_list();
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
252 }
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
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
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
256 static void list_add_new()
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
257 {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
258 GtkTreeIter iter;
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
259
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
260 gtk_list_store_append(model, &iter);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
261 gtk_list_store_set(model, &iter,
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
262 0, gtk_entry_get_text(GTK_ENTRY(bad_entry)),
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
263 1, gtk_entry_get_text(GTK_ENTRY(good_entry)),
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
264 -1);
10234
d672afd04dcd [gaim-migrate @ 11369]
Mark Doliner <mark@kingant.net>
parents: 9943
diff changeset
265 gtk_editable_delete_text(GTK_EDITABLE(bad_entry), 0, -1);
d672afd04dcd [gaim-migrate @ 11369]
Mark Doliner <mark@kingant.net>
parents: 9943
diff changeset
266 gtk_editable_delete_text(GTK_EDITABLE(good_entry), 0, -1);
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
267 gtk_widget_grab_focus(bad_entry);
4601
203741ac86b3 [gaim-migrate @ 4888]
Luke Schierer <lschiere@pidgin.im>
parents: 4585
diff changeset
268
203741ac86b3 [gaim-migrate @ 4888]
Luke Schierer <lschiere@pidgin.im>
parents: 4585
diff changeset
269 save_list();
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
270 }
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
271
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
272 static void add_selected_row_to_list(GtkTreeModel *model, GtkTreePath *path,
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
273 GtkTreeIter *iter, gpointer data)
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
274 {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
275 GSList **list = (GSList **)data;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
276 *list = g_slist_append(*list, gtk_tree_path_copy(path) );
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
277 }
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6392
diff changeset
278
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
279
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
280 static void remove_row(void *data1, gpointer data2)
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
281 {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
282 GtkTreePath *path = (GtkTreePath*)data1;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
283 GtkTreeIter iter;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
284 gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
285 gtk_list_store_remove(model, &iter);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
286 gtk_tree_path_free(path);
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
287 }
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
288
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
289 static void list_delete()
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
290 {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
291 GtkTreeSelection *sel;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
292 GSList *list = NULL;
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
293
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
294 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
295 gtk_tree_selection_selected_foreach(sel, add_selected_row_to_list, &list);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
296
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
297 g_slist_foreach(list, remove_row, NULL);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
298 g_slist_free(list);
4601
203741ac86b3 [gaim-migrate @ 4888]
Luke Schierer <lschiere@pidgin.im>
parents: 4585
diff changeset
299
203741ac86b3 [gaim-migrate @ 4888]
Luke Schierer <lschiere@pidgin.im>
parents: 4585
diff changeset
300 save_list();
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
301 }
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
302
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
303 static void save_list()
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
304 {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
305 FILE *f;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
306 char *name;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
307 GtkTreeIter iter;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
308 char tempfilename[BUF_LONG];
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
309 int fd;
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
310
8596
56360561af5e [gaim-migrate @ 9347]
Luke Schierer <lschiere@pidgin.im>
parents: 8579
diff changeset
311 name = g_build_filename(gaim_user_dir(), "dict", NULL);
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
312 strcpy(tempfilename, name);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
313 strcat(tempfilename,".XXXXXX");
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
314 fd = g_mkstemp(tempfilename);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
315 if(fd<0) {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
316 perror(tempfilename);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
317 g_free(name);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
318 return;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
319 }
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
320 if (!(f = fdopen(fd, "w"))) {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
321 perror("fdopen");
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
322 close(fd);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
323 g_free(name);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
324 return;
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
325 }
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
326
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
327 fchmod(fd, S_IRUSR | S_IWUSR);
4373
dcc6c130c6d9 [gaim-migrate @ 4639]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4363
diff changeset
328
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
329 if(gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
330 do {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
331 GValue val0, val1;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
332 memset(&val0, 0, sizeof(val0));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
333 memset(&val1, 0, sizeof(val1));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
334 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 0, &val0);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
335 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, 1, &val1);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
336 fprintf(f, "BAD %s\nGOOD %s\n\n", g_value_get_string(&val0), g_value_get_string(&val1));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
337 g_value_unset(&val0);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
338 g_value_unset(&val1);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
339 } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
340 }
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
341 if(fclose(f)) {
5227
6d1707dc8c3d [gaim-migrate @ 5597]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
342 gaim_debug(GAIM_DEBUG_ERROR, "spellchk",
6d1707dc8c3d [gaim-migrate @ 5597]
Christian Hammond <chipx86@chipx86.com>
parents: 5205
diff changeset
343 "Error writing to %s: %m\n", tempfilename);
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
344 unlink(tempfilename);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
345 g_free(name);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
346 return;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
347 }
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6392
diff changeset
348 rename(tempfilename, name);
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
349 g_free(name);
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
350 }
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
351
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
352 static void
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
353 check_if_something_is_selected(GtkTreeModel *model,
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
354 GtkTreePath *path, GtkTreeIter *iter, gpointer data)
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
355 {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
356 *((gboolean*)data) = TRUE;
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
357 }
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
358
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
359 static void on_selection_changed(GtkTreeSelection *sel,
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
360 gpointer data)
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
361 {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
362 gboolean is = FALSE;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
363 gtk_tree_selection_selected_foreach(sel, check_if_something_is_selected, &is);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
364 gtk_widget_set_sensitive((GtkWidget*)data, is);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
365 }
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
366
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
367 static gboolean non_empty(const char *s)
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
368 {
6250
1c8caacac1de [gaim-migrate @ 6746]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 6116
diff changeset
369 while(*s && g_ascii_isspace(*s))
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
370 s++;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
371 return *s;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
372 }
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
373
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
374 static void on_entry_changed(GtkEditable *editable, gpointer data)
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
375 {
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
376 gtk_widget_set_sensitive((GtkWidget*)data,
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
377 non_empty(gtk_entry_get_text(GTK_ENTRY(bad_entry))) &&
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
378 non_empty(gtk_entry_get_text(GTK_ENTRY(good_entry))));
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
379 }
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
380
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
381 /*
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
382 * EXPORTED FUNCTIONS
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
383 */
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
384
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
385 static gboolean
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
386 plugin_load(GaimPlugin *plugin)
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
387 {
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6392
diff changeset
388 void *conv_handle = gaim_conversations_get_handle();
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6392
diff changeset
389
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
390 load_conf();
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
391
8579
8720427121f5 [gaim-migrate @ 9329]
Mark Doliner <mark@kingant.net>
parents: 7631
diff changeset
392 gaim_signal_connect(conv_handle, "writing-im-msg",
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6392
diff changeset
393 plugin, GAIM_CALLBACK(substitute_words), NULL);
8579
8720427121f5 [gaim-migrate @ 9329]
Mark Doliner <mark@kingant.net>
parents: 7631
diff changeset
394 gaim_signal_connect(conv_handle, "writing-chat-msg",
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6392
diff changeset
395 plugin, GAIM_CALLBACK(substitute_words), NULL);
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
396
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
397 return TRUE;
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
398 }
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents: 3565
diff changeset
399
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
400 static GtkWidget *
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
401 get_config_frame(GaimPlugin *plugin)
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
402 {
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
403 GtkWidget *ret, *vbox, *win;
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
404 GtkWidget *hbox, *label;
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
405 GtkWidget *button;
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
406 GtkSizeGroup *sg;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
407 GtkCellRenderer *renderer;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
408 GtkTreeViewColumn *column;
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
409
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
410 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
411
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
412 ret = gtk_vbox_new(FALSE, 18);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
413 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6392
diff changeset
414
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5227
diff changeset
415 vbox = gaim_gtk_make_frame(ret, _("Text Replacements"));
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
416 gtk_container_set_border_width(GTK_CONTAINER(vbox), 4);
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
417 gtk_widget_set_size_request(vbox, 300, -1);
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
418 gtk_widget_show (vbox);
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
419
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
420 win = gtk_scrolled_window_new(0, 0);
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
421 gtk_container_add(GTK_CONTAINER(vbox), win);
4750
03ea71acade3 [gaim-migrate @ 5065]
Christian Hammond <chipx86@chipx86.com>
parents: 4601
diff changeset
422 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(win),
03ea71acade3 [gaim-migrate @ 5065]
Christian Hammond <chipx86@chipx86.com>
parents: 4601
diff changeset
423 GTK_SHADOW_IN);
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
424 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (win),
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
425 GTK_POLICY_AUTOMATIC,
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
426 GTK_POLICY_AUTOMATIC);
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
427 gtk_widget_show(win);
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
428
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
429 tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
430 /* gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(tree), TRUE); */
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
431 gtk_widget_set_size_request(tree, 260,200);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6392
diff changeset
432
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
433 renderer = gtk_cell_renderer_text_new ();
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
434 g_object_set (G_OBJECT (renderer),
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
435 "editable", TRUE,
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
436 NULL);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
437 g_signal_connect(G_OBJECT(renderer), "edited",
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
438 G_CALLBACK(on_edited), GINT_TO_POINTER(0));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
439 column = gtk_tree_view_column_new_with_attributes (_("You type"),
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
440 renderer, "text", BAD_COLUMN, NULL);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
441 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
442 gtk_tree_view_column_set_fixed_width(column, 130);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
443 /* gtk_tree_view_column_set_resizable(column, TRUE); */
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
444 gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
445 renderer = gtk_cell_renderer_text_new ();
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
446 g_object_set (G_OBJECT (renderer),
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
447 "editable", TRUE,
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
448 NULL);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
449 g_signal_connect(G_OBJECT(renderer), "edited",
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
450 G_CALLBACK(on_edited), GINT_TO_POINTER(1));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
451 column = gtk_tree_view_column_new_with_attributes (_("You send"),
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
452 renderer, "text", GOOD_COLUMN, NULL);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
453 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
454 gtk_tree_view_column_set_fixed_width(column, 130);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
455 /* gtk_tree_view_column_set_resizable(column, TRUE); */
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
456 gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
457 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)),
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
458 GTK_SELECTION_MULTIPLE);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
459 gtk_container_add(GTK_CONTAINER(win), tree);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
460 gtk_widget_show(tree);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
461
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
462 hbox = gtk_hbutton_box_new();
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
463 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
464 gtk_widget_show(hbox);
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
465
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
466 button = gtk_button_new_from_stock(GTK_STOCK_DELETE);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
467 g_signal_connect(G_OBJECT(button), "clicked",
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
468 G_CALLBACK(list_delete), NULL);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
469 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
470 gtk_widget_set_sensitive(button, FALSE);
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
471
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
472 g_signal_connect(G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree))),
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
473 "changed", G_CALLBACK(on_selection_changed), button);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
474
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
475 gtk_widget_show(button);
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
476
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5227
diff changeset
477 vbox = gaim_gtk_make_frame(ret, _("Add a new text replacement"));
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
478 gtk_widget_set_size_request(vbox, 300, -1);
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
479
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
480 hbox = gtk_hbox_new(FALSE, 2);
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
481 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
482 gtk_widget_show(hbox);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6392
diff changeset
483
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
484 label = gtk_label_new_with_mnemonic(_("You _type:"));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
485 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
486
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
487 bad_entry = gtk_entry_new();
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
488 gtk_entry_set_max_length(GTK_ENTRY(bad_entry), 40);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
489 gtk_box_pack_start(GTK_BOX(hbox), bad_entry, TRUE, TRUE, 0);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
490 gtk_size_group_add_widget(sg, bad_entry);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
491 gtk_label_set_mnemonic_widget(GTK_LABEL(label), bad_entry);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
492 gtk_widget_show(bad_entry);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
493
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
494 hbox = gtk_hbox_new(FALSE, 2);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
495 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
496 gtk_widget_show(hbox);
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
497
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
498 label = gtk_label_new_with_mnemonic(_("You _send:"));
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
499 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
500
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
501 good_entry = gtk_entry_new();
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
502 gtk_entry_set_max_length(GTK_ENTRY(good_entry), 255);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
503 gtk_box_pack_start(GTK_BOX(hbox), good_entry, TRUE, TRUE, 0);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
504 gtk_size_group_add_widget(sg, good_entry);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
505 gtk_label_set_mnemonic_widget(GTK_LABEL(label), good_entry);
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
506 gtk_widget_show(good_entry);
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
507
4348
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
508 hbox = gtk_hbutton_box_new();
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
509 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
510 button = gtk_button_new_from_stock(GTK_STOCK_ADD);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
511 g_signal_connect(G_OBJECT(button), "clicked",
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
512 G_CALLBACK(list_add_new), NULL);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
513 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
514 g_signal_connect(G_OBJECT(bad_entry), "changed", G_CALLBACK(on_entry_changed), button);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
515 g_signal_connect(G_OBJECT(good_entry), "changed", G_CALLBACK(on_entry_changed), button);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
516 gtk_widget_set_sensitive(button, FALSE);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
517 gtk_widget_show(button);
922b66840a51 [gaim-migrate @ 4613]
Luke Schierer <lschiere@pidgin.im>
parents: 4202
diff changeset
518
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
519
3565
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
520 gtk_widget_show_all(ret);
154c4a9d9b6d [gaim-migrate @ 3660]
Sean Egan <seanegan@gmail.com>
parents: 3551
diff changeset
521 return ret;
111
d927bb34e2c6 [gaim-migrate @ 121]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 106
diff changeset
522 }
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
523
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
524 static GaimGtkPluginUiInfo ui_info =
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 get_config_frame
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
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
529 static GaimPluginInfo info =
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
530 {
9943
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9791
diff changeset
531 GAIM_PLUGIN_MAGIC,
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9791
diff changeset
532 GAIM_MAJOR_VERSION,
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9791
diff changeset
533 GAIM_MINOR_VERSION,
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
534 GAIM_PLUGIN_STANDARD,
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
535 GAIM_GTK_PLUGIN_TYPE,
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
536 0,
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
537 NULL,
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
538 GAIM_PRIORITY_DEFAULT,
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
539 SPELLCHECK_PLUGIN_ID,
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
540 N_("Text replacement"),
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
541 VERSION,
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."),
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
543 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
544 "Eric Warmenhoven <eric@warmenhoven.org>",
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6250
diff changeset
545 GAIM_WEBSITE,
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
546 plugin_load,
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 NULL,
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
549 &ui_info,
8993
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
550 NULL,
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
551 NULL,
5205
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
552 NULL
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
553 };
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
554
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
555 static void
5920
7d385de2f9cd [gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents: 5873
diff changeset
556 init_plugin(GaimPlugin *plugin)
5205
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 }
fefad67de2c7 [gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents: 4750
diff changeset
559
6063
5239a3b4ab33 [gaim-migrate @ 6513]
Nathan Walp <nwalp@pidgin.im>
parents: 5920
diff changeset
560 GAIM_INIT_PLUGIN(spellcheck, init_plugin, info)