changeset 5625:73c9dc20e41a

[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 <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 01 Jun 2003 03:21:55 +0000
parents 4cc9e3fa22c4
children 6275ac113622
files src/gtkdebug.c src/gtkdebug.h src/gtkprefs.c src/main.c
diffstat 4 files changed, 32 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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)
 {
--- 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);
--- 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");
--- 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();