f37fe1933d9a38b5f5521fb7ae109c951c7a4eb8
[claws.git] / src / prefs_logging.c
1 /*
2  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2007 Tristan Chabredier <wwp@claws-mail.org> and 
4  * the Claws Mail team
5  *
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.
10  *
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.
15  *
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/>.
18  * 
19  */
20
21 #ifdef HAVE_CONFIG_H
22 #  include "config.h"
23 #endif
24
25 #include "defs.h"
26
27 #include <stdio.h>
28 #include <stdlib.h>
29
30 #include <glib.h>
31 #include <glib/gi18n.h>
32 #include <gtk/gtk.h>
33
34 #include "prefs_common.h"
35 #include "prefs_gtk.h"
36
37 #include "gtk/gtkutils.h"
38 #include "gtk/prefswindow.h"
39 #include "gtk/menu.h"
40
41 #include "manage_window.h"
42
43 #include "log.h"
44 #include "combobox.h"
45
46 typedef struct _LoggingPage
47 {
48         PrefsPage page;
49
50         GtkWidget *window;
51
52         GtkWidget *checkbtn_clip_network_log;
53         GtkWidget *spinbtn_network_log_length;
54         GtkWidget *checkbtn_log_standard;
55         GtkWidget *checkbtn_log_warning;
56         GtkWidget *checkbtn_log_error;
57         GtkWidget *checkbtn_log_status;
58         GtkWidget *checkbtn_clip_filtering_log;
59         GtkWidget *spinbtn_filtering_log_length;
60         GtkWidget *checkbtn_filtering_log;
61         GtkWidget *checkbtn_filtering_log_inc;
62         GtkWidget *checkbtn_filtering_log_manual;
63         GtkWidget *checkbtn_filtering_log_folder_proc;
64         GtkWidget *checkbtn_filtering_log_pre_proc;
65         GtkWidget *checkbtn_filtering_log_post_proc;
66         GtkWidget *optmenu_filtering_log_level;
67 } LoggingPage;
68
69 static GtkWidget *prefs_logging_create_check_buttons(GtkWidget **checkbtn1,
70                         gchar *label1, GtkWidget **checkbtn2, gchar *label2)
71 {
72         GtkWidget *hbox_checkbtn;
73
74         hbox_checkbtn = gtk_hbox_new(FALSE, VBOX_BORDER);
75         gtk_widget_show(hbox_checkbtn);
76         
77         PACK_CHECK_BUTTON (hbox_checkbtn, *checkbtn1, label1); 
78         gtk_label_set_line_wrap(GTK_LABEL(GTK_BIN(*checkbtn1)->child), TRUE);
79
80         PACK_CHECK_BUTTON (hbox_checkbtn, *checkbtn2, label2);
81         gtk_label_set_line_wrap(GTK_LABEL(GTK_BIN(*checkbtn2)->child), TRUE);
82         
83         return hbox_checkbtn;
84 }
85
86 static void prefs_logging_create_widget(PrefsPage *_page, GtkWindow *window, 
87                                   gpointer data)
88 {
89         LoggingPage *prefs_logging = (LoggingPage *) _page;
90         
91         GtkWidget *vbox1;
92
93         GtkWidget *frame_logging;
94         GtkWidget *vbox_network_log;
95         GtkWidget *hbox_clip_network_log;
96         GtkWidget *checkbtn_clip_network_log;
97         GtkWidget *spinbtn_network_log_length;
98         GtkObject *spinbtn_network_log_length_adj;
99         GtkTooltips *network_log_length_tooltip;
100         GtkWidget *vbox1_filtering_log;
101         GtkWidget *hbox_clip_filtering_log;
102         GtkWidget *checkbtn_clip_filtering_log;
103         GtkWidget *spinbtn_filtering_log_length;
104         GtkObject *spinbtn_filtering_log_length_adj;
105         GtkTooltips *filtering_log_length_tooltip;
106         GtkWidget *hbox_filtering_log;
107         GtkWidget *checkbtn_filtering_log;
108         GtkWidget *frame_filtering_log;
109         GtkWidget *vbox2_filtering_log;
110         GtkWidget *hbox_checkbtn;
111         GtkWidget *checkbtn_filtering_log_inc;
112         GtkWidget *checkbtn_filtering_log_manual;
113         GtkWidget *checkbtn_filtering_log_folder_proc;
114         GtkWidget *checkbtn_filtering_log_pre_proc;
115         GtkWidget *checkbtn_filtering_log_post_proc;
116         GtkTooltips *filtering_log_tooltip;
117         GtkWidget *hbox_filtering_log_level;
118         GtkWidget *label_filtering_log_level;
119         GtkWidget *optmenu_filtering_log_level;
120         GtkListStore *menu;
121         GtkTreeIter iter;
122         GtkTooltips *filtering_log_level_tooltip;
123         GtkWidget *frame_disc_log;
124         GtkWidget *vbox_disc_log;
125         GtkWidget *label;
126         GtkWidget *hbox;
127         GtkWidget *checkbtn_log_standard;
128         GtkWidget *checkbtn_log_warning;
129         GtkWidget *checkbtn_log_error;
130         GtkWidget *checkbtn_log_status;
131         GtkSizeGroup *log_size_group;
132         GtkSizeGroup *filter_size_group;
133         
134         vbox1 = gtk_vbox_new (FALSE, VSPACING);
135         gtk_widget_show (vbox1);
136         gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
137
138         /* Protocol log */
139         vbox_network_log = gtkut_get_options_frame(vbox1, &frame_logging, _("Network log"));
140
141         hbox_clip_network_log = gtk_hbox_new (FALSE, 8);
142         gtk_container_add (GTK_CONTAINER (vbox_network_log), hbox_clip_network_log);
143         gtk_widget_show (hbox_clip_network_log);
144
145         PACK_CHECK_BUTTON (hbox_clip_network_log, checkbtn_clip_network_log,
146                            _("Restrict the log window to"));
147         
148         network_log_length_tooltip = gtk_tooltips_new();
149
150         spinbtn_network_log_length_adj = gtk_adjustment_new (500, 0, G_MAXINT, 1, 10, 10);
151         spinbtn_network_log_length = gtk_spin_button_new
152                 (GTK_ADJUSTMENT (spinbtn_network_log_length_adj), 1, 0);
153         gtk_widget_show (spinbtn_network_log_length);
154         gtk_box_pack_start (GTK_BOX (hbox_clip_network_log), spinbtn_network_log_length,
155                             FALSE, FALSE, 0);
156         gtk_widget_set_size_request (GTK_WIDGET (spinbtn_network_log_length), 64, -1);
157         gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_network_log_length), TRUE);
158
159         gtk_tooltips_set_tip(GTK_TOOLTIPS(network_log_length_tooltip), spinbtn_network_log_length,
160                              _("0 to stop logging in the log window"),
161                              NULL);
162
163         label = gtk_label_new(_("lines"));
164         gtk_widget_show (label);
165         gtk_box_pack_start(GTK_BOX(hbox_clip_network_log), label, FALSE, FALSE, 0);
166
167         SET_TOGGLE_SENSITIVITY(checkbtn_clip_network_log, spinbtn_network_log_length);
168         SET_TOGGLE_SENSITIVITY(checkbtn_clip_network_log, label);
169
170         /* Filtering/processing debug log */
171         vbox1_filtering_log = gtkut_get_options_frame(vbox1,
172                                 &frame_logging, _("Filtering/processing log"));
173
174         PACK_CHECK_BUTTON (vbox1_filtering_log, checkbtn_filtering_log,
175                            _("Enable logging of filtering/processing rules"));
176         hbox_filtering_log = gtk_hbox_new (FALSE, 8);
177         gtk_container_add (GTK_CONTAINER (vbox1_filtering_log), hbox_filtering_log);
178         gtk_widget_show (hbox_filtering_log);
179
180         filtering_log_tooltip = gtk_tooltips_new();
181         gtk_tooltips_set_tip(GTK_TOOLTIPS(filtering_log_tooltip),
182                              checkbtn_filtering_log,
183                              _("If checked, turns on logging of filtering and processing rules.\n"
184                                 "The log is accessible from 'Tools/Filtering log'.\n"
185                                 "Caution: enabling this option will slow down the filtering/processing, "
186                                 "this might be critical when applying many rules upon thousands of "
187                                 "messages."),
188                                 NULL);
189
190         vbox2_filtering_log = gtkut_get_options_frame(vbox1_filtering_log, &frame_filtering_log,
191                                                         _("Log filtering/processing when..."));
192
193         hbox_checkbtn = prefs_logging_create_check_buttons(
194                                                 &checkbtn_filtering_log_inc,
195                                                 _("filtering at incorporation"),
196                                                 &checkbtn_filtering_log_pre_proc,
197                                                 _("pre-processing folders"));
198         gtk_box_pack_start(GTK_BOX(vbox2_filtering_log), hbox_checkbtn, FALSE, FALSE, 0);
199
200         hbox_checkbtn = prefs_logging_create_check_buttons(
201                                                 &checkbtn_filtering_log_manual,
202                                                 _("manually filtering"),
203                                                 &checkbtn_filtering_log_post_proc,
204                                                 _("post-processing folders"));
205         gtk_box_pack_start(GTK_BOX(vbox2_filtering_log), hbox_checkbtn, FALSE, FALSE, 0);
206         
207         hbox_checkbtn = gtk_hbox_new(TRUE, VBOX_BORDER);
208         gtk_widget_show(hbox_checkbtn);
209         gtk_box_pack_start(GTK_BOX(vbox2_filtering_log), hbox_checkbtn, FALSE, FALSE, 0);
210         PACK_CHECK_BUTTON (hbox_checkbtn, checkbtn_filtering_log_folder_proc,
211                            _("processing folders"));
212         gtk_box_pack_start(GTK_BOX(hbox_checkbtn), gtk_label_new(""),
213                            FALSE, TRUE, 0);
214
215         filter_size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
216         gtk_size_group_add_widget(filter_size_group, checkbtn_filtering_log_inc);
217         gtk_size_group_add_widget(filter_size_group, checkbtn_filtering_log_manual);
218         gtk_size_group_add_widget(filter_size_group, checkbtn_filtering_log_folder_proc);
219
220         SET_TOGGLE_SENSITIVITY(checkbtn_filtering_log, frame_filtering_log);
221
222         hbox_filtering_log_level = gtk_hbox_new (FALSE, 8);
223         gtk_widget_show (hbox_filtering_log_level);
224         gtk_box_pack_start(GTK_BOX (vbox1_filtering_log), hbox_filtering_log_level, FALSE, FALSE, 0);
225
226         label_filtering_log_level = gtk_label_new (_("Log level"));
227         gtk_widget_show (label_filtering_log_level);
228         gtk_box_pack_start(GTK_BOX(hbox_filtering_log_level), label_filtering_log_level, FALSE, FALSE, 0);
229
230         optmenu_filtering_log_level = gtkut_sc_combobox_create(NULL, FALSE);
231         gtk_widget_show (optmenu_filtering_log_level);
232         
233         menu = GTK_LIST_STORE(gtk_combo_box_get_model(
234                                 GTK_COMBO_BOX(optmenu_filtering_log_level)));
235         COMBOBOX_ADD (menu, _("Low"), 0);
236         COMBOBOX_ADD (menu, _("Medium"), 1);
237         COMBOBOX_ADD (menu, _("High"), 2);
238
239         gtk_box_pack_start(GTK_BOX(hbox_filtering_log_level), optmenu_filtering_log_level, FALSE, FALSE, 0);
240
241         filtering_log_level_tooltip = gtk_tooltips_new();
242         gtk_tooltips_set_tip(GTK_TOOLTIPS(filtering_log_level_tooltip),
243                              optmenu_filtering_log_level,
244                              _("Select the level of detail of the logging.\n"
245                                 "Choose Low to see when rules are applied, which "
246                                 "conditions match or don't match and what actions are "
247                                 "performed.\n"
248                                 "Choose Medium to see more details about the message "
249                                 "that is being processed, and why rules are skipped.\n"
250                                 "Choose High to explicitly show the reason why all "
251                                 "rules are processed or skipped, and why all conditions "
252                                 "are matched or not matched.\n"
253                                 "Caution: the higher the level, the greater the "
254                                 "impact on performance."),
255                              NULL);
256
257         hbox_clip_filtering_log = gtk_hbox_new (FALSE, 8);
258         gtk_container_add (GTK_CONTAINER (vbox1_filtering_log), hbox_clip_filtering_log);
259         gtk_widget_show (hbox_clip_filtering_log);
260         PACK_CHECK_BUTTON (hbox_clip_filtering_log, checkbtn_clip_filtering_log,
261                            _("Restrict the log window to"));
262         
263         filtering_log_length_tooltip = gtk_tooltips_new();
264
265         spinbtn_filtering_log_length_adj = gtk_adjustment_new (500, 0, G_MAXINT, 1, 10, 10);
266         spinbtn_filtering_log_length = gtk_spin_button_new
267                 (GTK_ADJUSTMENT (spinbtn_filtering_log_length_adj), 1, 0);
268         gtk_widget_show (spinbtn_filtering_log_length);
269         gtk_box_pack_start (GTK_BOX (hbox_clip_filtering_log), spinbtn_filtering_log_length,
270                             FALSE, FALSE, 0);
271         gtk_widget_set_size_request (GTK_WIDGET (spinbtn_filtering_log_length), 64, -1);
272         gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_filtering_log_length), TRUE);
273
274         gtk_tooltips_set_tip(GTK_TOOLTIPS(filtering_log_length_tooltip), spinbtn_filtering_log_length,
275                              _("0 to stop logging in the log window"),
276                              NULL);
277
278         label = gtk_label_new(_("lines"));
279         gtk_widget_show (label);
280         gtk_box_pack_start(GTK_BOX(hbox_clip_filtering_log), label, FALSE, FALSE, 0);
281
282         SET_TOGGLE_SENSITIVITY(checkbtn_clip_filtering_log, spinbtn_filtering_log_length);
283         SET_TOGGLE_SENSITIVITY(checkbtn_clip_filtering_log, label);
284         SET_TOGGLE_SENSITIVITY(checkbtn_filtering_log, hbox_clip_filtering_log);
285         SET_TOGGLE_SENSITIVITY(checkbtn_filtering_log, optmenu_filtering_log_level);
286         SET_TOGGLE_SENSITIVITY(checkbtn_filtering_log, checkbtn_clip_filtering_log);
287         SET_TOGGLE_SENSITIVITY(checkbtn_filtering_log, label_filtering_log_level);
288
289         /* disk log */
290         vbox_disc_log = gtkut_get_options_frame(vbox1, &frame_disc_log, _("Disc log"));
291
292         label = gtk_label_new(_("Write the following information to disc..."));
293         gtk_widget_show(label);
294         hbox = gtk_hbox_new (FALSE, 8);
295         gtk_container_add (GTK_CONTAINER (vbox_disc_log), hbox);
296         gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
297         gtk_widget_show (hbox);
298
299         hbox_checkbtn = prefs_logging_create_check_buttons(&checkbtn_log_warning,
300                                 _("Warning messages"), &checkbtn_log_standard,
301                                 _("Network protocol messages"));
302         gtk_box_pack_start(GTK_BOX(vbox_disc_log), hbox_checkbtn, FALSE, FALSE, 0);
303
304         hbox_checkbtn = prefs_logging_create_check_buttons(&checkbtn_log_error, 
305                                 _("Error messages"), &checkbtn_log_status,
306                                 _("Status messages for filtering/processing log"));
307         gtk_box_pack_start(GTK_BOX(vbox_disc_log), hbox_checkbtn, FALSE, FALSE, 0);
308         
309         log_size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
310         gtk_size_group_add_widget(log_size_group, checkbtn_log_warning);
311         gtk_size_group_add_widget(log_size_group, checkbtn_log_error);
312
313         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_clip_network_log), 
314                 prefs_common.cliplog);
315         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_clip_filtering_log), 
316                 prefs_common.filtering_debug_cliplog);
317         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_log_standard), 
318                 prefs_common.enable_log_standard);
319         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_log_warning), 
320                 prefs_common.enable_log_warning);
321         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_log_error), 
322                 prefs_common.enable_log_error);
323         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_log_status), 
324                 prefs_common.enable_log_status);
325         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_filtering_log), 
326                 prefs_common.enable_filtering_debug);
327         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_filtering_log_inc), 
328                 prefs_common.enable_filtering_debug_inc);
329         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_filtering_log_manual), 
330                 prefs_common.enable_filtering_debug_manual);
331         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_filtering_log_folder_proc), 
332                 prefs_common.enable_filtering_debug_folder_proc);
333         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_filtering_log_pre_proc), 
334                 prefs_common.enable_filtering_debug_pre_proc);
335         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_filtering_log_post_proc), 
336                 prefs_common.enable_filtering_debug_post_proc);
337
338         gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_network_log_length),
339                 prefs_common.loglength);
340         gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_filtering_log_length),
341                 prefs_common.filtering_debug_loglength);
342
343         combobox_select_by_data(GTK_COMBO_BOX(optmenu_filtering_log_level),
344                         prefs_common.filtering_debug_level);
345
346         prefs_logging->checkbtn_clip_network_log = checkbtn_clip_network_log;
347         prefs_logging->spinbtn_network_log_length = spinbtn_network_log_length;
348         prefs_logging->checkbtn_log_standard = checkbtn_log_standard;
349         prefs_logging->checkbtn_log_warning = checkbtn_log_warning;
350         prefs_logging->checkbtn_log_error = checkbtn_log_error;
351         prefs_logging->checkbtn_log_status = checkbtn_log_status;
352         prefs_logging->checkbtn_clip_filtering_log = checkbtn_clip_filtering_log;
353         prefs_logging->spinbtn_filtering_log_length = spinbtn_filtering_log_length;
354         prefs_logging->checkbtn_filtering_log = checkbtn_filtering_log;
355         prefs_logging->checkbtn_filtering_log_inc = checkbtn_filtering_log_inc;
356         prefs_logging->checkbtn_filtering_log_manual = checkbtn_filtering_log_manual;
357         prefs_logging->checkbtn_filtering_log_folder_proc = checkbtn_filtering_log_folder_proc;
358         prefs_logging->checkbtn_filtering_log_pre_proc = checkbtn_filtering_log_pre_proc;
359         prefs_logging->checkbtn_filtering_log_post_proc = checkbtn_filtering_log_post_proc;
360         prefs_logging->optmenu_filtering_log_level = optmenu_filtering_log_level;
361
362         prefs_logging->page.widget = vbox1;
363 }
364
365 static void prefs_logging_save(PrefsPage *_page)
366 {
367         LoggingPage *page = (LoggingPage *) _page;
368         MainWindow *mainwindow;
369         gboolean filtering_debug_enabled;
370
371         prefs_common.filtering_debug_level =
372                 combobox_get_active_data(GTK_COMBO_BOX(page->optmenu_filtering_log_level));
373
374         prefs_common.cliplog = gtk_toggle_button_get_active(
375                 GTK_TOGGLE_BUTTON(page->checkbtn_clip_network_log));
376         prefs_common.loglength = gtk_spin_button_get_value_as_int(
377                 GTK_SPIN_BUTTON(page->spinbtn_network_log_length));
378         prefs_common.enable_log_standard = gtk_toggle_button_get_active(
379                 GTK_TOGGLE_BUTTON(page->checkbtn_log_standard));
380         prefs_common.enable_log_warning = gtk_toggle_button_get_active(
381                 GTK_TOGGLE_BUTTON(page->checkbtn_log_warning));
382         prefs_common.enable_log_error = gtk_toggle_button_get_active(
383                 GTK_TOGGLE_BUTTON(page->checkbtn_log_error));
384         prefs_common.enable_log_status = gtk_toggle_button_get_active(
385                 GTK_TOGGLE_BUTTON(page->checkbtn_log_status));
386         prefs_common.filtering_debug_cliplog = gtk_toggle_button_get_active(
387                 GTK_TOGGLE_BUTTON(page->checkbtn_clip_filtering_log));
388         prefs_common.filtering_debug_loglength = gtk_spin_button_get_value_as_int(
389                 GTK_SPIN_BUTTON(page->spinbtn_filtering_log_length));
390         filtering_debug_enabled = prefs_common.enable_filtering_debug;
391         prefs_common.enable_filtering_debug = gtk_toggle_button_get_active(
392                 GTK_TOGGLE_BUTTON(page->checkbtn_filtering_log));
393         if (filtering_debug_enabled != prefs_common.enable_filtering_debug) {
394                 if (prefs_common.enable_filtering_debug)
395                         log_message(LOG_DEBUG_FILTERING, _("filtering log enabled\n"));
396                 else
397                         log_message(LOG_DEBUG_FILTERING, _("filtering log disabled\n"));
398         }
399         prefs_common.enable_filtering_debug_inc = gtk_toggle_button_get_active(
400                 GTK_TOGGLE_BUTTON(page->checkbtn_filtering_log_inc));
401         prefs_common.enable_filtering_debug_manual = gtk_toggle_button_get_active(
402                 GTK_TOGGLE_BUTTON(page->checkbtn_filtering_log_manual));
403         prefs_common.enable_filtering_debug_folder_proc = gtk_toggle_button_get_active(
404                 GTK_TOGGLE_BUTTON(page->checkbtn_filtering_log_folder_proc));
405         prefs_common.enable_filtering_debug_pre_proc = gtk_toggle_button_get_active(
406                 GTK_TOGGLE_BUTTON(page->checkbtn_filtering_log_pre_proc));
407         prefs_common.enable_filtering_debug_post_proc = gtk_toggle_button_get_active(
408                 GTK_TOGGLE_BUTTON(page->checkbtn_filtering_log_post_proc));
409
410         mainwindow = mainwindow_get_mainwindow();
411         log_window_set_clipping(mainwindow->logwin, prefs_common.cliplog,
412                                 prefs_common.loglength);
413         log_window_set_clipping(mainwindow->filtering_debugwin, prefs_common.filtering_debug_cliplog,
414                                 prefs_common.filtering_debug_loglength);
415 }
416
417 static void prefs_logging_destroy_widget(PrefsPage *_page)
418 {
419 }
420
421 LoggingPage *prefs_logging;
422
423 void prefs_logging_init(void)
424 {
425         LoggingPage *page;
426         static gchar *path[3];
427
428         path[0] = _("Other");
429         path[1] = _("Logging");
430         path[2] = NULL;
431
432         page = g_new0(LoggingPage, 1);
433         page->page.path = path;
434         page->page.create_widget = prefs_logging_create_widget;
435         page->page.destroy_widget = prefs_logging_destroy_widget;
436         page->page.save_page = prefs_logging_save;
437         page->page.weight = 5.0;
438         prefs_gtk_register_page((PrefsPage *) page);
439         prefs_logging = page;
440 }
441
442 void prefs_logging_done(void)
443 {
444         prefs_gtk_unregister_page((PrefsPage *) prefs_logging);
445         g_free(prefs_logging);
446 }