# HG changeset patch # User Christian Hammond # Date 1054635917 0 # Node ID aa8dbb7e0a4dc4887abc419ff614154b265414f1 # Parent cee14870644ce75c1b521360779bf82304e5d341 [gaim-migrate @ 6125] The timestamps button in the debug toolbar is now set correctly on startup. committer: Tailor Script diff -r cee14870644c -r aa8dbb7e0a4d src/gtkdebug.c --- a/src/gtkdebug.c Tue Jun 03 10:15:29 2003 +0000 +++ b/src/gtkdebug.c Tue Jun 03 10:25:17 2003 +0000 @@ -34,6 +34,8 @@ gboolean timestamps; gboolean paused; + guint timestamps_handle; + } DebugWindow; static char debug_fg_colors[][8] = { @@ -50,11 +52,14 @@ static gint debug_window_destroy(GtkWidget *w, GdkEvent *event, void *unused) { + if (debug_win->timestamps_handle != 0) + gaim_prefs_disconnect_callback(debug_win->timestamps_handle); + + gaim_prefs_set_bool("/gaim/gtk/debug/enabled", FALSE); + g_free(debug_win); debug_win = NULL; - gaim_prefs_set_bool("/gaim/gtk/debug/enabled", FALSE); - return FALSE; } @@ -89,6 +94,13 @@ gaim_prefs_set_bool("/gaim/gtk/debug/timestamps", win->timestamps); } +static void +timestamps_pref_cb(const char *name, GaimPrefType type, gpointer value, + gpointer data) +{ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data), (gboolean)value); +} + static DebugWindow * debug_window_new(void) { @@ -159,8 +171,9 @@ NULL, G_CALLBACK(__timestamps_cb), win); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), - gaim_prefs_get_bool("/gaim/gtk/debug/timestamps")); + win->timestamps_handle = + gaim_prefs_connect_callback("/gaim/gtk/debug/timestamps", + timestamps_pref_cb, button); } /* Now our scrolled window... */