pidgin/gtkdebug.c

changeset 17232
8593d66c708b
parent 17040
cb33027a36e4
child 19065
763421f3cc0d
equal deleted inserted replaced
17231:d5c103949806 17232:8593d66c708b
75 "#FF0000", /**< Errors. */ 75 "#FF0000", /**< Errors. */
76 "#FF0000", /**< Fatal errors. */ 76 "#FF0000", /**< Fatal errors. */
77 }; 77 };
78 78
79 static DebugWindow *debug_win = NULL; 79 static DebugWindow *debug_win = NULL;
80 static guint debug_enabled_timer = 0;
80 81
81 #ifdef HAVE_REGEX_H 82 #ifdef HAVE_REGEX_H
82 static void regex_filter_all(DebugWindow *win); 83 static void regex_filter_all(DebugWindow *win);
83 static void regex_show_all(DebugWindow *win); 84 static void regex_show_all(DebugWindow *win);
84 #endif /* HAVE_REGEX_H */ 85 #endif /* HAVE_REGEX_H */
862 gtk_widget_show_all(win->window); 863 gtk_widget_show_all(win->window);
863 864
864 return win; 865 return win;
865 } 866 }
866 867
867 static void 868 static gboolean
868 debug_enabled_cb(const char *name, PurplePrefType type, 869 debug_enabled_timeout_cb(gpointer data)
869 gconstpointer value, gpointer data) 870 {
870 { 871 debug_enabled_timer = 0;
871 if (value) 872
873 if (data)
872 pidgin_debug_window_show(); 874 pidgin_debug_window_show();
873 else 875 else
874 pidgin_debug_window_hide(); 876 pidgin_debug_window_hide();
877
878 return FALSE;
879 }
880
881 static void
882 debug_enabled_cb(const char *name, PurplePrefType type,
883 gconstpointer value, gpointer data)
884 {
885 debug_enabled_timer = g_timeout_add(0, debug_enabled_timeout_cb, GINT_TO_POINTER(GPOINTER_TO_INT(value)));
875 } 886 }
876 887
877 static void 888 static void
878 pidgin_glib_log_handler(const gchar *domain, GLogLevelFlags flags, 889 pidgin_glib_log_handler(const gchar *domain, GLogLevelFlags flags,
879 const gchar *msg, gpointer user_data) 890 const gchar *msg, gpointer user_data)
982 993
983 void 994 void
984 pidgin_debug_uninit(void) 995 pidgin_debug_uninit(void)
985 { 996 {
986 purple_debug_set_ui_ops(NULL); 997 purple_debug_set_ui_ops(NULL);
998
999 if (debug_enabled_timer != 0)
1000 g_source_remove(debug_enabled_timer);
987 } 1001 }
988 1002
989 void 1003 void
990 pidgin_debug_window_show(void) 1004 pidgin_debug_window_show(void)
991 { 1005 {

mercurial