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