Tue, 04 Feb 2014 16:30:55 +0530
Remove @file from .c files
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* pidgin |
| 5212 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
6 | * |
| 5212 | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19065
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5212 | 20 | */ |
| 9791 | 21 | #include "internal.h" |
| 15577 | 22 | #include "pidgin.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5818
diff
changeset
|
23 | |
|
9480
b4d46aa1be7d
[gaim-migrate @ 10305]
Mark Doliner <markdoliner@pidgin.im>
parents:
8953
diff
changeset
|
24 | #include "notify.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5818
diff
changeset
|
25 | #include "prefs.h" |
| 8953 | 26 | #include "request.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5818
diff
changeset
|
27 | #include "util.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5818
diff
changeset
|
28 | |
| 5212 | 29 | #include "gtkdebug.h" |
|
9709
2e73f176cc80
[gaim-migrate @ 10570]
Mark Doliner <markdoliner@pidgin.im>
parents:
9504
diff
changeset
|
30 | #include "gtkdialogs.h" |
| 8953 | 31 | #include "gtkutils.h" |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
32 | #include "gtkwebview.h" |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15882
diff
changeset
|
33 | #include "pidginstock.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5818
diff
changeset
|
34 | |
|
11473
38b35dc600ce
[gaim-migrate @ 13714]
Gary Kramlich <grim@reaperworld.com>
parents:
11450
diff
changeset
|
35 | #include <gdk/gdkkeysyms.h> |
|
38b35dc600ce
[gaim-migrate @ 13714]
Gary Kramlich <grim@reaperworld.com>
parents:
11450
diff
changeset
|
36 | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33167
diff
changeset
|
37 | #include "gtk3compat.h" |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33167
diff
changeset
|
38 | |
|
33922
61f997b47954
Split debug window HTML into a separate file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33921
diff
changeset
|
39 | #include "gtkdebug.html.h" |
|
61f997b47954
Split debug window HTML into a separate file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33921
diff
changeset
|
40 | |
| 5212 | 41 | typedef struct |
| 42 | { | |
| 43 | GtkWidget *window; | |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
44 | GtkWidget *text; |
|
33092
a68f8b2b6873
Always use GRegex in the Debug Window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33091
diff
changeset
|
45 | GtkWidget *filter; |
|
a68f8b2b6873
Always use GRegex in the Debug Window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33091
diff
changeset
|
46 | GtkWidget *expression; |
|
a68f8b2b6873
Always use GRegex in the Debug Window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33091
diff
changeset
|
47 | GtkWidget *filterlevel; |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
48 | |
|
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
49 | gboolean paused; |
| 5212 | 50 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
51 | gboolean invert; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
52 | gboolean highlight; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
53 | guint timer; |
|
30795
4fc1b7cc2e06
Use GRegex where available. Fixes #12601.
Eion Robb <eion@robbmob.com>
parents:
29747
diff
changeset
|
54 | GRegex *regex; |
| 5212 | 55 | } DebugWindow; |
| 56 | ||
| 57 | static DebugWindow *debug_win = NULL; | |
|
17232
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
58 | static guint debug_enabled_timer = 0; |
| 5212 | 59 | |
| 60 | static gint | |
| 61 | debug_window_destroy(GtkWidget *w, GdkEvent *event, void *unused) | |
| 62 | { | |
| 15884 | 63 | purple_prefs_disconnect_by_handle(pidgin_debug_get_handle()); |
|
9502
d43f69354213
[gaim-migrate @ 10329]
Mark Doliner <markdoliner@pidgin.im>
parents:
9501
diff
changeset
|
64 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
65 | if(debug_win->timer != 0) { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
66 | const gchar *text; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
67 | |
|
26753
a8dca8faae69
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
Arunan Balasubramaniam <foss@abala.me>
parents:
26482
diff
changeset
|
68 | purple_timeout_remove(debug_win->timer); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
69 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
70 | text = gtk_entry_get_text(GTK_ENTRY(debug_win->expression)); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
71 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/debug/regex", text); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
72 | } |
|
33539
12e93808f35d
Fix some warnings in debug and conv windows
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33538
diff
changeset
|
73 | if (debug_win->regex != NULL) |
|
12e93808f35d
Fix some warnings in debug and conv windows
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33538
diff
changeset
|
74 | g_regex_unref(debug_win->regex); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
75 | |
|
9502
d43f69354213
[gaim-migrate @ 10329]
Mark Doliner <markdoliner@pidgin.im>
parents:
9501
diff
changeset
|
76 | /* If the "Save Log" dialog is open then close it */ |
| 15884 | 77 | purple_request_close_with_handle(debug_win); |
|
5704
3170b0bd2b40
[gaim-migrate @ 6125]
Christian Hammond <chipx86@chipx86.com>
parents:
5684
diff
changeset
|
78 | |
| 5212 | 79 | g_free(debug_win); |
| 80 | debug_win = NULL; | |
| 81 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
82 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/enabled", FALSE); |
|
9480
b4d46aa1be7d
[gaim-migrate @ 10305]
Mark Doliner <markdoliner@pidgin.im>
parents:
8953
diff
changeset
|
83 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
84 | return FALSE; |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
85 | } |
| 5212 | 86 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
87 | static gboolean |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5738
diff
changeset
|
88 | configure_cb(GtkWidget *w, GdkEventConfigure *event, DebugWindow *win) |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
89 | { |
|
32913
af2c726febce
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32912
diff
changeset
|
90 | if (gtk_widget_get_visible(w)) { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
91 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/debug/width", event->width); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
92 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/debug/height", event->height); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
93 | } |
| 5212 | 94 | |
| 95 | return FALSE; | |
| 96 | } | |
| 97 | ||
| 8953 | 98 | static void |
|
9502
d43f69354213
[gaim-migrate @ 10329]
Mark Doliner <markdoliner@pidgin.im>
parents:
9501
diff
changeset
|
99 | save_writefile_cb(void *user_data, const char *filename) |
| 8953 | 100 | { |
|
9502
d43f69354213
[gaim-migrate @ 10329]
Mark Doliner <markdoliner@pidgin.im>
parents:
9501
diff
changeset
|
101 | DebugWindow *win = (DebugWindow *)user_data; |
|
9489
3ee8fdcdbac9
[gaim-migrate @ 10314]
Mark Doliner <markdoliner@pidgin.im>
parents:
9486
diff
changeset
|
102 | FILE *fp; |
| 8953 | 103 | char *tmp; |
| 104 | ||
|
10589
4e10236e06d4
[gaim-migrate @ 11994]
Daniel Atallah <datallah@pidgin.im>
parents:
10448
diff
changeset
|
105 | if ((fp = g_fopen(filename, "w+")) == NULL) { |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34333
diff
changeset
|
106 | purple_notify_error(win, NULL, _("Unable to open file."), NULL, NULL); |
| 8953 | 107 | return; |
|
9480
b4d46aa1be7d
[gaim-migrate @ 10305]
Mark Doliner <markdoliner@pidgin.im>
parents:
8953
diff
changeset
|
108 | } |
| 8953 | 109 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
110 | tmp = gtk_webview_get_body_text(GTK_WEBVIEW(win->text)); |
| 15884 | 111 | fprintf(fp, "Pidgin Debug Log : %s\n", purple_date_format_full(NULL)); |
| 8953 | 112 | fprintf(fp, "%s", tmp); |
| 113 | g_free(tmp); | |
| 114 | ||
| 115 | fclose(fp); | |
| 116 | } | |
| 117 | ||
| 118 | static void | |
| 119 | save_cb(GtkWidget *w, DebugWindow *win) | |
| 120 | { | |
|
21175
c6d76b49c206
disapproval of revision '8ba833993a115415727bb1b70362e0bd1603c169'
Richard Laager <rlaager@pidgin.im>
parents:
21174
diff
changeset
|
121 | purple_request_file(win, _("Save Debug Log"), "purple-debug.log", TRUE, |
|
34333
b92698241603
Request API refactoring: switch purple_request_file to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34308
diff
changeset
|
122 | G_CALLBACK(save_writefile_cb), NULL, NULL, win); |
| 8953 | 123 | } |
| 124 | ||
| 125 | static void | |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5738
diff
changeset
|
126 | clear_cb(GtkWidget *w, DebugWindow *win) |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
127 | { |
|
33919
9f3f19ab8342
Rewrite debug window clearing in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33683
diff
changeset
|
128 | gtk_webview_safe_execute_script(GTK_WEBVIEW(win->text), "clear();"); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
129 | } |
|
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
130 | |
|
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
131 | static void |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5738
diff
changeset
|
132 | pause_cb(GtkWidget *w, DebugWindow *win) |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
133 | { |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
134 | win->paused = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(w)); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
135 | |
|
33920
6a4eaacdd207
Rewrite debug window pausing in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33919
diff
changeset
|
136 | if (win->paused) |
|
6a4eaacdd207
Rewrite debug window pausing in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33919
diff
changeset
|
137 | gtk_webview_safe_execute_script(GTK_WEBVIEW(win->text), "pauseOutput();"); |
|
6a4eaacdd207
Rewrite debug window pausing in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33919
diff
changeset
|
138 | else |
|
6a4eaacdd207
Rewrite debug window pausing in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33919
diff
changeset
|
139 | gtk_webview_safe_execute_script(GTK_WEBVIEW(win->text), "resumeOutput();"); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
140 | } |
|
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
141 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
142 | /****************************************************************************** |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
143 | * regex stuff |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
144 | *****************************************************************************/ |
| 11033 | 145 | static void |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
146 | regex_clear_color(GtkWidget *w) { |
|
33924
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
147 | #if GTK_CHECK_VERSION(3,0,0) |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
148 | GtkStyleContext *context = gtk_widget_get_style_context(w); |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
149 | gtk_style_context_remove_class(context, "good-filter"); |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
150 | gtk_style_context_remove_class(context, "bad-filter"); |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
151 | #else |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
152 | gtk_widget_modify_base(w, GTK_STATE_NORMAL, NULL); |
|
33924
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
153 | #endif |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
154 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
155 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
156 | static void |
|
33924
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
157 | regex_change_color(GtkWidget *w, gboolean success) { |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
158 | #if GTK_CHECK_VERSION(3,0,0) |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
159 | GtkStyleContext *context = gtk_widget_get_style_context(w); |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
160 | |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
161 | if (success) { |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
162 | gtk_style_context_add_class(context, "good-filter"); |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
163 | gtk_style_context_remove_class(context, "bad-filter"); |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
164 | } else { |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
165 | gtk_style_context_add_class(context, "bad-filter"); |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
166 | gtk_style_context_remove_class(context, "good-filter"); |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
167 | } |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
168 | #else |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
169 | GdkColor color; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
170 | |
|
33924
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
171 | if (success) { |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
172 | color.red = 0xAFFF; |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
173 | color.green = 0xFFFF; |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
174 | color.blue = 0xAFFF; |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
175 | } else { |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
176 | color.red = 0xFFFF; |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
177 | color.green = 0xAFFF; |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
178 | color.blue = 0xAFFF; |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
179 | } |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
180 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
181 | gtk_widget_modify_base(w, GTK_STATE_NORMAL, &color); |
|
33924
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
182 | #endif |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
183 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
184 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
185 | static void |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
186 | regex_toggle_filter(DebugWindow *win, gboolean filter) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
187 | { |
|
33923
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
188 | gtk_webview_safe_execute_script(GTK_WEBVIEW(win->text), "regex.clear();"); |
|
33501
c224f6403237
Fix leaks of WebKit Lists.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33497
diff
changeset
|
189 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
190 | if (filter) { |
|
33923
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
191 | const char *text; |
|
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
192 | char *regex; |
|
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
193 | char *script; |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
194 | |
|
33923
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
195 | text = gtk_entry_get_text(GTK_ENTRY(win->expression)); |
|
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
196 | regex = gtk_webview_quote_js_string(text); |
|
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
197 | script = g_strdup_printf("regex.filterAll(%s, %s, %s);", |
|
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
198 | regex, |
|
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
199 | win->invert ? "true" : "false", |
|
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
200 | win->highlight ? "true" : "false"); |
|
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
201 | gtk_webview_safe_execute_script(GTK_WEBVIEW(win->text), script); |
|
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
202 | g_free(script); |
|
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
203 | g_free(regex); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
204 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
205 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
206 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
207 | static void |
| 15884 | 208 | regex_pref_filter_cb(const gchar *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12231
diff
changeset
|
209 | gconstpointer val, gpointer data) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
210 | { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
211 | DebugWindow *win = (DebugWindow *)data; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
212 | gboolean active = GPOINTER_TO_INT(val), current; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
213 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
214 | if (!win || !win->window) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
215 | return; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
216 | |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
217 | current = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter)); |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
218 | if (active != current) |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
219 | gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), active); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
220 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
221 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
222 | static void |
| 15884 | 223 | regex_pref_expression_cb(const gchar *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12231
diff
changeset
|
224 | gconstpointer val, gpointer data) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
225 | { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
226 | DebugWindow *win = (DebugWindow *)data; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
227 | const gchar *exp = (const gchar *)val; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
228 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
229 | gtk_entry_set_text(GTK_ENTRY(win->expression), exp); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
230 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
231 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
232 | static void |
| 15884 | 233 | regex_pref_invert_cb(const gchar *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12231
diff
changeset
|
234 | gconstpointer val, gpointer data) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
235 | { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
236 | DebugWindow *win = (DebugWindow *)data; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
237 | gboolean active = GPOINTER_TO_INT(val); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
238 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
239 | win->invert = active; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
240 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
241 | if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
242 | regex_toggle_filter(win, TRUE); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
243 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
244 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
245 | static void |
| 15884 | 246 | regex_pref_highlight_cb(const gchar *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12231
diff
changeset
|
247 | gconstpointer val, gpointer data) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
248 | { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
249 | DebugWindow *win = (DebugWindow *)data; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
250 | gboolean active = GPOINTER_TO_INT(val); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
251 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
252 | win->highlight = active; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
253 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
254 | if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
255 | regex_toggle_filter(win, TRUE); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
256 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
257 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
258 | static gboolean |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
259 | regex_timer_cb(DebugWindow *win) { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
260 | const gchar *text; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
261 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
262 | text = gtk_entry_get_text(GTK_ENTRY(win->expression)); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
263 | purple_prefs_set_string(PIDGIN_PREFS_ROOT "/debug/regex", text); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
264 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
265 | win->timer = 0; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
266 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
267 | return FALSE; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
268 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
269 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
270 | static void |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
271 | regex_changed_cb(GtkWidget *w, DebugWindow *win) { |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
272 | const gchar *text; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
273 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
274 | if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) { |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
275 | gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
276 | FALSE); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
277 | } |
| 11033 | 278 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
279 | if (win->timer == 0) |
|
26753
a8dca8faae69
A patch from Arunan Balasubramaniam to use timeouts in seconds instead of
Arunan Balasubramaniam <foss@abala.me>
parents:
26482
diff
changeset
|
280 | win->timer = purple_timeout_add_seconds(5, (GSourceFunc)regex_timer_cb, win); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
281 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
282 | text = gtk_entry_get_text(GTK_ENTRY(win->expression)); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
283 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
284 | if (text == NULL || *text == '\0') { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
285 | regex_clear_color(win->expression); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
286 | gtk_widget_set_sensitive(win->filter, FALSE); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
287 | return; |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
288 | } |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
289 | |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
290 | if (win->regex) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
291 | g_regex_unref(win->regex); |
|
33923
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
292 | #if GLIB_CHECK_VERSION(2,34,0) |
|
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
293 | win->regex = g_regex_new(text, G_REGEX_CASELESS|G_REGEX_JAVASCRIPT_COMPAT, 0, NULL); |
|
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
294 | #else |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
295 | win->regex = g_regex_new(text, G_REGEX_CASELESS, 0, NULL); |
|
33923
0fcc5635daba
Rewrite debug window filter in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33922
diff
changeset
|
296 | #endif |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
297 | if (win->regex == NULL) { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
298 | /* failed to compile */ |
|
33924
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
299 | regex_change_color(win->expression, FALSE); |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
300 | gtk_widget_set_sensitive(win->filter, FALSE); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
301 | } else { |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
302 | /* compiled successfully */ |
|
33924
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
303 | regex_change_color(win->expression, TRUE); |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
304 | gtk_widget_set_sensitive(win->filter, TRUE); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
305 | } |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
306 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
307 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
308 | static void |
|
11450
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
309 | regex_key_release_cb(GtkWidget *w, GdkEventKey *e, DebugWindow *win) { |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
310 | if(e->keyval == GDK_KEY_Return && |
|
32913
af2c726febce
Fix all deprecated GTK_WIDGET_* macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32912
diff
changeset
|
311 | gtk_widget_is_sensitive(win->filter) && |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
312 | !gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(win->filter))) |
|
11450
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
313 | { |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
314 | gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), TRUE); |
|
11450
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
315 | } |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
316 | } |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
317 | |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
318 | static void |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
319 | regex_menu_cb(GtkWidget *item, const gchar *pref) { |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
320 | gboolean active; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
321 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
322 | active = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
323 | |
| 15884 | 324 | purple_prefs_set_bool(pref, active); |
| 11033 | 325 | } |
| 326 | ||
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
327 | static void |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
328 | regex_popup_cb(GtkEntry *entry, GtkWidget *menu, DebugWindow *win) { |
| 15568 | 329 | pidgin_separator(menu); |
| 330 | pidgin_new_check_item(menu, _("Invert"), | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
331 | G_CALLBACK(regex_menu_cb), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
332 | PIDGIN_PREFS_ROOT "/debug/invert", win->invert); |
| 15568 | 333 | pidgin_new_check_item(menu, _("Highlight matches"), |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
334 | G_CALLBACK(regex_menu_cb), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
335 | PIDGIN_PREFS_ROOT "/debug/highlight", win->highlight); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
336 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
337 | |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
338 | static void |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
339 | regex_filter_toggled_cb(GtkToggleToolButton *button, DebugWindow *win) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
340 | { |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
341 | gboolean active; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
342 | |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
343 | active = gtk_toggle_tool_button_get_active(button); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
344 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
345 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/filter", active); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
346 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
347 | if (!GTK_IS_WEBVIEW(win->text)) |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
348 | return; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
349 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
350 | regex_toggle_filter(win, active); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
351 | } |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
352 | |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
353 | static void |
| 15884 | 354 | filter_level_pref_changed(const char *name, PurplePrefType type, gconstpointer value, gpointer data) |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
355 | { |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
356 | DebugWindow *win = data; |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
357 | int level = GPOINTER_TO_INT(value); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
358 | char *tmp; |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
359 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
360 | if (level != gtk_combo_box_get_active(GTK_COMBO_BOX(win->filterlevel))) |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
361 | gtk_combo_box_set_active(GTK_COMBO_BOX(win->filterlevel), level); |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
362 | |
|
33921
d1e2fdbc3d56
Rewrite debug window filtering in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33920
diff
changeset
|
363 | tmp = g_strdup_printf("setFilterLevel('%d');", level); |
|
d1e2fdbc3d56
Rewrite debug window filtering in JS.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33920
diff
changeset
|
364 | gtk_webview_safe_execute_script(GTK_WEBVIEW(win->text), tmp); |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
365 | g_free(tmp); |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
366 | } |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
367 | |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
368 | static void |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
369 | filter_level_changed_cb(GtkWidget *combo, gpointer null) |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
370 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
371 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/debug/filterlevel", |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
372 | gtk_combo_box_get_active(GTK_COMBO_BOX(combo))); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
373 | } |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
374 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
375 | static void |
| 15884 | 376 | toolbar_style_pref_changed_cb(const char *name, PurplePrefType type, gconstpointer value, gpointer data) |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
377 | { |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
378 | gtk_toolbar_set_style(GTK_TOOLBAR(data), GPOINTER_TO_INT(value)); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
379 | } |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
380 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
381 | static void |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
382 | toolbar_icon_pref_changed(GtkWidget *item, GtkWidget *toolbar) |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
383 | { |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
384 | int style = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(item), "user_data")); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
385 | purple_prefs_set_int(PIDGIN_PREFS_ROOT "/debug/style", style); |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
386 | } |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
387 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
388 | static gboolean |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
389 | toolbar_context(GtkWidget *toolbar, GdkEventButton *event, gpointer null) |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
390 | { |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
391 | GtkWidget *menu, *item; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
392 | const char *text[3]; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
393 | GtkToolbarStyle value[3]; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
394 | int i; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
395 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
396 | if (!(event->button == 3 && event->type == GDK_BUTTON_PRESS)) |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
397 | return FALSE; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
398 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
399 | text[0] = _("_Icon Only"); value[0] = GTK_TOOLBAR_ICONS; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
400 | text[1] = _("_Text Only"); value[1] = GTK_TOOLBAR_TEXT; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
401 | text[2] = _("_Both Icon & Text"); value[2] = GTK_TOOLBAR_BOTH_HORIZ; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
402 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
403 | menu = gtk_menu_new(); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
404 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
405 | for (i = 0; i < 3; i++) { |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
406 | item = gtk_check_menu_item_new_with_mnemonic(text[i]); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
407 | g_object_set_data(G_OBJECT(item), "user_data", GINT_TO_POINTER(value[i])); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
408 | g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(toolbar_icon_pref_changed), toolbar); |
|
34308
cdb187c27360
Fix the rest of Pidgin's warnings about -Wsign-compare; remove -Wno-sign-compare from cflags
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34274
diff
changeset
|
409 | if (value[i] == (GtkToolbarStyle)purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/style")) |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
410 | gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), TRUE); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
411 | gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
412 | } |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
413 | |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
414 | gtk_widget_show_all(menu); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
415 | |
|
33110
a2923f41d05a
We have the exact button and event time to use here.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33095
diff
changeset
|
416 | gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 3, event->time); |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
417 | return FALSE; |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
418 | } |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
419 | |
| 5212 | 420 | static DebugWindow * |
| 421 | debug_window_new(void) | |
| 422 | { | |
| 423 | DebugWindow *win; | |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
424 | GtkWidget *vbox; |
|
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
425 | GtkWidget *toolbar; |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
10087
diff
changeset
|
426 | GtkWidget *frame; |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
427 | gint width, height; |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
428 | void *handle; |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
429 | GtkToolItem *item; |
|
33929
014800693d22
Fix compilation for GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33925
diff
changeset
|
430 | #if GTK_CHECK_VERSION(3,0,0) |
|
33924
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
431 | GtkStyleContext *context; |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
432 | GtkCssProvider *filter_css; |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
433 | const gchar filter_style[] = |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
434 | ".bad-filter {" |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
435 | "color: @error_fg_color;" |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
436 | "text-shadow: 0 1px @error_text_shadow;" |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
437 | "background-image: none;" |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
438 | "background-color: @error_bg_color;" |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
439 | "}" |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
440 | ".good-filter {" |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
441 | "color: @question_fg_color;" |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
442 | "text-shadow: 0 1px @question_text_shadow;" |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
443 | "background-image: none;" |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
444 | "background-color: @success_color;" |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
445 | "}"; |
|
33929
014800693d22
Fix compilation for GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33925
diff
changeset
|
446 | #endif |
| 5212 | 447 | |
| 448 | win = g_new0(DebugWindow, 1); | |
| 449 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
450 | width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/width"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
451 | height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/height"); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
452 | |
|
29321
c089a3e0092e
De-dialogify the file-transfer and debug windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29287
diff
changeset
|
453 | win->window = pidgin_create_window(_("Debug Window"), 0, "debug", TRUE); |
| 15884 | 454 | purple_debug_info("gtkdebug", "Setting dimensions to %d, %d\n", |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
455 | width, height); |
|
5642
d7b8b62542a3
[gaim-migrate @ 6056]
Christian Hammond <chipx86@chipx86.com>
parents:
5636
diff
changeset
|
456 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
457 | gtk_window_set_default_size(GTK_WINDOW(win->window), width, height); |
| 5212 | 458 | |
| 459 | g_signal_connect(G_OBJECT(win->window), "delete_event", | |
| 11033 | 460 | G_CALLBACK(debug_window_destroy), NULL); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
461 | g_signal_connect(G_OBJECT(win->window), "configure_event", |
| 11033 | 462 | G_CALLBACK(configure_cb), win); |
| 5212 | 463 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
464 | handle = pidgin_debug_get_handle(); |
|
22099
8e70e3ba6096
Modified patch from Gabriel (Sylar?) Schulof to deprecate PIDGIN_DIALOG. Closes #4535. (PS: I am aware of --author).
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21743
diff
changeset
|
465 | |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
466 | /* Setup the vbox */ |
|
29321
c089a3e0092e
De-dialogify the file-transfer and debug windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29287
diff
changeset
|
467 | vbox = gtk_vbox_new(FALSE, 0); |
|
c089a3e0092e
De-dialogify the file-transfer and debug windows.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29287
diff
changeset
|
468 | gtk_container_add(GTK_CONTAINER(win->window), vbox); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
469 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
470 | if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/toolbar")) { |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
471 | /* Setup our top button bar thingie. */ |
|
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
472 | toolbar = gtk_toolbar_new(); |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
473 | gtk_toolbar_set_show_arrow(GTK_TOOLBAR(toolbar), TRUE); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
474 | g_signal_connect(G_OBJECT(toolbar), "button-press-event", G_CALLBACK(toolbar_context), win); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
475 | |
| 11033 | 476 | gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
477 | purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/style")); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
478 | purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/style", |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
479 | toolbar_style_pref_changed_cb, toolbar); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
480 | gtk_toolbar_set_icon_size(GTK_TOOLBAR(toolbar), |
| 11033 | 481 | GTK_ICON_SIZE_SMALL_TOOLBAR); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
482 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
483 | gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
484 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
485 | /* Save */ |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
486 | item = gtk_tool_button_new_from_stock(GTK_STOCK_SAVE); |
|
29747
4256b05bd720
Set debug window tool items to be "important" so that they show text when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29746
diff
changeset
|
487 | gtk_tool_item_set_is_important(item, TRUE); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
488 | gtk_tool_item_set_tooltip_text(item, _("Save")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
489 | g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(save_cb), win); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
490 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
491 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
492 | /* Clear button */ |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
493 | item = gtk_tool_button_new_from_stock(GTK_STOCK_CLEAR); |
|
29747
4256b05bd720
Set debug window tool items to be "important" so that they show text when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29746
diff
changeset
|
494 | gtk_tool_item_set_is_important(item, TRUE); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
495 | gtk_tool_item_set_tooltip_text(item, _("Clear")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
496 | g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(clear_cb), win); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
497 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
498 | |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
499 | item = gtk_separator_tool_item_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
500 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
501 | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
502 | /* Pause */ |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
503 | item = gtk_toggle_tool_button_new_from_stock(PIDGIN_STOCK_PAUSE); |
|
29747
4256b05bd720
Set debug window tool items to be "important" so that they show text when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29746
diff
changeset
|
504 | gtk_tool_item_set_is_important(item, TRUE); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
505 | gtk_tool_item_set_tooltip_text(item, _("Pause")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
506 | g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(pause_cb), win); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
507 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
508 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
509 | /* regex stuff */ |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
510 | item = gtk_separator_tool_item_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
511 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
| 11033 | 512 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
513 | /* regex toggle button */ |
|
29747
4256b05bd720
Set debug window tool items to be "important" so that they show text when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29746
diff
changeset
|
514 | item = gtk_toggle_tool_button_new_from_stock(GTK_STOCK_FIND); |
|
4256b05bd720
Set debug window tool items to be "important" so that they show text when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29746
diff
changeset
|
515 | gtk_tool_item_set_is_important(item, TRUE); |
|
4256b05bd720
Set debug window tool items to be "important" so that they show text when
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29746
diff
changeset
|
516 | win->filter = GTK_WIDGET(item); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
517 | gtk_tool_button_set_label(GTK_TOOL_BUTTON(win->filter), _("Filter")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
518 | gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(win->filter), _("Filter")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
519 | g_signal_connect(G_OBJECT(win->filter), "clicked", G_CALLBACK(regex_filter_toggled_cb), win); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
520 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(win->filter)); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
521 | |
|
11450
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
522 | /* we purposely disable the toggle button here in case |
| 15884 | 523 | * /purple/gtk/debug/expression has an empty string. If it does not have |
|
11450
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
524 | * an empty string, the change signal will get called and make the |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
525 | * toggle button sensitive. |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
526 | */ |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
527 | gtk_widget_set_sensitive(win->filter, FALSE); |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
528 | gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
529 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/filter")); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
530 | purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/filter", |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
531 | regex_pref_filter_cb, win); |
| 8953 | 532 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
533 | /* regex entry */ |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
534 | win->expression = gtk_entry_new(); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
535 | item = gtk_tool_item_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
536 | gtk_widget_set_tooltip_text(win->expression, _("Right click for more options.")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
537 | gtk_container_add(GTK_CONTAINER(item), GTK_WIDGET(win->expression)); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
538 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
539 | |
|
33929
014800693d22
Fix compilation for GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33925
diff
changeset
|
540 | #if GTK_CHECK_VERSION(3,0,0) |
|
33924
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
541 | filter_css = gtk_css_provider_new(); |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
542 | gtk_css_provider_load_from_data(filter_css, filter_style, -1, NULL); |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
543 | context = gtk_widget_get_style_context(win->expression); |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
544 | gtk_style_context_add_provider(context, |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
545 | GTK_STYLE_PROVIDER(filter_css), |
|
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
546 | GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); |
|
33929
014800693d22
Fix compilation for GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33925
diff
changeset
|
547 | #endif |
|
33924
788678d2e035
Fix background change in IP and debug filter entries.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33923
diff
changeset
|
548 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
549 | /* this needs to be before the text is set from the pref if we want it |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
550 | * to colorize a stored expression. |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
551 | */ |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
552 | g_signal_connect(G_OBJECT(win->expression), "changed", |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
553 | G_CALLBACK(regex_changed_cb), win); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
554 | gtk_entry_set_text(GTK_ENTRY(win->expression), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
555 | purple_prefs_get_string(PIDGIN_PREFS_ROOT "/debug/regex")); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
556 | g_signal_connect(G_OBJECT(win->expression), "populate-popup", |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
557 | G_CALLBACK(regex_popup_cb), win); |
|
11450
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
558 | g_signal_connect(G_OBJECT(win->expression), "key-release-event", |
|
52e566659430
[gaim-migrate @ 13689]
Gary Kramlich <grim@reaperworld.com>
parents:
11312
diff
changeset
|
559 | G_CALLBACK(regex_key_release_cb), win); |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
560 | purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/regex", |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
561 | regex_pref_expression_cb, win); |
| 11033 | 562 | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
563 | /* connect the rest of our pref callbacks */ |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
564 | win->invert = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/invert"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
565 | purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/invert", |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
566 | regex_pref_invert_cb, win); |
| 11033 | 567 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
568 | win->highlight = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/highlight"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
569 | purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/highlight", |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
570 | regex_pref_highlight_cb, win); |
|
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
571 | |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
572 | item = gtk_separator_tool_item_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
573 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
574 | |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
575 | item = gtk_tool_item_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
576 | gtk_container_add(GTK_CONTAINER(item), gtk_label_new(_("Level "))); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
577 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
578 | |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
579 | win->filterlevel = gtk_combo_box_text_new(); |
|
29745
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
580 | item = gtk_tool_item_new(); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
581 | gtk_widget_set_tooltip_text(win->filterlevel, _("Select the debug filter level.")); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
582 | gtk_container_add(GTK_CONTAINER(item), win->filterlevel); |
|
ebf70b1934f1
New-fangled toolbar code and all that.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29694
diff
changeset
|
583 | gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
|
29746
f7a7722bee2f
Remove GTK_CHECK_VERSION(2,4,0) checks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29745
diff
changeset
|
584 | |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
585 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(win->filterlevel), _("All")); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
586 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(win->filterlevel), _("Misc")); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
587 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(win->filterlevel), _("Info")); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
588 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(win->filterlevel), _("Warning")); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
589 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(win->filterlevel), _("Error ")); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
590 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(win->filterlevel), _("Fatal Error")); |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
591 | gtk_combo_box_set_active(GTK_COMBO_BOX(win->filterlevel), |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
592 | purple_prefs_get_int(PIDGIN_PREFS_ROOT "/debug/filterlevel")); |
|
33092
a68f8b2b6873
Always use GRegex in the Debug Window.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33091
diff
changeset
|
593 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
594 | purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/filterlevel", |
|
14541
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
595 | filter_level_pref_changed, win); |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
596 | g_signal_connect(G_OBJECT(win->filterlevel), "changed", |
|
b4b96a041230
[gaim-migrate @ 17198]
Peter McCurdy <cpirate@users.sourceforge.net>
parents:
14253
diff
changeset
|
597 | G_CALLBACK(filter_level_changed_cb), NULL); |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
598 | } |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
599 | |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
600 | /* Add the gtkwebview */ |
|
34274
9169710b5af5
Hide GtkWebViewToolbar stuff within the GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33934
diff
changeset
|
601 | frame = pidgin_create_webview(FALSE, &win->text, NULL); |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
602 | gtk_webview_set_format_functions(GTK_WEBVIEW(win->text), |
|
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
603 | GTK_WEBVIEW_ALL ^ GTK_WEBVIEW_SMILEY ^ GTK_WEBVIEW_IMAGE); |
|
33922
61f997b47954
Split debug window HTML into a separate file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33921
diff
changeset
|
604 | gtk_webview_load_html_string(GTK_WEBVIEW(win->text), gtkdebug_html); |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
10087
diff
changeset
|
605 | gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
|
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
10087
diff
changeset
|
606 | gtk_widget_show(frame); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
607 | |
|
33111
e05551721abf
Obey the filter level when the Debug Window is first opened.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33110
diff
changeset
|
608 | clear_cb(NULL, win); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
609 | |
| 5212 | 610 | gtk_widget_show_all(win->window); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
611 | |
| 5212 | 612 | return win; |
| 613 | } | |
| 614 | ||
|
17232
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
615 | static gboolean |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
616 | debug_enabled_timeout_cb(gpointer data) |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
617 | { |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
618 | debug_enabled_timer = 0; |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
619 | |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
620 | if (data) |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
621 | pidgin_debug_window_show(); |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
622 | else |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
623 | pidgin_debug_window_hide(); |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
624 | |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
625 | return FALSE; |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
626 | } |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
627 | |
|
5625
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
628 | static void |
| 15884 | 629 | debug_enabled_cb(const char *name, PurplePrefType type, |
|
12816
5f93e09fa9a6
[gaim-migrate @ 15164]
Mark Doliner <markdoliner@pidgin.im>
parents:
12231
diff
changeset
|
630 | gconstpointer value, gpointer data) |
|
5625
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
631 | { |
|
17232
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
632 | debug_enabled_timer = g_timeout_add(0, debug_enabled_timeout_cb, GINT_TO_POINTER(GPOINTER_TO_INT(value))); |
|
5625
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
633 | } |
|
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
634 | |
| 7150 | 635 | static void |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
636 | pidgin_glib_log_handler(const gchar *domain, GLogLevelFlags flags, |
| 7150 | 637 | const gchar *msg, gpointer user_data) |
| 638 | { | |
| 15884 | 639 | PurpleDebugLevel level; |
| 7150 | 640 | char *new_msg = NULL; |
| 641 | char *new_domain = NULL; | |
| 642 | ||
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
643 | if ((flags & G_LOG_LEVEL_ERROR) == G_LOG_LEVEL_ERROR) |
| 15884 | 644 | level = PURPLE_DEBUG_ERROR; |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
645 | else if ((flags & G_LOG_LEVEL_CRITICAL) == G_LOG_LEVEL_CRITICAL) |
| 15884 | 646 | level = PURPLE_DEBUG_FATAL; |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
647 | else if ((flags & G_LOG_LEVEL_WARNING) == G_LOG_LEVEL_WARNING) |
| 15884 | 648 | level = PURPLE_DEBUG_WARNING; |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
649 | else if ((flags & G_LOG_LEVEL_MESSAGE) == G_LOG_LEVEL_MESSAGE) |
| 15884 | 650 | level = PURPLE_DEBUG_INFO; |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
651 | else if ((flags & G_LOG_LEVEL_INFO) == G_LOG_LEVEL_INFO) |
| 15884 | 652 | level = PURPLE_DEBUG_INFO; |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
653 | else if ((flags & G_LOG_LEVEL_DEBUG) == G_LOG_LEVEL_DEBUG) |
| 15884 | 654 | level = PURPLE_DEBUG_MISC; |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
655 | else |
|
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
656 | { |
| 15884 | 657 | purple_debug_warning("gtkdebug", |
| 7150 | 658 | "Unknown glib logging level in %d\n", flags); |
| 659 | ||
| 15884 | 660 | level = PURPLE_DEBUG_MISC; /* This will never happen. */ |
| 7150 | 661 | } |
| 662 | ||
| 663 | if (msg != NULL) | |
| 15884 | 664 | new_msg = purple_utf8_try_convert(msg); |
| 7150 | 665 | |
| 666 | if (domain != NULL) | |
| 15884 | 667 | new_domain = purple_utf8_try_convert(domain); |
| 7150 | 668 | |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
669 | if (new_msg != NULL) |
|
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
670 | { |
| 15884 | 671 | purple_debug(level, (new_domain != NULL ? new_domain : "g_log"), |
|
7152
112d0e52d04b
[gaim-migrate @ 7719]
Christian Hammond <chipx86@chipx86.com>
parents:
7150
diff
changeset
|
672 | "%s\n", new_msg); |
| 7150 | 673 | |
| 674 | g_free(new_msg); | |
| 675 | } | |
| 676 | ||
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13988
diff
changeset
|
677 | g_free(new_domain); |
| 7150 | 678 | } |
| 679 | ||
| 680 | #ifdef _WIN32 | |
| 681 | static void | |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
682 | pidgin_glib_dummy_print_handler(const gchar *string) |
| 7150 | 683 | { |
| 684 | } | |
| 685 | #endif | |
| 686 | ||
|
5625
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
687 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
688 | pidgin_debug_init(void) |
|
5625
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
689 | { |
| 5684 | 690 | /* Debug window preferences. */ |
| 691 | /* | |
| 692 | * NOTE: This must be set before prefs are loaded, and the callbacks | |
| 693 | * set after they are loaded, since prefs sets the enabled | |
| 694 | * preference here and that loads the window, which calls the | |
|
8735
01248ea222d3
[gaim-migrate @ 9490]
Jonathan Champ <royanee@users.sourceforge.net>
parents:
8046
diff
changeset
|
695 | * configure event, which overrides the width and height! :P |
| 5684 | 696 | */ |
| 697 | ||
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
698 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/debug"); |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
699 | |
|
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
700 | /* Controls printing to the debug window */ |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
701 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/enabled", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
702 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/filterlevel", PURPLE_DEBUG_ALL); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
703 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/style", GTK_TOOLBAR_BOTH_HORIZ); |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
704 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
705 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/toolbar", TRUE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
706 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/width", 450); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
707 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/debug/height", 250); |
| 5684 | 708 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
709 | purple_prefs_add_string(PIDGIN_PREFS_ROOT "/debug/regex", ""); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
710 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/filter", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
711 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/invert", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
712 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/case_insensitive", FALSE); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
713 | purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/debug/highlight", FALSE); |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11243
diff
changeset
|
714 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
715 | purple_prefs_connect_callback(NULL, PIDGIN_PREFS_ROOT "/debug/enabled", |
|
5794
ebdbb7dc6658
[gaim-migrate @ 6219]
Christian Hammond <chipx86@chipx86.com>
parents:
5738
diff
changeset
|
716 | debug_enabled_cb, NULL); |
| 7150 | 717 | |
| 718 | #define REGISTER_G_LOG_HANDLER(name) \ | |
| 719 | g_log_set_handler((name), G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL \ | |
| 720 | | G_LOG_FLAG_RECURSION, \ | |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
721 | pidgin_glib_log_handler, NULL) |
| 7150 | 722 | |
| 723 | /* Register the glib/gtk log handlers. */ | |
| 724 | REGISTER_G_LOG_HANDLER(NULL); | |
| 725 | REGISTER_G_LOG_HANDLER("Gdk"); | |
| 726 | REGISTER_G_LOG_HANDLER("Gtk"); | |
|
7229
0f85b503c030
[gaim-migrate @ 7799]
Herman Bloggs <herman@bluedigits.com>
parents:
7152
diff
changeset
|
727 | REGISTER_G_LOG_HANDLER("GdkPixbuf"); |
| 7150 | 728 | REGISTER_G_LOG_HANDLER("GLib"); |
| 729 | REGISTER_G_LOG_HANDLER("GModule"); | |
| 730 | REGISTER_G_LOG_HANDLER("GLib-GObject"); | |
| 731 | REGISTER_G_LOG_HANDLER("GThread"); | |
|
33532
66962f44ff47
Add JSON debug messages to our log
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33501
diff
changeset
|
732 | REGISTER_G_LOG_HANDLER("Json"); |
|
21743
7a0caaf628ff
applied changes from 10f341962a83e2380243c4e44bb685105e3091a2
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21630
diff
changeset
|
733 | #ifdef USE_GSTREAMER |
|
7a0caaf628ff
applied changes from 10f341962a83e2380243c4e44bb685105e3091a2
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21630
diff
changeset
|
734 | REGISTER_G_LOG_HANDLER("GStreamer"); |
|
7a0caaf628ff
applied changes from 10f341962a83e2380243c4e44bb685105e3091a2
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21630
diff
changeset
|
735 | #endif |
| 7150 | 736 | |
| 737 | #ifdef _WIN32 | |
| 15884 | 738 | if (!purple_debug_is_enabled()) |
|
15880
d275b025481c
More Gaim to Pidgin changes
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
739 | g_set_print_handler(pidgin_glib_dummy_print_handler); |
| 7150 | 740 | #endif |
|
5625
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
741 | } |
|
ac8c09def58a
[gaim-migrate @ 6032]
Christian Hammond <chipx86@chipx86.com>
parents:
5535
diff
changeset
|
742 | |
| 5212 | 743 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
744 | pidgin_debug_uninit(void) |
| 11033 | 745 | { |
| 15884 | 746 | purple_debug_set_ui_ops(NULL); |
|
17232
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
747 | |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
748 | if (debug_enabled_timer != 0) |
|
8593d66c708b
When the /pidgin/debug/enabled pref is toggled, wait until the next
Mark Doliner <markdoliner@pidgin.im>
parents:
17040
diff
changeset
|
749 | g_source_remove(debug_enabled_timer); |
| 11033 | 750 | } |
| 751 | ||
| 752 | void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
753 | pidgin_debug_window_show(void) |
| 5212 | 754 | { |
| 755 | if (debug_win == NULL) | |
| 756 | debug_win = debug_window_new(); | |
| 757 | ||
| 758 | gtk_widget_show(debug_win->window); | |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
759 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
760 | purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/enabled", TRUE); |
| 5212 | 761 | } |
| 762 | ||
| 763 | void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
764 | pidgin_debug_window_hide(void) |
| 5212 | 765 | { |
| 766 | if (debug_win != NULL) { | |
| 767 | gtk_widget_destroy(debug_win->window); | |
| 768 | debug_window_destroy(NULL, NULL, NULL); | |
| 769 | } | |
| 770 | } | |
| 771 | ||
| 772 | static void | |
| 15884 | 773 | pidgin_debug_print(PurpleDebugLevel level, const char *category, |
|
33537
4998e86453d0
GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33532
diff
changeset
|
774 | const char *arg_s) |
| 5212 | 775 | { |
|
33537
4998e86453d0
GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33532
diff
changeset
|
776 | gchar *esc_s; |
|
17040
cb33027a36e4
Force timestamps always on for debug log and debug window. Making this
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16752
diff
changeset
|
777 | const char *mdate; |
|
cb33027a36e4
Force timestamps always on for debug log and debug window. Making this
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16752
diff
changeset
|
778 | time_t mtime; |
|
33537
4998e86453d0
GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33532
diff
changeset
|
779 | gchar *js; |
|
5530
ba1ad464b56f
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5430
diff
changeset
|
780 | |
|
33537
4998e86453d0
GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33532
diff
changeset
|
781 | if (debug_win == NULL) |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
782 | return; |
|
33537
4998e86453d0
GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33532
diff
changeset
|
783 | if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")) |
|
4998e86453d0
GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33532
diff
changeset
|
784 | return; |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
785 | |
|
17040
cb33027a36e4
Force timestamps always on for debug log and debug window. Making this
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16752
diff
changeset
|
786 | mtime = time(NULL); |
|
cb33027a36e4
Force timestamps always on for debug log and debug window. Making this
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16752
diff
changeset
|
787 | mdate = purple_utf8_strftime("%H:%M:%S", localtime(&mtime)); |
| 5212 | 788 | |
|
33537
4998e86453d0
GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33532
diff
changeset
|
789 | esc_s = purple_escape_js(arg_s); |
|
5428
5788d3bc050a
[gaim-migrate @ 5808]
Christian Hammond <chipx86@chipx86.com>
parents:
5314
diff
changeset
|
790 | |
|
33538
cbeb76707f12
Better implementation of purple_escape_js
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33537
diff
changeset
|
791 | js = g_strdup_printf("append(%d, '%s', '%s', %s);", |
|
33537
4998e86453d0
GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33532
diff
changeset
|
792 | level, mdate, category ? category : "", esc_s); |
|
10307
f3ba80364053
[gaim-migrate @ 11497]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
793 | g_free(esc_s); |
| 5212 | 794 | |
|
33537
4998e86453d0
GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33532
diff
changeset
|
795 | gtk_webview_safe_execute_script(GTK_WEBVIEW(debug_win->text), js); |
|
4998e86453d0
GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33532
diff
changeset
|
796 | g_free(js); |
| 5212 | 797 | } |
| 798 | ||
|
16044
257072807aa8
Add a whimpy ui op to the debug API that returns TRUE if debugging
Mark Doliner <markdoliner@pidgin.im>
parents:
15931
diff
changeset
|
799 | static gboolean |
|
257072807aa8
Add a whimpy ui op to the debug API that returns TRUE if debugging
Mark Doliner <markdoliner@pidgin.im>
parents:
15931
diff
changeset
|
800 | pidgin_debug_is_enabled(PurpleDebugLevel level, const char *category) |
|
257072807aa8
Add a whimpy ui op to the debug API that returns TRUE if debugging
Mark Doliner <markdoliner@pidgin.im>
parents:
15931
diff
changeset
|
801 | { |
|
16045
d9add5eda4cd
Check if debug_win is != NULL before checking the preference. This
Mark Doliner <markdoliner@pidgin.im>
parents:
16044
diff
changeset
|
802 | return (debug_win != NULL && |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16045
diff
changeset
|
803 | purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")); |
|
16044
257072807aa8
Add a whimpy ui op to the debug API that returns TRUE if debugging
Mark Doliner <markdoliner@pidgin.im>
parents:
15931
diff
changeset
|
804 | } |
|
257072807aa8
Add a whimpy ui op to the debug API that returns TRUE if debugging
Mark Doliner <markdoliner@pidgin.im>
parents:
15931
diff
changeset
|
805 | |
| 15884 | 806 | static PurpleDebugUiOps ops = |
| 5212 | 807 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
808 | pidgin_debug_print, |
|
16752
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
809 | pidgin_debug_is_enabled, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
810 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
811 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
812 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16490
diff
changeset
|
813 | NULL |
| 5212 | 814 | }; |
| 815 | ||
| 15884 | 816 | PurpleDebugUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
817 | pidgin_debug_get_ui_ops(void) |
| 5212 | 818 | { |
| 819 | return &ops; | |
| 820 | } | |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
821 | |
|
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
822 | void * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15512
diff
changeset
|
823 | pidgin_debug_get_handle() { |
|
10087
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
824 | static int handle; |
|
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
825 | |
|
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
826 | return &handle; |
|
e5b80a38939d
[gaim-migrate @ 11098]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
9791
diff
changeset
|
827 | } |
|
33095
1e0b4fac0fed
Convert the Debug Window to a GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33094
diff
changeset
|
828 |