Add a setting to force the backlight to stay on (or act normally) when

in plugins.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12873 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2007-03-21 07:05:05 +00:00
parent 59649b888a
commit a5c5bd3831
5 changed files with 32 additions and 5 deletions

View file

@ -10725,3 +10725,17 @@
*: ""
</voice>
</phrase>
<phrase>
id: LANG_BACKLIGHT_IN_PLUGINS
desc: in lcd settings
user:
<source>
*: "Backlight (In Plugins)"
</source>
<dest>
*: "Backlight (In Plugins)"
</dest>
<voice>
*: "Backlight in plugins"
</voice>
</phrase>

View file

@ -79,6 +79,7 @@ int flipdisplay_callback(int action,const struct menu_item_ex *this_item)
/* LCD MENU */
#if CONFIG_BACKLIGHT
MENUITEM_SETTING(backlight_timeout, &global_settings.backlight_timeout, NULL);
MENUITEM_SETTING(backlight_in_plugins, &global_settings.backlight_in_plugins, NULL);
#if CONFIG_CHARGING
MENUITEM_SETTING(backlight_timeout_plugged,
&global_settings.backlight_timeout_plugged, NULL);
@ -180,7 +181,7 @@ MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU),
# ifdef HAS_BUTTON_HOLD
,&backlight_on_button_hold
# endif
,&caption_backlight
,&caption_backlight, &backlight_in_plugins
# if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
,&backlight_fade_in, &backlight_fade_out
# endif

View file

@ -609,10 +609,17 @@ int plugin_load(const char* plugin, void* parameter)
#endif
invalidate_icache();
#if CONFIG_BACKLIGHT
if (global_settings.backlight_in_plugins == 1)
backlight_set_timeout(1);
#endif
rc = hdr->entry_point((struct plugin_api*) &rockbox_api, parameter);
/* explicitly casting the pointer here to avoid touching every plugin. */
#if CONFIG_BACKLIGHT
if (global_settings.backlight_in_plugins == 1)
backlight_set_timeout(global_settings.backlight_timeout);
#endif
button_clear_queue();
#ifdef HAVE_LCD_BITMAP

View file

@ -704,7 +704,9 @@ struct user_settings
(defined(HAVE_RECORDING) || CONFIG_TUNER)
int alarm_wake_up_screen;
#endif
#if CONFIG_BACKLIGHT
int backlight_in_plugins;
#endif
};
/** global variables **/

View file

@ -971,7 +971,10 @@ const struct settings_list settings[] = {
"normal,off,on", backlight_set_on_button_hold, 3,
ID2P(LANG_BACKLIGHT_ON_BUTTON_HOLD_NORMAL), ID2P(LANG_OFF), ID2P(LANG_ON)),
#endif
CHOICE_SETTING(0, backlight_in_plugins,
LANG_BACKLIGHT_IN_PLUGINS, 0, "backlight in settings",
"normal,on", NULL, 2,
ID2P(LANG_BACKLIGHT_ON_BUTTON_HOLD_NORMAL), ID2P(LANG_ON)),
#ifdef HAVE_LCD_SLEEP
STRINGCHOICE_SETTING(0, lcd_sleep_after_backlight_off,
LANG_LCD_SLEEP_AFTER_BACKLIGHT_OFF, 3,