Mercurial > pidgin.yaz
comparison console/gntdebug.c @ 14861:dd2ef00759a7
[gaim-migrate @ 17630]
Remember the size of the debug window, and remember the correct size of the conversation windows after resizing.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Mon, 30 Oct 2006 21:48:42 +0000 |
parents | 8d1a1a6c57d9 |
children | c01f62c83647 |
comparison
equal
deleted
inserted
replaced
14860:50f5099daab1 | 14861:dd2ef00759a7 |
---|---|
33 #include "gntgaim.h" | 33 #include "gntgaim.h" |
34 #include "util.h" | 34 #include "util.h" |
35 | 35 |
36 #include <stdio.h> | 36 #include <stdio.h> |
37 #include <string.h> | 37 #include <string.h> |
38 | |
39 #define PREF_ROOT "/gaim/gnt/debug" | |
38 | 40 |
39 static struct | 41 static struct |
40 { | 42 { |
41 GntWidget *window; | 43 GntWidget *window; |
42 GntWidget *tview; | 44 GntWidget *tview; |
189 } | 191 } |
190 | 192 |
191 g_free(new_domain); | 193 g_free(new_domain); |
192 } | 194 } |
193 | 195 |
196 static void | |
197 size_changed_cb(GntWidget *widget, int oldw, int oldh) | |
198 { | |
199 int w, h; | |
200 gnt_widget_get_size(widget, &w, &h); | |
201 gaim_prefs_set_int(PREF_ROOT "/size/width", w); | |
202 gaim_prefs_set_int(PREF_ROOT "/size/height", h); | |
203 } | |
204 | |
194 void gg_debug_window_show() | 205 void gg_debug_window_show() |
195 { | 206 { |
196 debug.paused = FALSE; | 207 debug.paused = FALSE; |
197 debug.timestamps = gaim_prefs_get_bool("/core/debug/timestamps"); | 208 debug.timestamps = gaim_prefs_get_bool("/core/debug/timestamps"); |
198 if (debug.window == NULL) | 209 if (debug.window == NULL) |
204 gnt_box_set_pad(GNT_BOX(debug.window), 0); | 215 gnt_box_set_pad(GNT_BOX(debug.window), 0); |
205 gnt_box_set_alignment(GNT_BOX(debug.window), GNT_ALIGN_MID); | 216 gnt_box_set_alignment(GNT_BOX(debug.window), GNT_ALIGN_MID); |
206 | 217 |
207 debug.tview = gnt_text_view_new(); | 218 debug.tview = gnt_text_view_new(); |
208 gnt_box_add_widget(GNT_BOX(debug.window), debug.tview); | 219 gnt_box_add_widget(GNT_BOX(debug.window), debug.tview); |
220 gnt_widget_set_size(debug.tview, | |
221 gaim_prefs_get_int(PREF_ROOT "/size/width"), | |
222 gaim_prefs_get_int(PREF_ROOT "/size/height")); | |
223 g_signal_connect(G_OBJECT(debug.tview), "size_changed", G_CALLBACK(size_changed_cb), NULL); | |
209 | 224 |
210 gnt_box_add_widget(GNT_BOX(debug.window), gnt_line_new(FALSE)); | 225 gnt_box_add_widget(GNT_BOX(debug.window), gnt_line_new(FALSE)); |
211 | 226 |
212 box = gnt_hbox_new(FALSE); | 227 box = gnt_hbox_new(FALSE); |
213 gnt_box_set_alignment(GNT_BOX(box), GNT_ALIGN_MID); | 228 gnt_box_set_alignment(GNT_BOX(box), GNT_ALIGN_MID); |
266 REGISTER_G_LOG_HANDLER("GModule"); | 281 REGISTER_G_LOG_HANDLER("GModule"); |
267 REGISTER_G_LOG_HANDLER("GLib-GObject"); | 282 REGISTER_G_LOG_HANDLER("GLib-GObject"); |
268 REGISTER_G_LOG_HANDLER("GThread"); | 283 REGISTER_G_LOG_HANDLER("GThread"); |
269 | 284 |
270 g_set_print_handler(print_stderr); /* Redirect the debug messages to stderr */ | 285 g_set_print_handler(print_stderr); /* Redirect the debug messages to stderr */ |
286 | |
287 gaim_prefs_add_none(PREF_ROOT); | |
288 gaim_prefs_add_none(PREF_ROOT "/size"); | |
289 gaim_prefs_add_int(PREF_ROOT "/size/width", 60); | |
290 gaim_prefs_add_int(PREF_ROOT "/size/height", 15); | |
291 | |
271 if (gaim_debug_is_enabled()) | 292 if (gaim_debug_is_enabled()) |
272 g_timeout_add(0, start_with_debugwin, NULL); | 293 g_timeout_add(0, start_with_debugwin, NULL); |
273 } | 294 } |
274 | 295 |
275 void gg_debug_uninit() | 296 void gg_debug_uninit() |