2011-10-07 [colin] 3.7.10cvs21
[claws.git] / src / prefs_logging.c
index bc87501f27ec7124944d48c2dfbb81ee0b2e7194..e22d659a93a89ac275c0844c4845aceeeb67501c 100644 (file)
@@ -1,11 +1,11 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 Tristan Chabredier <wwp@claws-mail.org> and 
+ * Copyright (C) 1999-2011 Tristan Chabredier <wwp@claws-mail.org> and 
  * the Claws Mail 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
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -14,8 +14,8 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
  */
 
 #ifdef HAVE_CONFIG_H
@@ -41,6 +41,7 @@
 #include "manage_window.h"
 
 #include "log.h"
+#include "combobox.h"
 
 typedef struct _LoggingPage
 {
@@ -50,6 +51,11 @@ typedef struct _LoggingPage
 
        GtkWidget *checkbtn_clip_network_log;
        GtkWidget *spinbtn_network_log_length;
+       GtkWidget *checkbtn_log_standard;
+       GtkWidget *checkbtn_log_warning;
+       GtkWidget *checkbtn_log_error;
+       GtkWidget *checkbtn_log_status;
+#ifndef G_OS_WIN32
        GtkWidget *checkbtn_clip_filtering_log;
        GtkWidget *spinbtn_filtering_log_length;
        GtkWidget *checkbtn_filtering_log;
@@ -59,8 +65,26 @@ typedef struct _LoggingPage
        GtkWidget *checkbtn_filtering_log_pre_proc;
        GtkWidget *checkbtn_filtering_log_post_proc;
        GtkWidget *optmenu_filtering_log_level;
+#endif
 } LoggingPage;
 
+static GtkWidget *prefs_logging_create_check_buttons(GtkWidget **checkbtn1,
+                       gchar *label1, GtkWidget **checkbtn2, gchar *label2)
+{
+       GtkWidget *hbox_checkbtn;
+
+       hbox_checkbtn = gtk_hbox_new(FALSE, VBOX_BORDER);
+       gtk_widget_show(hbox_checkbtn);
+       
+       PACK_CHECK_BUTTON (hbox_checkbtn, *checkbtn1, label1); 
+       gtk_label_set_line_wrap(GTK_LABEL(gtk_bin_get_child(GTK_BIN((*checkbtn1)))), TRUE);
+
+       PACK_CHECK_BUTTON (hbox_checkbtn, *checkbtn2, label2);
+       gtk_label_set_line_wrap(GTK_LABEL(gtk_bin_get_child(GTK_BIN((*checkbtn2)))), TRUE);
+       
+       return hbox_checkbtn;
+}
+
 static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window, 
                                  gpointer data)
 {
@@ -73,37 +97,41 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *hbox_clip_network_log;
        GtkWidget *checkbtn_clip_network_log;
        GtkWidget *spinbtn_network_log_length;
-       GtkObject *spinbtn_network_log_length_adj;
-       GtkTooltips *network_log_length_tooltip;
-       GtkWidget *label;
+       GtkAdjustment *spinbtn_network_log_length_adj;
+       GtkWidget *hbox_checkbtn;
+#ifndef G_OS_WIN32
        GtkWidget *vbox1_filtering_log;
        GtkWidget *hbox_clip_filtering_log;
        GtkWidget *checkbtn_clip_filtering_log;
        GtkWidget *spinbtn_filtering_log_length;
-       GtkObject *spinbtn_filtering_log_length_adj;
-       GtkTooltips *filtering_log_length_tooltip;
+       GtkAdjustment *spinbtn_filtering_log_length_adj;
        GtkWidget *hbox_filtering_log;
        GtkWidget *checkbtn_filtering_log;
        GtkWidget *frame_filtering_log;
        GtkWidget *vbox2_filtering_log;
-       GtkWidget *hbox_filtering_log_inc;
        GtkWidget *checkbtn_filtering_log_inc;
-       GtkWidget *hbox_filtering_log_manual;
        GtkWidget *checkbtn_filtering_log_manual;
-       GtkWidget *hbox_filtering_log_folder_proc;
        GtkWidget *checkbtn_filtering_log_folder_proc;
-       GtkWidget *hbox_filtering_log_pre_proc;
        GtkWidget *checkbtn_filtering_log_pre_proc;
-       GtkWidget *hbox_filtering_log_post_proc;
        GtkWidget *checkbtn_filtering_log_post_proc;
-       GtkTooltips *filtering_log_tooltip;
        GtkWidget *hbox_filtering_log_level;
        GtkWidget *label_filtering_log_level;
        GtkWidget *optmenu_filtering_log_level;
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-       GtkTooltips *filtering_log_level_tooltip;
-
+       GtkSizeGroup *filter_size_group;
+       GtkListStore *menu;
+       GtkTreeIter iter;
+#endif
+       GtkWidget *frame_disk_log;
+       GtkWidget *vbox_disk_log;
+       GtkWidget *label;
+       GtkWidget *hbox;
+       GtkWidget *checkbtn_log_standard;
+       GtkWidget *checkbtn_log_warning;
+       GtkWidget *checkbtn_log_error;
+       GtkWidget *checkbtn_log_status;
+       GtkSizeGroup *log_size_group;
+       CLAWS_TIP_DECL();
+       
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
@@ -118,9 +146,7 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
        PACK_CHECK_BUTTON (hbox_clip_network_log, checkbtn_clip_network_log,
                           _("Restrict the log window to"));
        
-       network_log_length_tooltip = gtk_tooltips_new();
-
-       spinbtn_network_log_length_adj = gtk_adjustment_new (500, 0, G_MAXINT, 1, 10, 10);
+       spinbtn_network_log_length_adj = gtk_adjustment_new (500, 0, G_MAXINT, 1, 10, 0);
        spinbtn_network_log_length = gtk_spin_button_new
                (GTK_ADJUSTMENT (spinbtn_network_log_length_adj), 1, 0);
        gtk_widget_show (spinbtn_network_log_length);
@@ -129,9 +155,8 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_widget_set_size_request (GTK_WIDGET (spinbtn_network_log_length), 64, -1);
        gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_network_log_length), TRUE);
 
