comparison gui/skin/skin.c @ 33023:ba432e34dc7e

Add message showing function. In some cases it is necessary to show messages to the GUI users as well or they will wonder why the GUI didn't show up.
author ib
date Fri, 25 Mar 2011 10:33:48 +0000
parents 9abc0dbd6314
children 9684ad0e1291
comparison
equal deleted inserted replaced
33022:9abc0dbd6314 33023:ba432e34dc7e
21 21
22 #include "skin.h" 22 #include "skin.h"
23 #include "cut.h" 23 #include "cut.h"
24 #include "font.h" 24 #include "font.h"
25 #include "gui/app.h" 25 #include "gui/app.h"
26 #include "gui/interface.h"
26 #include "gui/mplayer/widgets.h" 27 #include "gui/mplayer/widgets.h"
27 28
28 #include "config.h" 29 #include "config.h"
29 #include "help_mp.h" 30 #include "help_mp.h"
30 #include "libavutil/avstring.h" 31 #include "libavutil/avstring.h"
47 static wItem *currWinItems; 48 static wItem *currWinItems;
48 49
49 static void skin_error(const char *format, ...) 50 static void skin_error(const char *format, ...)
50 { 51 {
51 char p[512]; 52 char p[512];
52 char tmp[512];
53 va_list ap; 53 va_list ap;
54 54
55 va_start(ap, format); 55 va_start(ap, format);
56 vsnprintf(p, sizeof(p), format, ap); 56 vsnprintf(p, sizeof(p), format, ap);
57 va_end(ap); 57 va_end(ap);
58 58
59 mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_SKIN_ERRORMESSAGE, linenumber, p); 59 gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_SKIN_ERRORMESSAGE, linenumber, p);
60
61 if (mp_msg_test(MSGT_GPLAYER, MSGL_ERR)) {
62 snprintf(tmp, sizeof(tmp), MSGTR_SKIN_ERRORMESSAGE, linenumber, p);
63 gtkMessageBox(GTK_MB_FATAL, tmp);
64 }
65 } 60 }
66 61
67 #define CHECKDEFLIST(str) \ 62 #define CHECKDEFLIST(str) \
68 { \ 63 { \
69 if (skin == NULL) \ 64 if (skin == NULL) \