# HG changeset patch # User ib # Date 1357831479 0 # Node ID ac2a7944829c9dabfb723abefe2428c326bdb795 # Parent b98a97813f10555bc27171705c5999e1e7d25d8c Replace stderr output by mp_msg() error messages. Additionally, enable translation of error text and add doxygen comment. diff -r b98a97813f10 -r ac2a7944829c gui/wm/ws.c --- a/gui/wm/ws.c Thu Jan 10 12:23:17 2013 +0000 +++ b/gui/wm/ws.c Thu Jan 10 15:24:39 2013 +0000 @@ -191,17 +191,24 @@ // Init X Window System. // ---------------------------------------------------------------------------------------------- +/** + * @brief Inform about an X error that has occurred. + * + * @param display display + * @param event pointer to an X error event structure + * + * @return 0 + */ static int wsErrorHandler(Display *display, XErrorEvent *event) { char type[128]; XGetErrorText(display, event->error_code, type, sizeof(type)); - fprintf(stderr, "[ws] Error in display.\n"); - fprintf(stderr, "[ws] Error code: %d ( %s )\n", event->error_code, type); - fprintf(stderr, "[ws] Request code: %d\n", event->request_code); - fprintf(stderr, "[ws] Minor code: %d\n", event->minor_code); - fprintf(stderr, "[ws] Modules: %s\n", current_module ? current_module : "(NULL)"); + mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_WS_XError); + mp_msg(MSGT_GPLAYER, MSGL_ERR, "[ws] Error code: %d - %s\n", event->error_code, type); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] Request code: %d (minor code: %d)\n", event->request_code, event->minor_code); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[ws] MPlayer module: %s\n", current_module ? current_module : "(none)"); return 0; } diff -r b98a97813f10 -r ac2a7944829c help/help_mp-de.h --- a/help/help_mp-de.h Thu Jan 10 12:23:17 2013 +0000 +++ b/help/help_mp-de.h Thu Jan 10 15:24:39 2013 +0000 @@ -1055,6 +1055,7 @@ #define MSGTR_WS_NotEnoughMemoryDrawBuffer "[ws] Sorry, nicht genügend Speicher zum Schreiben des Buffers.\n" #define MSGTR_WS_DpmsUnavailable "DPMS nicht verfügbar?\n" #define MSGTR_WS_DpmsNotEnabled "Konnte DPMS nicht aktivieren.\n" +#define MSGTR_WS_XError "[ws] Ein X11-Fehler ist aufgetreten!\n" // wsxdnd.c #define MSGTR_WS_NotAFile "Dies scheint keine Datei zu sein...\n" diff -r b98a97813f10 -r ac2a7944829c help/help_mp-en.h --- a/help/help_mp-en.h Thu Jan 10 12:23:17 2013 +0000 +++ b/help/help_mp-en.h Thu Jan 10 15:24:39 2013 +0000 @@ -848,6 +848,7 @@ #define MSGTR_WS_NotEnoughMemoryDrawBuffer "[ws] Sorry, not enough memory to draw buffer.\n" #define MSGTR_WS_DpmsUnavailable "DPMS not available?\n" #define MSGTR_WS_DpmsNotEnabled "Could not enable DPMS.\n" +#define MSGTR_WS_XError "[ws] An X11 Error has occurred!\n" // wsxdnd.c #define MSGTR_WS_NotAFile "This does not seem to be a file...\n"