2008-05-12 [wwp] 3.4.0cvs30
[claws.git] / src / plugins / bogofilter / bogofilter_gtk.c
index dd1d962..4198bff 100644 (file)
@@ -299,9 +299,20 @@ static void bogofilter_create_widget_func(PrefsPage * _page,
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(insert_header_checkbtn), config->insert_header);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(whitelist_ab_checkbtn), config->whitelist_ab);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(learn_from_whitelist_chkbtn), config->learn_from_whitelist);
-       if (config->whitelist_ab_folder != NULL)
-               gtk_entry_set_text(GTK_ENTRY(GTK_BIN(whitelist_ab_folder_combo)->child),
-                               config->whitelist_ab_folder);
+       if (config->whitelist_ab_folder != NULL) {
+               /* translate "Any" (stored UNtranslated) */
+               if (strcasecmp(config->whitelist_ab_folder, "Any") == 0)
+                       gtk_entry_set_text(GTK_ENTRY(GTK_BIN(whitelist_ab_folder_combo)->child),
+                                       config->whitelist_ab_folder);
+               else
+               /* backward compatibility (when translated "Any" was stored) */
+               if (g_utf8_collate(config->whitelist_ab_folder, _("Any")) == 0)
+                       gtk_entry_set_text(GTK_ENTRY(GTK_BIN(whitelist_ab_folder_combo)->child),
+                                       config->whitelist_ab_folder);
+               else
+                       gtk_entry_set_text(GTK_ENTRY(GTK_BIN(whitelist_ab_folder_combo)->child),
+                                       config->whitelist_ab_folder);
+       }
        if (config->save_folder != NULL)
                gtk_entry_set_text(GTK_ENTRY(save_spam_folder_entry), config->save_folder);
        if (config->save_unsure_folder != NULL)
@@ -371,6 +382,11 @@ static void bogofilter_save_func(PrefsPage *_page)
        g_free(config->whitelist_ab_folder);
        config->whitelist_ab_folder = gtk_editable_get_chars(
                                GTK_EDITABLE(GTK_BIN(page->whitelist_ab_folder_combo)->child), 0, -1);
+       /* store UNtranslated "Any" */
+       if (g_utf8_collate(config->whitelist_ab_folder, _("Any")) == 0) {
+               g_free(config->whitelist_ab_folder);
+               config->whitelist_ab_folder = g_strdup("Any");
+       }
 
        /* learn_from_whitelist_chkbtn */
        config->learn_from_whitelist = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->learn_from_whitelist_chkbtn));