annotate src/gtkdebug.c @ 9094:d516da4b8ace

[gaim-migrate @ 9871] italian update committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 27 May 2004 14:51:38 +0000
parents 0277908e367d
children 91856b52a391
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file gtkdebug.c GTK+ Debug API
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 * @ingroup gtkui
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8002
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8002
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8002
diff changeset
9 * source distribution.
7152
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
10 *
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * (at your option) any later version.
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 *
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * GNU General Public License for more details.
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 *
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 */
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6280
diff changeset
25 #include "gtkinternal.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5818
diff changeset
26
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5818
diff changeset
27 #include "prefs.h"
8953
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
28 #include "request.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5818
diff changeset
29 #include "util.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5818
diff changeset
30
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 #include "gtkdebug.h"
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 #include "gtkimhtml.h"
8953
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
33 #include "gtkutils.h"
6009
5cd7a10c6ade [gaim-migrate @ 6457]
Christian Hammond <chipx86@chipx86.com>
parents: 5872
diff changeset
34 #include "stock.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5818
diff changeset
35
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5818
diff changeset
36 #include "ui.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5818
diff changeset
37
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5818
diff changeset
38 extern int opt_debug;
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 typedef struct
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41 {
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 GtkWidget *window;
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
43 GtkWidget *text;
8953
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
44 GtkWidget *find;
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
45
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
46 gboolean timestamps;
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
47 gboolean paused;
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48
5704
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
49 guint timestamps_handle;
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
50
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 } DebugWindow;
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53 static char debug_fg_colors[][8] = {
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54 "#000000", /**< All debug levels. */
7150
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
55 "#666666", /**< Misc. */
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56 "#000000", /**< Information. */
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57 "#660000", /**< Warnings. */
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58 "#FF0000", /**< Errors. */
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 "#FF0000", /**< Fatal errors. */
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60 };
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 static DebugWindow *debug_win = NULL;
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63
8953
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
64 struct _find {
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
65 DebugWindow *window;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
66 GtkWidget *entry;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
67 };
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
68
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 static gint
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 debug_window_destroy(GtkWidget *w, GdkEvent *event, void *unused)
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 {
5704
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
72 if (debug_win->timestamps_handle != 0)
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
73 gaim_prefs_disconnect_callback(debug_win->timestamps_handle);
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
74
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
75 gaim_prefs_set_bool("/gaim/gtk/debug/enabled", FALSE);
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
76
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 g_free(debug_win);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 debug_win = NULL;
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
80 return FALSE;
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
81 }
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
83 static gboolean
5794
5e93fc46d1af [gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents: 5738
diff changeset
84 configure_cb(GtkWidget *w, GdkEventConfigure *event, DebugWindow *win)
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
85 {
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
86 if (GTK_WIDGET_VISIBLE(w)) {
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
87 gaim_prefs_set_int("/gaim/gtk/debug/width", event->width);
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
88 gaim_prefs_set_int("/gaim/gtk/debug/height", event->height);
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
89 }
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 return FALSE;
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 }
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
94 static void
8953
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
95 do_find_cb(GtkWidget *widget, gint resp, struct _find *f)
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
96 {
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
97 switch (resp) {
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
98 case GTK_RESPONSE_OK:
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
99 gtk_imhtml_search_find(GTK_IMHTML(f->window->text),
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
100 gtk_entry_get_text(GTK_ENTRY(f->entry)));
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
101 break;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
102
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
103 case GTK_RESPONSE_DELETE_EVENT:
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
104 case GTK_RESPONSE_CLOSE:
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
105 gtk_imhtml_search_clear(GTK_IMHTML(f->window->text));
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
106 gtk_widget_destroy(f->window->find);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
107 f->window->find = NULL;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
108 g_free(f);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
109 break;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
110 }
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
111 }
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
112
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
113 static void
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
114 find_cb(GtkWidget *w, DebugWindow *win)
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
115 {
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
116 GtkWidget *hbox, *img, *label;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
117 struct _find *f;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
118
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
119 if(win->find)
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
120 {
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
121 gtk_window_present(GTK_WINDOW(win->find));
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
122 return;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
123 }
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
124
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
125 f = g_malloc(sizeof(struct _find));
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
126 f->window = win;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
127 win->find = gtk_dialog_new_with_buttons(_("Find"),
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
128 GTK_WINDOW(win->window), GTK_DIALOG_DESTROY_WITH_PARENT,
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
129 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
130 GTK_STOCK_FIND, GTK_RESPONSE_OK, NULL);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
131 gtk_dialog_set_default_response(GTK_DIALOG(win->find),
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
132 GTK_RESPONSE_OK);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
133 g_signal_connect(G_OBJECT(win->find), "response",
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
134 G_CALLBACK(do_find_cb), f);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
135
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
136 gtk_container_set_border_width(GTK_CONTAINER(win->find), 6);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
137 gtk_window_set_resizable(GTK_WINDOW(win->find), FALSE);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
138 gtk_dialog_set_has_separator(GTK_DIALOG(win->find), FALSE);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
139 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(win->find)->vbox), 12);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
140 gtk_container_set_border_width(
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
141 GTK_CONTAINER(GTK_DIALOG(win->find)->vbox), 6);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
142
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
143 hbox = gtk_hbox_new(FALSE, 12);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
144 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(win->find)->vbox),
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
145 hbox);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
146 img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_QUESTION,
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
147 GTK_ICON_SIZE_DIALOG);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
148 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
149
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
150 gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
151 gtk_dialog_set_response_sensitive(GTK_DIALOG(win->find),
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
152 GTK_RESPONSE_OK, FALSE);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
153
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
154 label = gtk_label_new(NULL);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
155 gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), _("_Search for:"));
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
156 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
157
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
158 f->entry = gtk_entry_new();
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
159 gtk_entry_set_activates_default(GTK_ENTRY(f->entry), TRUE);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
160 gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_WIDGET(f->entry));
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
161 g_signal_connect(G_OBJECT(f->entry), "changed",
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
162 G_CALLBACK(gaim_gtk_set_sensitive_if_input),
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
163 win->find);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
164 gtk_box_pack_start(GTK_BOX(hbox), f->entry, FALSE, FALSE, 0);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
165
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
166 gtk_widget_show_all(win->find);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
167 gtk_widget_grab_focus(f->entry);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
168 }
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
169
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
170 static void
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
171 do_save_cb(GtkWidget *wid)
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
172 {
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
173 DebugWindow *win = NULL;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
174 const char *filename;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
175 char *tmp;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
176 FILE *fp;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
177
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
178 win = g_object_get_data(G_OBJECT(GTK_FILE_SELECTION(wid)->ok_button),
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
179 "gaim_debugwin");
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
180
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
181 filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(wid));
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
182 gtk_widget_destroy(wid);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
183
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
184 if (filename == NULL)
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
185 return;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
186
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
187 if ((fp = fopen(filename, "w+")) == NULL)
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
188 return;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
189
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
190 if (debug_win == NULL)
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
191 return;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
192
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
193 tmp = gtk_imhtml_get_text(GTK_IMHTML(win->text), NULL, NULL);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
194 fprintf(fp, "Gaim Debug log : %s\n", gaim_date_full());
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
195 fprintf(fp, "%s", tmp);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
196 g_free(tmp);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
197
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
198 fclose(fp);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
199 }
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
200
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
201 static void
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
202 do_check_save_cb(GtkObject *obj, GtkWidget *wid)
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
203 {
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
204 const char *filename;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
205
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
206 filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(wid));
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
207 if (gaim_gtk_check_if_dir(filename, GTK_FILE_SELECTION(wid)))
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
208 return;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
209
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
210 if (g_file_test(filename, G_FILE_TEST_EXISTS))
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
211 {
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
212 gaim_request_yes_no(NULL, NULL, _("That file already exists"),
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
213 _("Would you like to overwrite it?"), 1, wid,
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
214 G_CALLBACK(do_save_cb), NULL);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
215 }
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
216 else
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
217 do_save_cb(wid);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
218 }
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
219
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
220 static void
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
221 save_cb(GtkWidget *w, DebugWindow *win)
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
222 {
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
223 char buf[BUF_LONG];
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
224 GtkWidget *window;
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
225
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
226 window = gtk_file_selection_new(_("Save Debug Log"));
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
227 g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S "gaim-debug.log",
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
228 gaim_home_dir());
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
229 gtk_file_selection_set_filename(GTK_FILE_SELECTION(window), buf);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
230 g_object_set_data(G_OBJECT(GTK_FILE_SELECTION(window)->ok_button),
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
231 "gaim_debugwin", win);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
232 g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(window)->ok_button),
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
233 "clicked", G_CALLBACK(do_check_save_cb), window);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
234 g_signal_connect_swapped(G_OBJECT(GTK_FILE_SELECTION(window)->cancel_button),
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
235 "clicked", G_CALLBACK(gtk_widget_destroy), (gpointer)window);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
236
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
237 gtk_widget_show(window);
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
238 }
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
239
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
240 static void
5794
5e93fc46d1af [gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents: 5738
diff changeset
241 clear_cb(GtkWidget *w, DebugWindow *win)
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
242 {
6280
d330afe3ccf0 [gaim-migrate @ 6779]
Christian Hammond <chipx86@chipx86.com>
parents: 6094
diff changeset
243 gtk_imhtml_clear(GTK_IMHTML(win->text));
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
244 }
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
245
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
246 static void
5794
5e93fc46d1af [gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents: 5738
diff changeset
247 pause_cb(GtkWidget *w, DebugWindow *win)
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
248 {
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
249 win->paused = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
250 }
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
251
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
252 static void
5794
5e93fc46d1af [gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents: 5738
diff changeset
253 timestamps_cb(GtkWidget *w, DebugWindow *win)
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
254 {
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
255 win->timestamps = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
256
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
257 gaim_prefs_set_bool("/gaim/gtk/debug/timestamps", win->timestamps);
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
258 }
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
259
5704
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
260 static void
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
261 timestamps_pref_cb(const char *name, GaimPrefType type, gpointer value,
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
262 gpointer data)
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
263 {
6478
338147ea6896 [gaim-migrate @ 6991]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
264 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data), GPOINTER_TO_INT(value));
5704
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
265 }
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
266
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
267 static DebugWindow *
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
268 debug_window_new(void)
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
269 {
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
270 DebugWindow *win;
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
271 GtkWidget *vbox;
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
272 GtkWidget *toolbar;
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
273 GtkWidget *sw;
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
274 GtkWidget *button;
6094
538c522e36e1 [gaim-migrate @ 6553]
Christian Hammond <chipx86@chipx86.com>
parents: 6009
diff changeset
275 GtkWidget *image;
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
276 int width, height;
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
277
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
278 win = g_new0(DebugWindow, 1);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
279
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
280 width = gaim_prefs_get_int("/gaim/gtk/debug/width");
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
281 height = gaim_prefs_get_int("/gaim/gtk/debug/height");
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
282
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
283 GAIM_DIALOG(win->window);
5642
1693a3027dc8 [gaim-migrate @ 6056]
Christian Hammond <chipx86@chipx86.com>
parents: 5636
diff changeset
284 gaim_debug(GAIM_DEBUG_INFO, "gtkdebug", "Setting dimensions to %d, %d\n",
1693a3027dc8 [gaim-migrate @ 6056]
Christian Hammond <chipx86@chipx86.com>
parents: 5636
diff changeset
285 width, height);
1693a3027dc8 [gaim-migrate @ 6056]
Christian Hammond <chipx86@chipx86.com>
parents: 5636
diff changeset
286
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
287 gtk_window_set_default_size(GTK_WINDOW(win->window), width, height);
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
288 gtk_window_set_role(GTK_WINDOW(win->window), "debug");
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
289 gtk_window_set_title(GTK_WINDOW(win->window), _("Debug Window"));
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
290
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
291 g_signal_connect(G_OBJECT(win->window), "delete_event",
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
292 G_CALLBACK(debug_window_destroy), NULL);
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
293 g_signal_connect(G_OBJECT(win->window), "configure_event",
5794
5e93fc46d1af [gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents: 5738
diff changeset
294 G_CALLBACK(configure_cb), win);
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
295
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
296 /* Setup the vbox */
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
297 vbox = gtk_vbox_new(FALSE, 0);
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
298 gtk_container_add(GTK_CONTAINER(win->window), vbox);
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
299
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
300 if (gaim_prefs_get_bool("/gaim/gtk/debug/toolbar")) {
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
301 /* Setup our top button bar thingie. */
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
302 toolbar = gtk_toolbar_new();
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
303 gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH_HORIZ);
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
304 gtk_toolbar_set_icon_size(GTK_TOOLBAR(toolbar),
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
305 GTK_ICON_SIZE_SMALL_TOOLBAR);
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
306
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
307 gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0);
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
308
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
309 /* Find button */
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
310 gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_FIND,
8953
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
311 NULL, NULL, G_CALLBACK(find_cb), win, -1);
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
312
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
313 /* Save */
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
314 gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_SAVE,
8953
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
315 NULL, NULL, G_CALLBACK(save_cb), win, -1);
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
316
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
317 /* Clear button */
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
318 gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_CLEAR,
5794
5e93fc46d1af [gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents: 5738
diff changeset
319 NULL, NULL, G_CALLBACK(clear_cb), win, -1);
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
320
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
321 gtk_toolbar_insert_space(GTK_TOOLBAR(toolbar), -1);
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
322
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
323 /* Pause */
6094
538c522e36e1 [gaim-migrate @ 6553]
Christian Hammond <chipx86@chipx86.com>
parents: 6009
diff changeset
324 image = gtk_image_new_from_stock(GAIM_STOCK_PAUSE, GTK_ICON_SIZE_MENU);
538c522e36e1 [gaim-migrate @ 6553]
Christian Hammond <chipx86@chipx86.com>
parents: 6009
diff changeset
325 button = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
538c522e36e1 [gaim-migrate @ 6553]
Christian Hammond <chipx86@chipx86.com>
parents: 6009
diff changeset
326 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
538c522e36e1 [gaim-migrate @ 6553]
Christian Hammond <chipx86@chipx86.com>
parents: 6009
diff changeset
327 NULL, _("Pause"), NULL, NULL,
538c522e36e1 [gaim-migrate @ 6553]
Christian Hammond <chipx86@chipx86.com>
parents: 6009
diff changeset
328 image, G_CALLBACK(pause_cb), win);
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
329
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
330 /* Timestamps */
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
331 button = gtk_toolbar_append_element(GTK_TOOLBAR(toolbar),
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
332 GTK_TOOLBAR_CHILD_TOGGLEBUTTON,
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
333 NULL, _("Timestamps"), NULL, NULL,
5794
5e93fc46d1af [gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents: 5738
diff changeset
334 NULL, G_CALLBACK(timestamps_cb),
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
335 win);
8953
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
336
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
337 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
8002
c94f2dad3b73 [gaim-migrate @ 8679]
Christian Hammond <chipx86@chipx86.com>
parents: 7229
diff changeset
338 gaim_prefs_get_bool("/gaim/gtk/debug/timestamps"));
8953
0277908e367d [gaim-migrate @ 9726]
Luke Schierer <lschiere@pidgin.im>
parents: 8735
diff changeset
339
5704
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
340 win->timestamps_handle =
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
341 gaim_prefs_connect_callback("/gaim/gtk/debug/timestamps",
aa8dbb7e0a4d [gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents: 5684
diff changeset
342 timestamps_pref_cb, button);
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
343 }
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
344
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
345 /* Now our scrolled window... */
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
346 sw = gtk_scrolled_window_new(NULL, NULL);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
347 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
348 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
349 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
350 GTK_SHADOW_IN);
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
351
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
352 /* ... which has a gtkimhtml in it. */
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
353 win->text = gtk_imhtml_new(NULL, NULL);
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
354
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
355 gtk_container_add(GTK_CONTAINER(sw), win->text);
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
356
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
357 /* Pack it in... Not like that, sicko. */
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
358 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
359
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
360 gtk_widget_show_all(win->window);
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
361
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
362 return win;
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
363 }
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
364
5625
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
365 static void
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
366 debug_enabled_cb(const char *name, GaimPrefType type, gpointer value,
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
367 gpointer data)
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
368 {
5636
11233ca9f533 [gaim-migrate @ 6043]
Nathan Walp <nwalp@pidgin.im>
parents: 5631
diff changeset
369 if (value)
5625
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
370 gaim_gtk_debug_window_show();
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
371 else
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
372 gaim_gtk_debug_window_hide();
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
373 }
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
374
7150
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
375 static void
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
376 gaim_glib_log_handler(const gchar *domain, GLogLevelFlags flags,
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
377 const gchar *msg, gpointer user_data)
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
378 {
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
379 GaimDebugLevel level;
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
380 char *new_msg = NULL;
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
381 char *new_domain = NULL;
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
382
7152
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
383 if ((flags & G_LOG_LEVEL_ERROR) == G_LOG_LEVEL_ERROR)
7150
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
384 level = GAIM_DEBUG_ERROR;
7152
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
385 else if ((flags & G_LOG_LEVEL_CRITICAL) == G_LOG_LEVEL_CRITICAL)
7150
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
386 level = GAIM_DEBUG_FATAL;
7152
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
387 else if ((flags & G_LOG_LEVEL_WARNING) == G_LOG_LEVEL_WARNING)
7150
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
388 level = GAIM_DEBUG_WARNING;
7152
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
389 else if ((flags & G_LOG_LEVEL_MESSAGE) == G_LOG_LEVEL_MESSAGE)
7150
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
390 level = GAIM_DEBUG_INFO;
7152
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
391 else if ((flags & G_LOG_LEVEL_INFO) == G_LOG_LEVEL_INFO)
7150
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
392 level = GAIM_DEBUG_INFO;
7152
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
393 else if ((flags & G_LOG_LEVEL_DEBUG) == G_LOG_LEVEL_DEBUG)
7150
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
394 level = GAIM_DEBUG_MISC;
7152
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
395 else
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
396 {
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
397 gaim_debug_warning("gtkdebug",
7150
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
398 "Unknown glib logging level in %d\n", flags);
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
399
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
400 level = GAIM_DEBUG_MISC; /* This will never happen. */
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
401 }
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
402
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
403 if (msg != NULL)
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
404 new_msg = gaim_utf8_try_convert(msg);
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
405
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
406 if (domain != NULL)
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
407 new_domain = gaim_utf8_try_convert(domain);
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
408
7152
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
409 if (new_msg != NULL)
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
410 {
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
411 gaim_debug(level, (new_domain != NULL ? new_domain : "g_log"),
cada5ddc21f5 [gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents: 7150
diff changeset
412 "%s\n", new_msg);
7150
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
413
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
414 g_free(new_msg);
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
415 }
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
416
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
417 if (new_domain != NULL)
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
418 g_free(new_domain);
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
419 }
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
420
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
421 #ifdef _WIN32
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
422 static void
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
423 gaim_glib_dummy_print_handler(const gchar *string)
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
424 {
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
425 }
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
426 #endif
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
427
5625
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
428 void
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
429 gaim_gtk_debug_init(void)
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
430 {
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
431 /* Debug window preferences. */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
432 /*
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
433 * NOTE: This must be set before prefs are loaded, and the callbacks
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
434 * set after they are loaded, since prefs sets the enabled
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
435 * preference here and that loads the window, which calls the
8735
92cbf9713795 [gaim-migrate @ 9490]
Christian Hammond <chipx86@chipx86.com>
parents: 8046
diff changeset
436 * configure event, which overrides the width and height! :P
5684
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
437 */
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
438
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
439 gaim_prefs_add_none("/gaim/gtk/debug");
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
440 gaim_prefs_add_bool("/gaim/gtk/debug/enabled", FALSE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
441 gaim_prefs_add_bool("/gaim/gtk/debug/timestamps", FALSE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
442 gaim_prefs_add_bool("/gaim/gtk/debug/toolbar", TRUE);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
443 gaim_prefs_add_int("/gaim/gtk/debug/width", 450);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
444 gaim_prefs_add_int("/gaim/gtk/debug/height", 250);
b61520e71679 [gaim-migrate @ 6104]
Nathan Walp <nwalp@pidgin.im>
parents: 5642
diff changeset
445
5625
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
446 gaim_prefs_connect_callback("/gaim/gtk/debug/enabled",
5794
5e93fc46d1af [gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents: 5738
diff changeset
447 debug_enabled_cb, NULL);
7150
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
448
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
449 #define REGISTER_G_LOG_HANDLER(name) \
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
450 g_log_set_handler((name), G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL \
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
451 | G_LOG_FLAG_RECURSION, \
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
452 gaim_glib_log_handler, NULL)
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
453
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
454 /* Register the glib/gtk log handlers. */
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
455 REGISTER_G_LOG_HANDLER(NULL);
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
456 REGISTER_G_LOG_HANDLER("Gdk");
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
457 REGISTER_G_LOG_HANDLER("Gtk");
7229
26fe5055e0b0 [gaim-migrate @ 7799]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 7152
diff changeset
458 REGISTER_G_LOG_HANDLER("GdkPixbuf");
7150
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
459 REGISTER_G_LOG_HANDLER("GLib");
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
460 REGISTER_G_LOG_HANDLER("GModule");
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
461 REGISTER_G_LOG_HANDLER("GLib-GObject");
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
462 REGISTER_G_LOG_HANDLER("GThread");
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
463
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
464 #ifdef _WIN32
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
465 if (!opt_debug)
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
466 g_set_print_handler(gaim_glib_dummy_print_handler);
e09020153d85 [gaim-migrate @ 7717]
Sean Egan <seanegan@gmail.com>
parents: 7108
diff changeset
467 #endif
5625
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
468 }
73c9dc20e41a [gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents: 5535
diff changeset
469
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
470 void
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
471 gaim_gtk_debug_window_show(void)
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
472 {
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
473 if (debug_win == NULL)
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
474 debug_win = debug_window_new();
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
475
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
476 gtk_widget_show(debug_win->window);
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
477
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
478 gaim_prefs_set_bool("/gaim/gtk/debug/enabled", TRUE);
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
479 }
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
480
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
481 void
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
482 gaim_gtk_debug_window_hide(void)
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
483 {
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
484 if (debug_win != NULL) {
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
485 gtk_widget_destroy(debug_win->window);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
486 debug_window_destroy(NULL, NULL, NULL);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
487 }
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
488 }
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
489
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
490 static void
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
491 gaim_gtk_debug_print(GaimDebugLevel level, const char *category,
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
492 const char *format, va_list args)
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
493 {
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
494 gchar *arg_s, *ts_s;
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
495 gboolean timestamps;
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
496
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
497 timestamps = gaim_prefs_get_bool("/gaim/gtk/debug/timestamps");
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
498
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
499 arg_s = g_strdup_vprintf(format, args);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
500
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
501 if (category == NULL) {
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
502 ts_s = g_strdup("");
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
503 }
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
504 else {
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
505 /*
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
506 * If the category is not NULL, then do timestamps.
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
507 * This IS right. :)
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
508 */
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
509 if (timestamps) {
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
510 gchar mdate[64];
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
511 time_t mtime = time(NULL);
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
512
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
513 strftime(mdate, sizeof(mdate), "%H:%M:%S", localtime(&mtime));
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
514
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
515 ts_s = g_strdup_printf("(%s) ", mdate);
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
516 }
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
517 else
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
518 ts_s = g_strdup("");
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
519 }
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
520
5535
933739f789f9 [gaim-migrate @ 5935]
Nathan Walp <nwalp@pidgin.im>
parents: 5530
diff changeset
521 if (gaim_prefs_get_bool("/gaim/gtk/debug/enabled") &&
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
522 debug_win != NULL && !debug_win->paused) {
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
523
5738
ec032cb2f9ec [gaim-migrate @ 6162]
Christian Hammond <chipx86@chipx86.com>
parents: 5704
diff changeset
524 gchar *esc_s, *cat_s, *utf8_s, *s;
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
525
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
526 if (category == NULL)
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
527 cat_s = g_strdup("");
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
528 else
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
529 cat_s = g_strdup_printf("<b>%s:</b> ", category);
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
530
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
531 esc_s = g_markup_escape_text(arg_s, -1);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
532
5428
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
533 s = g_strdup_printf("<font color=\"%s\">%s%s%s</font>",
96bde36bb76b [gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents: 5314
diff changeset
534 debug_fg_colors[level], ts_s, cat_s, esc_s);
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
535
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
536 g_free(esc_s);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
537
7108
6faeeecab0dc [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7035
diff changeset
538 utf8_s = gaim_utf8_try_convert(s);
5738
ec032cb2f9ec [gaim-migrate @ 6162]
Christian Hammond <chipx86@chipx86.com>
parents: 5704
diff changeset
539 g_free(s);
ec032cb2f9ec [gaim-migrate @ 6162]
Christian Hammond <chipx86@chipx86.com>
parents: 5704
diff changeset
540 s = utf8_s;
ec032cb2f9ec [gaim-migrate @ 6162]
Christian Hammond <chipx86@chipx86.com>
parents: 5704
diff changeset
541
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
542 if (level == GAIM_DEBUG_FATAL) {
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
543 gchar *temp = s;
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
544
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
545 s = g_strdup_printf("<b>%s</b>", temp);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
546 g_free(temp);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
547 }
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
548
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
549 g_free(cat_s);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
550
6982
083d1e4a9c78 [gaim-migrate @ 7538]
Mark Doliner <mark@kingant.net>
parents: 6478
diff changeset
551 gtk_imhtml_append_text(GTK_IMHTML(debug_win->text), s, 0);
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
552
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
553 g_free(s);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
554 }
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
555
5214
7ea282e1f615 [gaim-migrate @ 5584]
Christian Hammond <chipx86@chipx86.com>
parents: 5212
diff changeset
556 if (opt_debug) {
7ea282e1f615 [gaim-migrate @ 5584]
Christian Hammond <chipx86@chipx86.com>
parents: 5212
diff changeset
557 if (category == NULL)
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
558 g_print("%s%s", ts_s, arg_s);
5214
7ea282e1f615 [gaim-migrate @ 5584]
Christian Hammond <chipx86@chipx86.com>
parents: 5212
diff changeset
559 else
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
560 g_print("%s%s: %s", ts_s, category, arg_s);
5214
7ea282e1f615 [gaim-migrate @ 5584]
Christian Hammond <chipx86@chipx86.com>
parents: 5212
diff changeset
561 }
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
562
5530
2c4c975620f0 [gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents: 5430
diff changeset
563 g_free(ts_s);
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
564 g_free(arg_s);
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
565 }
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
566
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
567 static GaimDebugUiOps ops =
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
568 {
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
569 gaim_gtk_debug_print
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
570 };
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
571
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
572 GaimDebugUiOps *
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
573 gaim_gtk_debug_get_ui_ops(void)
5212
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
574 {
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
575 return &ops;
740303e8425b [gaim-migrate @ 5582]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
576 }