-       gtk_tooltips_set_tip(GTK_TOOLTIPS(network_log_length_tooltip), spinbtn_network_log_length,
-                            _("0 to stop logging in the log window"),
-                            NULL);
+       CLAWS_SET_TIP(spinbtn_network_log_length,
+                            _("0 to stop logging in the log window"));
 
        label = gtk_label_new(_("lines"));
        gtk_widget_show (label);
@@ -140,6 +165,7 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
        SET_TOGGLE_SENSITIVITY(checkbtn_clip_network_log, spinbtn_network_log_length);
        SET_TOGGLE_SENSITIVITY(checkbtn_clip_network_log, label);
 
+#ifndef G_OS_WIN32
        /* Filtering/processing debug log */
        vbox1_filtering_log = gtkut_get_options_frame(vbox1,
                                &frame_logging, _("Filtering/processing log"));
@@ -150,48 +176,42 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_container_add (GTK_CONTAINER (vbox1_filtering_log), hbox_filtering_log);
        gtk_widget_show (hbox_filtering_log);
 
-       filtering_log_tooltip = gtk_tooltips_new();
-       gtk_tooltips_set_tip(GTK_TOOLTIPS(filtering_log_tooltip),
-                            checkbtn_filtering_log,
+       CLAWS_SET_TIP(checkbtn_filtering_log,
                             _("If checked, turns on logging of filtering and processing rules.\n"
                                "The log is accessible from 'Tools/Filtering log'.\n"
                                "Caution: enabling this option will slow down the filtering/processing, "
                                "this might be critical when applying many rules upon thousands of "
-                               "messages."),
-                               NULL);
+                               "messages."));
 
        vbox2_filtering_log = gtkut_get_options_frame(vbox1_filtering_log, &frame_filtering_log,
                                                        _("Log filtering/processing when..."));
 
