# HG changeset patch # User Christian Hammond # Date 1054437715 0 # Node ID 73c9dc20e41acd12db8abd150b02af2ebec0961c # Parent 4cc9e3fa22c4ecbcd73e5dfc293a8b842a383998 [gaim-migrate @ 6032] The GTK+ debug system now has its own init(), where it adds its own prefs and sets up callbacks. committer: Tailor Script diff -r 4cc9e3fa22c4 -r 73c9dc20e41a src/gtkdebug.c --- a/src/gtkdebug.c Sun Jun 01 02:19:35 2003 +0000 +++ b/src/gtkdebug.c Sun Jun 01 03:21:55 2003 +0000 @@ -181,6 +181,31 @@ return win; } +static void +debug_enabled_cb(const char *name, GaimPrefType type, gpointer value, + gpointer data) +{ + if (debug_win == NULL) + gaim_gtk_debug_window_show(); + else + gaim_gtk_debug_window_hide(); +} + +void +gaim_gtk_debug_init(void) +{ + /* Debug window preferences. */ + gaim_prefs_add_none("/gaim/gtk/debug"); + gaim_prefs_add_bool("/gaim/gtk/debug/enabled", FALSE); + gaim_prefs_add_bool("/gaim/gtk/debug/timestamps", FALSE); + gaim_prefs_add_bool("/gaim/gtk/debug/toolbar", TRUE); + gaim_prefs_add_int("/gaim/gtk/debug/width", 400); + gaim_prefs_add_int("/gaim/gtk/debug/height", 150); + + gaim_prefs_connect_callback("/gaim/gtk/debug/enabled", + debug_enabled_cb, NULL); +} + void gaim_gtk_debug_window_show(void) { diff -r 4cc9e3fa22c4 -r 73c9dc20e41a src/gtkdebug.h --- a/src/gtkdebug.h Sun Jun 01 02:19:35 2003 +0000 +++ b/src/gtkdebug.h Sun Jun 01 03:21:55 2003 +0000 @@ -26,6 +26,11 @@ #include "debug.h" /** + * Initializes the GTK+ debug system. + */ +void gaim_gtk_debug_init(void); + +/** * Shows the debug window. */ void gaim_gtk_debug_window_show(void); diff -r 4cc9e3fa22c4 -r 73c9dc20e41a src/gtkprefs.c --- a/src/gtkprefs.c Sun Jun 01 02:19:35 2003 +0000 +++ b/src/gtkprefs.c Sun Jun 01 03:21:55 2003 +0000 @@ -2782,14 +2782,6 @@ gaim_prefs_add_int("/gaim/gtk/conversations/im/default_height", 160); gaim_prefs_add_int("/gaim/gtk/conversations/im/entry_height", 50); - /* Debug window preferences. */ - gaim_prefs_add_none("/gaim/gtk/debug"); - gaim_prefs_add_bool("/gaim/gtk/debug/enabled", FALSE); - gaim_prefs_add_bool("/gaim/gtk/debug/timestamps", FALSE); - gaim_prefs_add_bool("/gaim/gtk/debug/toolbar", TRUE); - gaim_prefs_add_int("/gaim/gtk/debug/width", 400); - gaim_prefs_add_int("/gaim/gtk/debug/height", 150); - /* Idle */ gaim_prefs_add_none("/gaim/gtk/idle"); gaim_prefs_add_string("/gaim/gtk/idle/reporting_method", "system"); diff -r 4cc9e3fa22c4 -r 73c9dc20e41a src/main.c --- a/src/main.c Sun Jun 01 02:19:35 2003 +0000 +++ b/src/main.c Sun Jun 01 03:21:55 2003 +0000 @@ -887,6 +887,8 @@ gaim_prefs_init(); gaim_gtk_prefs_init(); + gaim_gtk_debug_init(); + if (!gaim_prefs_load()) { load_prefs(); gaim_prefs_sync();