Fix error creation and warning
[claws.git] / src / plugins / bogofilter / bogofilter_gtk.c
blobd6792f9bcdaf7a8a6dd94ba6985540f6cb0c3733
1 /*
2 * Claws Mail -- a GTK based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2012 Colin Leroy <colin@colino.net> and
4 * the Claws Mail team
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifdef HAVE_CONFIG_H
22 # include "config.h"
23 #include "claws-features.h"
24 #endif
26 #include "defs.h"
28 #include <glib.h>
29 #include <glib/gi18n.h>
30 #include <gtk/gtk.h>
31 #include "gtk/gtkutils.h"
33 #include "common/claws.h"
34 #include "common/version.h"
35 #include "plugin.h"
36 #include "common/utils.h"
37 #include "prefs.h"
38 #include "folder.h"
39 #include "prefs_gtk.h"
40 #include "foldersel.h"
41 #include "statusbar.h"
42 #include "bogofilter.h"
43 #include "menu.h"
44 #include "addressbook.h"
45 #include "combobox.h"
47 struct BogofilterPage
49 PrefsPage page;
51 GtkWidget *process_emails;
52 GtkWidget *receive_spam;
53 GtkWidget *save_folder;
54 GtkWidget *save_folder_select;
55 GtkWidget *save_unsure;
56 GtkWidget *save_unsure_folder;
57 GtkWidget *save_unsure_folder_select;
58 GtkWidget *insert_header;
59 GtkWidget *max_size;
60 GtkWidget *bogopath;
61 GtkWidget *whitelist_ab;
62 GtkWidget *whitelist_ab_folder_combo;
63 GtkWidget *learn_from_whitelist_chkbtn;
64 GtkWidget *mark_as_read;
67 static void foldersel_cb(GtkWidget *widget, gpointer data)
69 GtkWidget *entry = (GtkWidget *) data;
70 FolderItem *item;
71 gchar *item_id;
72 gint newpos = 0;
74 item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE, NULL);
75 if (item && (item_id = folder_item_get_identifier(item)) != NULL) {
76 gtk_editable_delete_text(GTK_EDITABLE(entry), 0, -1);
77 gtk_editable_insert_text(GTK_EDITABLE(entry), item_id, strlen(item_id), &newpos);
78 g_free(item_id);
82 static void spam_handle_combobox_callback(GtkWidget *widget, gpointer user_data)
84 GtkWidget *hbox = GTK_WIDGET(user_data);
86 if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) == 1) {
87 gtk_widget_set_sensitive(hbox, TRUE);
88 } else {
89 gtk_widget_set_sensitive(hbox, FALSE);
93 #ifndef USE_ALT_ADDRBOOK
94 static void bogofilter_whitelist_ab_select_cb(GtkWidget *widget, gpointer data)
96 struct BogofilterPage *page = (struct BogofilterPage *) data;
97 const gchar *folderpath = NULL;
98 gchar *new_path = NULL;
100 folderpath = gtk_entry_get_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((page->whitelist_ab_folder_combo)))));
101 new_path = addressbook_folder_selection(folderpath);
102 if (new_path) {
103 gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((page->whitelist_ab_folder_combo)))), new_path);
104 g_free(new_path);
107 #endif
109 static void bogofilter_create_widget_func(PrefsPage * _page,
110 GtkWindow * window,
111 gpointer data)
113 struct BogofilterPage *page = (struct BogofilterPage *) _page;
114 BogofilterConfig *config;
116 GtkWidget *vbox1, *vbox2;
117 GtkWidget *hbox_max_size;
118 GtkWidget *hbox_process_emails, *hbox_save_spam, *hbox_save_unsure;
119 GtkWidget *hbox_bogopath, *hbox_whitelist;
120 GtkWidget *hbox_mark_as_read;
122 GtkWidget *max_size_label;
123 GtkAdjustment *max_size_spinbtn_adj;
124 GtkWidget *max_size_spinbtn;
125 GtkWidget *max_size_kb_label;
127 GtkWidget *process_emails_checkbtn;
129 GtkWidget *spam_handle_combobox;
130 GtkWidget *save_spam_folder_entry;
131 GtkWidget *save_spam_folder_select;
133 GtkWidget *save_unsure_checkbtn;
134 GtkWidget *save_unsure_folder_entry;
135 GtkWidget *save_unsure_folder_select;
137 GtkWidget *insert_header_checkbtn;
138 GtkWidget *whitelist_ab_checkbtn;
139 GtkWidget *learn_from_whitelist_chkbtn;
140 GtkWidget *bogopath_label;
141 GtkWidget *bogopath_entry;
143 GtkWidget *mark_as_read_checkbtn;
145 GtkWidget *whitelist_ab_folder_combo;
146 GtkWidget *whitelist_ab_select_btn;
148 vbox1 = gtk_box_new(GTK_ORIENTATION_VERTICAL, VSPACING);
149 gtk_widget_show (vbox1);
150 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
152 vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
153 gtk_widget_show (vbox2);
154 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
156 hbox_process_emails = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
157 gtk_widget_show(hbox_process_emails);
158 gtk_box_pack_start (GTK_BOX (vbox2), hbox_process_emails, TRUE, TRUE, 0);
160 process_emails_checkbtn = gtk_check_button_new_with_label(
161 _("Process messages on receiving"));
162 gtk_widget_show(process_emails_checkbtn);
163 gtk_box_pack_start(GTK_BOX(hbox_process_emails), process_emails_checkbtn, TRUE, TRUE, 0);
165 hbox_max_size = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
166 gtk_widget_show(hbox_max_size);
167 gtk_box_pack_start (GTK_BOX (vbox2), hbox_max_size, TRUE, TRUE, 0);
169 max_size_label = gtk_label_new(_("Maximum size"));
170 gtk_widget_show(max_size_label);
171 gtk_box_pack_start(GTK_BOX(hbox_max_size), max_size_label, FALSE, FALSE, 0);
173 max_size_spinbtn_adj = GTK_ADJUSTMENT(gtk_adjustment_new(250, 0, 10000, 10, 10, 0));
174 max_size_spinbtn = gtk_spin_button_new(GTK_ADJUSTMENT(max_size_spinbtn_adj), 1, 0);
175 gtk_widget_show(max_size_spinbtn);
176 gtk_box_pack_start(GTK_BOX(hbox_max_size), max_size_spinbtn, FALSE, FALSE, 0);
177 CLAWS_SET_TIP(max_size_spinbtn,
178 _("Messages larger than this will not be checked"));
179 gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(max_size_spinbtn), TRUE);
181 max_size_kb_label = gtk_label_new(_("KiB"));
182 gtk_widget_show(max_size_kb_label);
183 gtk_box_pack_start(GTK_BOX(hbox_max_size), max_size_kb_label, FALSE, FALSE, 0);
185 hbox_save_spam = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
186 gtk_widget_show(hbox_save_spam);
187 gtk_box_pack_start (GTK_BOX (vbox2), hbox_save_spam, TRUE, TRUE, 0);
189 spam_handle_combobox = gtk_combo_box_text_new();
191 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(spam_handle_combobox),
192 _("Delete spam"));
194 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(spam_handle_combobox),
195 _("Save spam in..."));
197 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(spam_handle_combobox),
198 _("Only mark as spam"));
200 gtk_widget_show(spam_handle_combobox);
201 gtk_box_pack_start(GTK_BOX(hbox_save_spam), spam_handle_combobox, FALSE, FALSE, 0);
203 GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
204 gtk_widget_show(hbox);
205 gtk_box_pack_start (GTK_BOX (hbox_save_spam), hbox, TRUE, TRUE, 0);
207 save_spam_folder_entry = gtk_entry_new();
208 gtk_widget_show (save_spam_folder_entry);
209 gtk_box_pack_start (GTK_BOX (hbox), save_spam_folder_entry, TRUE, TRUE, 0);
210 CLAWS_SET_TIP(save_spam_folder_entry,
211 _("Folder for storing identified spam. Leave empty to use the trash folder."));
213 save_spam_folder_select = gtkut_get_browse_directory_btn(_("_Browse"));
214 gtk_widget_show (save_spam_folder_select);
215 gtk_box_pack_start (GTK_BOX (hbox), save_spam_folder_select, FALSE, FALSE, 0);
216 CLAWS_SET_TIP(save_spam_folder_select,
217 _("Click this button to select a folder for storing spam"));
219 g_signal_connect(G_OBJECT(spam_handle_combobox), "changed",
220 G_CALLBACK(spam_handle_combobox_callback), (gpointer)hbox);
222 hbox_save_unsure = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
223 gtk_widget_show(hbox_save_unsure);
224 gtk_box_pack_start (GTK_BOX (vbox2), hbox_save_unsure, TRUE, TRUE, 0);
226 save_unsure_checkbtn = gtk_check_button_new_with_label(_("When unsure, move to"));
227 gtk_widget_show(save_unsure_checkbtn);
228 gtk_box_pack_start(GTK_BOX(hbox_save_unsure), save_unsure_checkbtn, FALSE, FALSE, 0);
230 save_unsure_folder_entry = gtk_entry_new();
231 gtk_widget_show (save_unsure_folder_entry);
232 gtk_box_pack_start (GTK_BOX (hbox_save_unsure), save_unsure_folder_entry, TRUE, TRUE, 0);
233 CLAWS_SET_TIP(save_unsure_folder_entry,
234 _("Folder for storing mail for which spam status is Unsure. Leave empty to use the Inbox folder."));
236 save_unsure_folder_select = gtkut_get_browse_directory_btn(_("_Browse"));
237 gtk_widget_show (save_unsure_folder_select);
238 gtk_box_pack_start (GTK_BOX (hbox_save_unsure), save_unsure_folder_select, FALSE, FALSE, 0);
239 CLAWS_SET_TIP(save_unsure_folder_select,
240 _("Click this button to select a folder for storing Unsure mails."));
242 insert_header_checkbtn = gtk_check_button_new_with_label(_("Insert X-Bogosity header"));
243 gtk_widget_show(insert_header_checkbtn);
244 gtk_box_pack_start(GTK_BOX(vbox2), insert_header_checkbtn, FALSE, FALSE, 0);
245 CLAWS_SET_TIP(insert_header_checkbtn,
246 _("Only done for messages in MH folders"));
248 hbox_whitelist = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
249 gtk_widget_show(hbox_whitelist);
250 gtk_box_pack_start (GTK_BOX (vbox2), hbox_whitelist, TRUE, TRUE, 0);
252 whitelist_ab_checkbtn = gtk_check_button_new_with_label(_("Whitelist senders found in address book/folder"));
253 gtk_widget_show(whitelist_ab_checkbtn);
254 gtk_box_pack_start(GTK_BOX(hbox_whitelist), whitelist_ab_checkbtn, FALSE, FALSE, 0);
255 CLAWS_SET_TIP(whitelist_ab_checkbtn,
256 _("Messages coming from your address book contacts will be received in the normal folder even if detected as spam"));
258 whitelist_ab_folder_combo = combobox_text_new(TRUE, _("Any"), NULL);
259 gtk_widget_set_size_request(whitelist_ab_folder_combo, 100, -1);
260 gtk_box_pack_start (GTK_BOX (hbox_whitelist), whitelist_ab_folder_combo, TRUE, TRUE, 0);
262 whitelist_ab_select_btn = gtk_button_new_with_label(_("Select..."));
263 gtk_widget_show (whitelist_ab_select_btn);
264 gtk_box_pack_start (GTK_BOX (hbox_whitelist), whitelist_ab_select_btn, FALSE, FALSE, 0);
265 CLAWS_SET_TIP(whitelist_ab_select_btn,
266 _("Click this button to select a book or folder in the address book"));
268 learn_from_whitelist_chkbtn = gtk_check_button_new_with_label(_("Learn whitelisted emails as ham"));
269 CLAWS_SET_TIP(learn_from_whitelist_chkbtn,
270 _("If Bogofilter thought an email was spam or unsure, but it was whitelisted, "
271 "learn it as ham."));
272 gtk_widget_show(learn_from_whitelist_chkbtn);
273 gtk_box_pack_start (GTK_BOX (vbox2), learn_from_whitelist_chkbtn, TRUE, TRUE, 0);
275 hbox_bogopath = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
276 gtk_widget_show(hbox_bogopath);
277 gtk_box_pack_start (GTK_BOX (vbox2), hbox_bogopath, FALSE, FALSE, 0);
279 bogopath_label = gtk_label_new(_("Bogofilter call"));
280 gtk_widget_show(bogopath_label);
281 gtk_box_pack_start(GTK_BOX(hbox_bogopath), bogopath_label, FALSE, FALSE, 0);
283 bogopath_entry = gtk_entry_new();
284 gtk_widget_show(bogopath_entry);
285 gtk_box_pack_start(GTK_BOX(hbox_bogopath), bogopath_entry, FALSE, FALSE, 0);
286 CLAWS_SET_TIP(bogopath_entry,
287 _("Path to bogofilter executable"));
289 hbox_mark_as_read = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
290 gtk_widget_show(hbox_mark_as_read);
291 gtk_box_pack_start (GTK_BOX (vbox2), hbox_mark_as_read, TRUE, TRUE, 0);
293 mark_as_read_checkbtn = gtk_check_button_new_with_label(_("Mark spam as read"));
294 gtk_widget_show(mark_as_read_checkbtn);
295 gtk_box_pack_start(GTK_BOX(hbox_mark_as_read), mark_as_read_checkbtn, FALSE, FALSE, 0);
297 SET_TOGGLE_SENSITIVITY(save_unsure_checkbtn, save_unsure_folder_entry);
298 SET_TOGGLE_SENSITIVITY(save_unsure_checkbtn, save_unsure_folder_select);
299 SET_TOGGLE_SENSITIVITY(whitelist_ab_checkbtn, whitelist_ab_folder_combo);
300 #ifndef USE_ALT_ADDRBOOK
301 SET_TOGGLE_SENSITIVITY(whitelist_ab_checkbtn, whitelist_ab_select_btn);
302 #endif
303 SET_TOGGLE_SENSITIVITY(whitelist_ab_checkbtn, learn_from_whitelist_chkbtn);
305 config = bogofilter_get_config();
307 g_signal_connect(G_OBJECT(save_spam_folder_select), "clicked",
308 G_CALLBACK(foldersel_cb), save_spam_folder_entry);
309 g_signal_connect(G_OBJECT(save_unsure_folder_select), "clicked",
310 G_CALLBACK(foldersel_cb), save_unsure_folder_entry);
311 #ifndef USE_ALT_ADDRBOOK
312 g_signal_connect(G_OBJECT (whitelist_ab_select_btn), "clicked",
313 G_CALLBACK(bogofilter_whitelist_ab_select_cb), page);
314 #else
315 gtk_widget_set_sensitive(GTK_WIDGET(whitelist_ab_select_btn), FALSE);
316 #endif
317 gtk_spin_button_set_value(GTK_SPIN_BUTTON(max_size_spinbtn), (float) config->max_size);
318 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(process_emails_checkbtn), config->process_emails);
319 gtk_combo_box_set_active(GTK_COMBO_BOX(spam_handle_combobox), config->receive_spam);
320 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(save_unsure_checkbtn), config->save_unsure);
321 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(insert_header_checkbtn), config->insert_header);
322 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(whitelist_ab_checkbtn), config->whitelist_ab);
323 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(learn_from_whitelist_chkbtn), config->learn_from_whitelist);
324 if (config->whitelist_ab_folder != NULL) {
325 /* translate "Any" (stored UNtranslated) */
326 if (strcasecmp(config->whitelist_ab_folder, "Any") == 0)
327 gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((whitelist_ab_folder_combo)))),
328 config->whitelist_ab_folder);
329 else
330 /* backward compatibility (when translated "Any" was stored) */
331 if (g_utf8_collate(config->whitelist_ab_folder, _("Any")) == 0)
332 gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((whitelist_ab_folder_combo)))),
333 config->whitelist_ab_folder);
334 else
335 gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((whitelist_ab_folder_combo)))),
336 config->whitelist_ab_folder);
338 if (config->save_folder != NULL)
339 gtk_entry_set_text(GTK_ENTRY(save_spam_folder_entry), config->save_folder);
340 if (config->save_unsure_folder != NULL)
341 gtk_entry_set_text(GTK_ENTRY(save_unsure_folder_entry), config->save_unsure_folder);
342 if (config->bogopath != NULL)
343 gtk_entry_set_text(GTK_ENTRY(bogopath_entry), config->bogopath);
344 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mark_as_read_checkbtn), config->mark_as_read);
346 page->max_size = max_size_spinbtn;
347 page->process_emails = process_emails_checkbtn;
349 page->receive_spam = spam_handle_combobox;
350 page->save_folder = save_spam_folder_entry;
351 page->save_folder_select = save_spam_folder_select;
353 page->save_unsure = save_unsure_checkbtn;
354 page->save_unsure_folder = save_unsure_folder_entry;
355 page->save_unsure_folder_select = save_unsure_folder_select;
357 page->insert_header = insert_header_checkbtn;
358 page->whitelist_ab = whitelist_ab_checkbtn;
359 page->whitelist_ab_folder_combo = whitelist_ab_folder_combo;
360 page->learn_from_whitelist_chkbtn = learn_from_whitelist_chkbtn;
361 page->bogopath = bogopath_entry;
363 page->mark_as_read = mark_as_read_checkbtn;
365 page->page.widget = vbox1;
368 static void bogofilter_destroy_widget_func(PrefsPage *_page)
370 debug_print("Destroying Bogofilter widget\n");
373 static void bogofilter_save_func(PrefsPage *_page)
375 struct BogofilterPage *page = (struct BogofilterPage *) _page;
376 BogofilterConfig *config;
378 debug_print("Saving Bogofilter Page\n");
380 config = bogofilter_get_config();
382 /* process_emails */
383 config->process_emails = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->process_emails));
385 /* receive_spam */
386 config->receive_spam = gtk_combo_box_get_active(GTK_COMBO_BOX(page->receive_spam));
388 /* save_folder */
389 g_free(config->save_folder);
390 config->save_folder = gtk_editable_get_chars(GTK_EDITABLE(page->save_folder), 0, -1);
392 /* save_unsure */
393 config->save_unsure = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->save_unsure));
395 /* save_unsure_folder */
396 g_free(config->save_unsure_folder);
397 config->save_unsure_folder = gtk_editable_get_chars(GTK_EDITABLE(page->save_unsure_folder), 0, -1);
399 /* insert_header */
400 config->insert_header = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->insert_header));
402 /* whitelist_ab */
403 config->whitelist_ab = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->whitelist_ab));
404 g_free(config->whitelist_ab_folder);
405 config->whitelist_ab_folder = gtk_editable_get_chars(
406 GTK_EDITABLE(gtk_bin_get_child(GTK_BIN((page->whitelist_ab_folder_combo)))), 0, -1);
407 /* store UNtranslated "Any" */
408 if (g_utf8_collate(config->whitelist_ab_folder, _("Any")) == 0) {
409 g_free(config->whitelist_ab_folder);
410 config->whitelist_ab_folder = g_strdup("Any");
413 /* learn_from_whitelist_chkbtn */
414 config->learn_from_whitelist = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->learn_from_whitelist_chkbtn));
416 /* bogopath */
417 g_free(config->bogopath);
418 config->bogopath = gtk_editable_get_chars(GTK_EDITABLE(page->bogopath), 0, -1);
420 /* max_size */
421 config->max_size = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(page->max_size));
423 /* mark_as_read */
424 config->mark_as_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->mark_as_read));
426 if (config->process_emails) {
427 bogofilter_register_hook();
428 } else {
429 bogofilter_unregister_hook();
432 procmsg_register_spam_learner(bogofilter_learn);
433 procmsg_spam_set_folder(config->save_folder, bogofilter_get_spam_folder);
435 bogofilter_save_config();
438 typedef struct _BogoCbData {
439 gchar *message;
440 gint total;
441 gint done;
442 } BogoCbData;
444 static gboolean gtk_message_callback(gpointer data)
446 BogoCbData *cbdata = (BogoCbData *)data;
448 if (cbdata->message)
449 statusbar_print_all("%s", cbdata->message);
450 else if (cbdata->total == 0) {
451 statusbar_pop_all();
453 if (cbdata->total && cbdata->done)
454 statusbar_progress_all(cbdata->done, cbdata->total, 10);
455 else
456 statusbar_progress_all(0,0,0);
457 g_free(cbdata->message);
458 g_free(cbdata);
459 GTK_EVENTS_FLUSH();
460 return FALSE;
463 static void gtk_safe_message_callback(gchar *message, gint total, gint done, gboolean thread_safe)
465 BogoCbData *cbdata = g_new0(BogoCbData, 1);
466 if (message)
467 cbdata->message = g_strdup(message);
468 cbdata->total = total;
469 cbdata->done = done;
470 if (thread_safe)
471 g_timeout_add(0, gtk_message_callback, cbdata);
472 else
473 gtk_message_callback(cbdata);
476 static struct BogofilterPage bogofilter_page;
478 gint bogofilter_gtk_init(void)
480 static gchar *path[3];
482 path[0] = _("Plugins");
483 path[1] = _("Bogofilter");
484 path[2] = NULL;
486 bogofilter_page.page.path = path;
487 bogofilter_page.page.create_widget = bogofilter_create_widget_func;
488 bogofilter_page.page.destroy_widget = bogofilter_destroy_widget_func;
489 bogofilter_page.page.save_page = bogofilter_save_func;
490 bogofilter_page.page.weight = 35.0;
492 prefs_gtk_register_page((PrefsPage *) &bogofilter_page);
493 bogofilter_set_message_callback(gtk_safe_message_callback);
495 debug_print("Bogofilter GTK plugin loaded\n");
496 return 0;
499 void bogofilter_gtk_done(void)
501 prefs_gtk_unregister_page((PrefsPage *) &bogofilter_page);