-       PACK_CHECK_BUTTON (vbox2_filtering_log, checkbtn_filtering_log_inc,
-                          _("filtering at incorporation"));
-       hbox_filtering_log_inc = gtk_hbox_new (FALSE, 8);
-       gtk_container_add (GTK_CONTAINER (vbox2_filtering_log), hbox_filtering_log_inc);
-       gtk_widget_show (hbox_filtering_log_inc);
-
-       PACK_CHECK_BUTTON (vbox2_filtering_log, checkbtn_filtering_log_manual,
-                          _("manually filtering"));
-       hbox_filtering_log_manual = gtk_hbox_new (FALSE, 8);
-       gtk_container_add (GTK_CONTAINER (vbox2_filtering_log), hbox_filtering_log_manual);
-       gtk_widget_show (hbox_filtering_log_manual);
-
-       PACK_CHECK_BUTTON (vbox2_filtering_log, checkbtn_filtering_log_folder_proc,
+       hbox_checkbtn = prefs_logging_create_check_buttons(
+                                               &checkbtn_filtering_log_inc,
+                                               _("filtering at incorporation"),
+                                               &checkbtn_filtering_log_pre_proc,
+                                               _("pre-processing folders"));
+       gtk_box_pack_start(GTK_BOX(vbox2_filtering_log), hbox_checkbtn, FALSE, FALSE, 0);
+
+       hbox_checkbtn = prefs_logging_create_check_buttons(
+                                               &checkbtn_filtering_log_manual,
+                                               _("manually filtering"),
+                                               &checkbtn_filtering_log_post_proc,
+                                               _("post-processing folders"));
+       gtk_box_pack_start(GTK_BOX(vbox2_filtering_log), hbox_checkbtn, FALSE, FALSE, 0);
+       
+       hbox_checkbtn = gtk_hbox_new(TRUE, VBOX_BORDER);
+       gtk_widget_show(hbox_checkbtn);
+       gtk_box_pack_start(GTK_BOX(vbox2_filtering_log), hbox_checkbtn, FALSE, FALSE, 0);
+       PACK_CHECK_BUTTON (hbox_checkbtn, checkbtn_filtering_log_folder_proc,
                           _("processing folders"));
-       hbox_filtering_log_folder_proc = gtk_hbox_new (FALSE, 8);
-       gtk_container_add (GTK_CONTAINER (vbox2_filtering_log), hbox_filtering_log_folder_proc);
-       gtk_widget_show (hbox_filtering_log_folder_proc);
-
-       PACK_CHECK_BUTTON (vbox2_filtering_log, checkbtn_filtering_log_pre_proc,
-                          _("pre-processing folders"));
-       hbox_filtering_log_pre_proc = gtk_hbox_new (FALSE, 8);
-       gtk_container_add (GTK_CONTAINER (vbox2_filtering_log), hbox_filtering_log_pre_proc);
-       gtk_widget_show (hbox_filtering_log_pre_proc);
-
-       PACK_CHECK_BUTTON (vbox2_filtering_log, checkbtn_filtering_log_post_proc,
-                          _("post-processing folders"));
-       hbox_filtering_log_post_proc = gtk_hbox_new (FALSE, 8);
-       gtk_container_add (GTK_CONTAINER (vbox2_filtering_log), hbox_filtering_log_post_proc);
-       gtk_widget_show (hbox_filtering_log_post_proc);
+       gtk_box_pack_start(GTK_BOX(hbox_checkbtn), gtk_label_new(""),
+                          FALSE, TRUE, 0);
+
+       filter_size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+       gtk_size_group_add_widget(filter_size_group, checkbtn_filtering_log_inc);
+       gtk_size_group_add_widget(filter_size_group, checkbtn_filtering_log_manual);
+       gtk_size_group_add_widget(filter_size_group, checkbtn_filtering_log_folder_proc);
 
        SET_TOGGLE_SENSITIVITY(checkbtn_filtering_log, frame_filtering_log);
 
@@ -203,20 +223,18 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_widget_show (label_filtering_log_level);
        gtk_box_pack_start(GTK_BOX(hbox_filtering_log_level), label_filtering_log_level, FALSE, FALSE, 0);
 
-       optmenu_filtering_log_level = gtk_option_menu_new ();
+       optmenu_filtering_log_level = gtkut_sc_combobox_create(NULL, FALSE);
        gtk_widget_show (optmenu_filtering_log_level);
        
-       menu = gtk_menu_new ();
-       MENUITEM_ADD (menu, menuitem, _("Low"), 0);
-       MENUITEM_ADD (menu, menuitem, _("Medium"), 1);
-       MENUITEM_ADD (menu, menuitem, _("High"), 2);
+       menu = GTK_LIST_STORE(gtk_combo_box_get_model(
+                               GTK_COMBO_BOX(optmenu_filtering_log_level)));
+       COMBOBOX_ADD (menu, _("Low"), 0);
+       COMBOBOX_ADD (menu, _("Medium"), 1);
+       COMBOBOX_ADD (menu, _("High"), 2);
 
-       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_filtering_log_level), menu);
        gtk_box_pack_start(GTK_BOX(hbox_filtering_log_level), optmenu_filtering_log_level, FALSE, FALSE, 0);
 
