0.8.9claws13
[claws.git] / src / plugins / spamassassin / spamassassin_gtk.c
index 5df85440bc3d2271cfb73950d29d219c7d48c696..0218243a0df5b3d9bb7e2cb3f577d9d042980eed 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2002 Hiroyuki Yamamoto and the Sylpheed-Claws Team
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto and the Sylpheed-Claws Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -62,7 +62,7 @@ static void foldersel_cb(GtkWidget *widget, gpointer data)
        }
 }
 
        }
 }
 
-static void spamassassin_create_widget_func(PrefsPage * _page, gpointer data)
+static void spamassassin_create_widget_func(PrefsPage * _page, GtkWindow *window, gpointer data)
 {
        struct SpamAssassinPage *page = (struct SpamAssassinPage *) _page;
 
 {
        struct SpamAssassinPage *page = (struct SpamAssassinPage *) _page;
 
@@ -138,7 +138,7 @@ static void spamassassin_create_widget_func(PrefsPage * _page, gpointer data)
        gtk_widget_show(hostname);
        gtk_box_pack_start(GTK_BOX(hbox1), hostname, TRUE, TRUE, 0);
 
        gtk_widget_show(hostname);
        gtk_box_pack_start(GTK_BOX(hbox1), hostname, TRUE, TRUE, 0);
 
-       label5 = gtk_label_new(_(":"));
+       label5 = gtk_label_new(":");
        gtk_widget_show(label5);
        gtk_box_pack_start(GTK_BOX(hbox1), label5, FALSE, FALSE, 0);
        gtk_misc_set_padding(GTK_MISC(label5), 8, 0);
        gtk_widget_show(label5);
        gtk_box_pack_start(GTK_BOX(hbox1), label5, FALSE, FALSE, 0);
        gtk_misc_set_padding(GTK_MISC(label5), 8, 0);
@@ -185,7 +185,7 @@ static void spamassassin_create_widget_func(PrefsPage * _page, gpointer data)
                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
 
                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
 
-       button4 = gtk_button_new_with_label(_("..."));
+       button4 = gtk_button_new_with_label("...");
        gtk_widget_show(button4);
        gtk_table_attach(GTK_TABLE(table1), button4, 2, 3, 4, 5,
                         (GtkAttachOptions) (GTK_SHRINK | GTK_FILL),
        gtk_widget_show(button4);
        gtk_table_attach(GTK_TABLE(table1), button4, 2, 3, 4, 5,
                         (GtkAttachOptions) (GTK_SHRINK | GTK_FILL),
@@ -203,11 +203,13 @@ static void spamassassin_create_widget_func(PrefsPage * _page, gpointer data)
        gtk_signal_connect(GTK_OBJECT(button4), "released", GTK_SIGNAL_FUNC(foldersel_cb), page);
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enable), spamassassin_enable);
        gtk_signal_connect(GTK_OBJECT(button4), "released", GTK_SIGNAL_FUNC(foldersel_cb), page);
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enable), spamassassin_enable);
-       gtk_entry_set_text(GTK_ENTRY(hostname), spamassassin_hostname);
+       if (spamassassin_hostname != NULL)
+               gtk_entry_set_text(GTK_ENTRY(hostname), spamassassin_hostname);
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(port), (float) spamassassin_port);
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(max_size), (float) spamassassin_max_size);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(receive_spam), spamassassin_receive_spam);
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(port), (float) spamassassin_port);
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(max_size), (float) spamassassin_max_size);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(receive_spam), spamassassin_receive_spam);
-       gtk_entry_set_text(GTK_ENTRY(save_folder), spamassassin_save_folder);
+       if (spamassassin_save_folder != NULL)
+               gtk_entry_set_text(GTK_ENTRY(save_folder), spamassassin_save_folder);
        
        page->enable = enable;
        page->hostname = hostname;
        
        page->enable = enable;
        page->hostname = hostname;
@@ -247,12 +249,6 @@ static void spamassassin_save_func(PrefsPage *_page)
        spamassassin_save_config();
 }
 
        spamassassin_save_config();
 }
 
-static void spamassassin_destroy_func(PrefsPage *_page)
-{
-       debug_print("Destroying SpamAssassin Page\n");
-       g_free(_page);
-}
-
 static struct SpamAssassinPage *spamassassin_page;
 
 gint plugin_init(gchar **error)
 static struct SpamAssassinPage *spamassassin_page;
 
 gint plugin_init(gchar **error)
@@ -264,7 +260,6 @@ gint plugin_init(gchar **error)
        page->page.create_widget = spamassassin_create_widget_func;
        page->page.destroy_widget = spamassassin_destroy_widget_func;
        page->page.save_page = spamassassin_save_func;
        page->page.create_widget = spamassassin_create_widget_func;
        page->page.destroy_widget = spamassassin_destroy_widget_func;
        page->page.save_page = spamassassin_save_func;
-       page->page.destroy_page = spamassassin_destroy_func;
        prefs_gtk_register_page((PrefsPage *) page);
 
        spamassassin_page = page;
        prefs_gtk_register_page((PrefsPage *) page);
 
        spamassassin_page = page;
@@ -291,13 +286,13 @@ const gchar *plugin_desc()
        return "This plugin provides a Preferences page for the SpamAssassin "
               "plugin.\n"
               "\n"
        return "This plugin provides a Preferences page for the SpamAssassin "
               "plugin.\n"
               "\n"
-              "You will find the options in the Preferences window under "
-              "Filtering/SpamAssassin.\n"
+              "You will find the options in the Other Preferences window "
+              "under Filtering/SpamAssassin.\n"
               "\n"
               "With this plugin you can enable the filtering, change the "
               "\n"
               "With this plugin you can enable the filtering, change the "
-              "SpamAssassin server's host  and port, the maximum size that "
-              "a message is allowed to have (if the message is larger it "
-              "will not be checked), set the option if spam mails "
-              "should be received at all (default) and select the folder "
-              "where spam mails will be saved.\n";
+              "SpamAssassin server host and port, set the maximum size of "
+              "messages to be checked, (if the message is larger it will "
+              "not be checked), configure whether spam mail should be received "
+              "(default: Yes) and select the folder where spam mail will be "
+              "saved.\n";
 }
 }