From: Miguel F. <mig...@us...> - 2004-05-22 23:14:42
|
Update of /cvsroot/xine/xine-ui/src/xitk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31121 Modified Files: errors.c errors.h main.c Log Message: new idea for the "system too slow" warning Index: errors.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/errors.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- errors.c 20 May 2004 01:08:10 -0000 1.28 +++ errors.c 22 May 2004 23:14:31 -0000 1.29 @@ -280,3 +280,58 @@ gGui->new_pos = -1; } + + +static void _dont_show_too_slow_again(xitk_widget_t *w, void *data, int state) { + config_update_num ("gui.dropped_frames_warning", !state); +} + +static void _learn_more_about_too_slow(xitk_widget_t *w, void *data, int state) { + /* + * fixme: how to properly open the system browser? + * should we just make it configurable? + */ + system ("mozilla http://xinehq.de/index.php/faq#SPEEDUP"); +} + +/* + * Create the real window. + */ +void too_slow_window(void) { + xitk_window_t *xw; + char *title, *message; + int display_warning; + int checked = 1; + + title = _("Warning"); + message = _("The amount of dropped frame is too high, your system might be slow, not properly optimized or just too loaded.\n\nhttp://xinehq.de/index.php/faq#SPEEDUP"); + + dump_error(gGui->verbosity, message); + + display_warning = xine_config_register_bool (gGui->xine, "gui.dropped_frames_warning", + 1, + _("Warn user when too much frames are dropped."), + CONFIG_NO_HELP, + CONFIG_LEVEL_ADV, + CONFIG_NO_CB, + CONFIG_NO_DATA); + + if( !display_warning ) + return; + + _dont_show_too_slow_again(NULL, NULL, checked); + + xw = xitk_window_dialog_checkbox_two_buttons_with_width(gGui->imlib_data, title, + _("Done"), _("Learn More..."), + NULL, _learn_more_about_too_slow, + _("Don't ever show this message again."), + checked, _dont_show_too_slow_again, + NULL, 500, ALIGN_CENTER, + message); + if(!gGui->use_root_window && gGui->video_display == gGui->display) { + XLockDisplay(gGui->display); + XSetTransientForHint(gGui->display, xitk_window_get_window(xw), gGui->video_window); + XUnlockDisplay(gGui->display); + } + layer_above_video(xitk_window_get_window(xw)); +} Index: errors.h =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/errors.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- errors.h 13 Apr 2004 19:55:47 -0000 1.8 +++ errors.h 22 May 2004 23:14:31 -0000 1.9 @@ -34,5 +34,7 @@ void gui_handle_xine_error(xine_stream_t *stream, char *mrl); +void too_slow_window(void); + #endif Index: main.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/main.c,v retrieving revision 1.289 retrieving revision 1.290 diff -u -r1.289 -r1.290 --- main.c 20 May 2004 01:08:11 -0000 1.289 +++ main.c 22 May 2004 23:14:31 -0000 1.290 @@ -1276,11 +1276,7 @@ case XINE_EVENT_DROPPED_FRAMES: if (xine_get_param(gGui->stream, XINE_PARAM_SPEED) <= XINE_SPEED_NORMAL) { - char buffer[2048]; - - memset(&buffer, 0, sizeof(buffer)); - snprintf(buffer, sizeof(buffer), "%s", _("Your system seems too slow, the amount of dropped frames is too high.")); - xine_error_with_more(buffer); + too_slow_window(); } break; |