-       filtering_log_level_tooltip = gtk_tooltips_new();
-       gtk_tooltips_set_tip(GTK_TOOLTIPS(filtering_log_level_tooltip),
-                            optmenu_filtering_log_level,
+       CLAWS_SET_TIP(optmenu_filtering_log_level,
                             _("Select the level of detail of the logging.\n"
                                "Choose Low to see when rules are applied, which "
                                "conditions match or don't match and what actions are "
@@ -227,8 +245,7 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
                                "rules are processed or skipped, and why all conditions "
                                "are matched or not matched.\n"
                                "Caution: the higher the level, the greater the "
-                               "impact on performance."),
-                            NULL);
+                               "impact on performance."));
 
        hbox_clip_filtering_log = gtk_hbox_new (FALSE, 8);
        gtk_container_add (GTK_CONTAINER (vbox1_filtering_log), hbox_clip_filtering_log);
@@ -236,9 +253,7 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
        PACK_CHECK_BUTTON (hbox_clip_filtering_log, checkbtn_clip_filtering_log,
                           _("Restrict the log window to"));
        
-       filtering_log_length_tooltip = gtk_tooltips_new();
-
-       spinbtn_filtering_log_length_adj = gtk_adjustment_new (500, 0, G_MAXINT, 1, 10, 10);
+       spinbtn_filtering_log_length_adj = gtk_adjustment_new (500, 0, G_MAXINT, 1, 10, 0);
        spinbtn_filtering_log_length = gtk_spin_button_new
                (GTK_ADJUSTMENT (spinbtn_filtering_log_length_adj), 1, 0);
        gtk_widget_show (spinbtn_filtering_log_length);
@@ -247,9 +262,8 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_widget_set_size_request (GTK_WIDGET (spinbtn_filtering_log_length), 64, -1);
        gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_filtering_log_length), TRUE);
 
-       gtk_tooltips_set_tip(GTK_TOOLTIPS(filtering_log_length_tooltip), spinbtn_filtering_log_length,
-                            _("0 to stop logging in the log window"),
-                            NULL);
+       CLAWS_SET_TIP(spinbtn_filtering_log_length,
+                            _("0 to stop logging in the log window"));
 
        label = gtk_label_new(_("lines"));
        gtk_widget_show (label);
@@ -261,11 +275,46 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
        SET_TOGGLE_SENSITIVITY(checkbtn_filtering_log, optmenu_filtering_log_level);
        SET_TOGGLE_SENSITIVITY(checkbtn_filtering_log, checkbtn_clip_filtering_log);
        SET_TOGGLE_SENSITIVITY(checkbtn_filtering_log, label_filtering_log_level);
+#endif
+       /* disk log */
+       vbox_disk_log = gtkut_get_options_frame(vbox1, &frame_disk_log, _("Disk log"));
+
+       label = gtk_label_new(_("Write the following information to disk..."));
+       gtk_widget_show(label);
+       hbox = gtk_hbox_new (FALSE, 8);
+       gtk_container_add (GTK_CONTAINER (vbox_disk_log), hbox);
+       gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+       gtk_widget_show (hbox);
+
+       hbox_checkbtn = prefs_logging_create_check_buttons(&checkbtn_log_warning,
+                               _("Warning messages"), &checkbtn_log_standard,
+                               _("Network protocol messages"));
+       gtk_box_pack_start(GTK_BOX(vbox_disk_log), hbox_checkbtn, FALSE, FALSE, 0);
+
+       hbox_checkbtn = prefs_logging_create_check_buttons(&checkbtn_log_error, 
+                               _("Error messages"), &checkbtn_log_status,
+                               _("Status messages for filtering/processing log"));
+       gtk_box_pack_start(GTK_BOX(vbox_disk_log), hbox_checkbtn, FALSE, FALSE, 0);
+       
+       log_size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+       gtk_size_group_add_widget(log_size_group, checkbtn_log_warning);
+       gtk_size_group_add_widget(log_size_group, checkbtn_log_error);
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_clip_network_log), 
                prefs_common.cliplog);
+#ifndef G_OS_WIN32
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_clip_filtering_log), 
                prefs_common.filtering_debug_cliplog);
