comparison mcabber/mcabber/screen.c @ 2149:1b3add57c912

Try to display the GLib warnings in the log window
author Mikael Berthe <mikael@lilotux.net>
date Sun, 06 Jul 2014 16:09:27 +0200
parents 2f294c2b6778
children 798baf5db4eb
comparison
equal deleted inserted replaced
2148:7a0df2e5da19 2149:1b3add57c912
83 static inline void check_offset(int); 83 static inline void check_offset(int);
84 static void scr_cancel_current_completion(void); 84 static void scr_cancel_current_completion(void);
85 static void scr_end_current_completion(void); 85 static void scr_end_current_completion(void);
86 static void scr_insert_text(const char*); 86 static void scr_insert_text(const char*);
87 static void scr_handle_tab(gboolean fwd); 87 static void scr_handle_tab(gboolean fwd);
88
89 static void scr_glog_print(const gchar *log_domain, GLogLevelFlags log_level,
90 const gchar *message, gpointer user_data);
88 91
89 #if defined XEP0022 || defined XEP0085 92 #if defined XEP0022 || defined XEP0085
90 static gboolean scr_chatstates_timeout(); 93 static gboolean scr_chatstates_timeout();
91 #endif 94 #endif
92 95
826 829
827 inputLine[0] = 0; 830 inputLine[0] = 0;
828 ptr_inputline = inputLine; 831 ptr_inputline = inputLine;
829 832
830 Curses = TRUE; 833 Curses = TRUE;
834
835 g_log_set_handler("GLib", G_LOG_LEVEL_MASK, scr_glog_print, NULL);
831 return; 836 return;
832 } 837 }
833 838
834 void scr_terminate_curses(void) 839 void scr_terminate_curses(void)
835 { 840 {
989 buffer = g_strdup_printf("%s %s\n", strtimestamp, btext); 994 buffer = g_strdup_printf("%s %s\n", strtimestamp, btext);
990 ut_write_log(flag, buffer); 995 ut_write_log(flag, buffer);
991 g_free(buffer); 996 g_free(buffer);
992 } 997 }
993 g_free(btext); 998 g_free(btext);
999 }
1000
1001 // This is a GLogFunc for Glib log messages
1002 static void scr_glog_print(const gchar *log_domain, GLogLevelFlags log_level,
1003 const gchar *message, gpointer user_data)
1004 {
1005 scr_log_print(LPRINT_NORMAL, "[%s] %s", log_domain, message);
994 } 1006 }
995 1007
996 static winbuf *scr_search_window(const char *winId, int special) 1008 static winbuf *scr_search_window(const char *winId, int special)
997 { 1009 {
998 char *id; 1010 char *id;