+#endif
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_log_standard), 
+               prefs_common.enable_log_standard);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_log_warning), 
+               prefs_common.enable_log_warning);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_log_error), 
+               prefs_common.enable_log_error);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_log_status), 
+               prefs_common.enable_log_status);
+#ifndef G_OS_WIN32
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_filtering_log), 
                prefs_common.enable_filtering_debug);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_filtering_log_inc), 
@@ -278,17 +327,23 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
                prefs_common.enable_filtering_debug_pre_proc);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_filtering_log_post_proc), 
                prefs_common.enable_filtering_debug_post_proc);
-
+#endif
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_network_log_length),
                prefs_common.loglength);
+#ifndef G_OS_WIN32
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_filtering_log_length),
                prefs_common.filtering_debug_loglength);
-
-       gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu_filtering_log_level),
+       combobox_select_by_data(GTK_COMBO_BOX(optmenu_filtering_log_level),
                        prefs_common.filtering_debug_level);
+#endif
 
        prefs_logging->checkbtn_clip_network_log = checkbtn_clip_network_log;
        prefs_logging->spinbtn_network_log_length = spinbtn_network_log_length;
+       prefs_logging->checkbtn_log_standard = checkbtn_log_standard;
+       prefs_logging->checkbtn_log_warning = checkbtn_log_warning;
+       prefs_logging->checkbtn_log_error = checkbtn_log_error;
+       prefs_logging->checkbtn_log_status = checkbtn_log_status;
+#ifndef G_OS_WIN32
        prefs_logging->checkbtn_clip_filtering_log = checkbtn_clip_filtering_log;
        prefs_logging->spinbtn_filtering_log_length = spinbtn_filtering_log_length;
        prefs_logging->checkbtn_filtering_log = checkbtn_filtering_log;
@@ -298,7 +353,7 @@ static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window,
        prefs_logging->checkbtn_filtering_log_pre_proc = checkbtn_filtering_log_pre_proc;
        prefs_logging->checkbtn_filtering_log_post_proc = checkbtn_filtering_log_post_proc;
        prefs_logging->optmenu_filtering_log_level = optmenu_filtering_log_level;
-
+#endif
        prefs_logging->page.widget = vbox1;
 }
 
@@ -306,19 +361,25 @@ static void prefs_logging_save(PrefsPage *_page)
 {
        LoggingPage *page = (LoggingPage *) _page;
        MainWindow *mainwindow;
+#ifndef G_OS_WIN32
        gboolean filtering_debug_enabled;
-       GtkWidget *menu;
-       GtkWidget *menuitem;
-
-       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_filtering_log_level));
-       menuitem = gtk_menu_get_active(GTK_MENU(menu));
-       prefs_common.filtering_debug_level = GPOINTER_TO_INT
-                       (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
+       prefs_common.filtering_debug_level =
+               combobox_get_active_data(GTK_COMBO_BOX(page->optmenu_filtering_log_level));
+#endif
 
        prefs_common.cliplog = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_clip_network_log));
        prefs_common.loglength = gtk_spin_button_get_value_as_int(
                GTK_SPIN_BUTTON(page->spinbtn_network_log_length));
+       prefs_common.enable_log_standard = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_log_standard));
+       prefs_common.enable_log_warning = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_log_warning));
+       prefs_common.enable_log_error = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_log_error));
+       prefs_common.enable_log_status = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_log_status));
+#ifndef G_OS_WIN32
        prefs_common.filtering_debug_cliplog = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_clip_filtering_log));
        prefs_common.filtering_debug_loglength = gtk_spin_button_get_value_as_int(
@@ -342,12 +403,14 @@ static void prefs_logging_save(PrefsPage *_page)
                GTK_TOGGLE_BUTTON(page->checkbtn_filtering_log_pre_proc));
        prefs_common.enable_filtering_debug_post_proc = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_filtering_log_post_proc));
-
+#endif
        mainwindow = mainwindow_get_mainwindow();
        log_window_set_clipping(mainwindow->logwin, prefs_common.cliplog,
                                prefs_common.loglength);
+#ifndef G_OS_WIN32
        log_window_set_clipping(mainwindow->filtering_debugwin, prefs_common.filtering_debug_cliplog,
                                prefs_common.filtering_debug_loglength);
+#endif
 }
 
 static void prefs_logging_destroy_widget(PrefsPage *_page)