summaryrefslogtreecommitdiffstats
path: root/apps/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/apps/settings.c b/apps/settings.c
index eed2b3a692..992cc1f391 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -146,7 +146,7 @@ static bool read_nvram_data(char* buf, int max_len)
buf[i] = rtc_read(0x14+i);
#endif
/* check magic, version */
- if ((buf[0] != 'R') || (buf[1] != 'b')
+ if ((buf[0] != 'R') || (buf[1] != 'b')
|| (buf[2] != NVRAM_CONFIG_VERSION))
return false;
/* check crc32 */
@@ -221,7 +221,7 @@ static bool write_nvram_data(char* buf, int max_len)
supports that, but this will have to do for now 8-) */
for (i=0; i < NVRAM_BLOCK_SIZE; i++ ) {
int r = rtc_write(0x14+i, buf[i]);
- if (r)
+ if (r)
return false;
}
#endif
@@ -307,8 +307,8 @@ bool settings_load_config(const char* file, bool apply)
#ifdef HAVE_LCD_COLOR
if (settings[i].flags&F_RGB)
hex_to_rgb(value, (int*)settings[i].setting);
- else
-#endif
+ else
+#endif
if (settings[i].cfg_vals == NULL)
{
*(int*)settings[i].setting = atoi(value);
@@ -392,7 +392,7 @@ bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len)
const char* start = settings[setting_id].cfg_vals;
char* end = NULL;
int count = 0;
-
+
if ((flags&F_T_MASK)==F_T_INT &&
flags&F_TABLE_SETTING)
{
@@ -404,7 +404,7 @@ bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len)
{
if (end == NULL)
strlcpy(buf, start, buf_len);
- else
+ else
{
int len = (buf_len > (end-start))? end-start: buf_len;
strlcpy(buf, start, len+1);
@@ -412,7 +412,7 @@ bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len)
return true;
}
count++;
-
+
if (end)
start = end+1;
else
@@ -420,7 +420,7 @@ bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len)
}
return false;
}
-
+
while (count < val)
{
start = strchr(start,',');
@@ -432,7 +432,7 @@ bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len)
end = strchr(start,',');
if (end == NULL)
strlcpy(buf, start, buf_len);
- else
+ else
{
int len = (buf_len > (end-start))? end-start: buf_len;
strlcpy(buf, start, len+1);
@@ -561,7 +561,7 @@ static bool settings_write_config(const char* filename, int options)
value[0] = '\0';
if (settings[i].flags & F_DEPRECATED)
continue;
-
+
switch (options)
{
case SETTINGS_SAVE_CHANGED:
@@ -939,7 +939,7 @@ void settings_apply(bool read_disk)
&& global_settings.font_file[0] != '-') {
int font_ui = screens[SCREEN_MAIN].getuifont();
const char* loaded_font = font_filename(font_ui);
-
+
snprintf(buf, sizeof buf, FONT_DIR "/%s.fnt",
global_settings.font_file);
if (!loaded_font || strcmp(loaded_font, buf))
@@ -953,7 +953,7 @@ void settings_apply(bool read_disk)
screens[SCREEN_MAIN].setfont(rc);
}
}
-#ifdef HAVE_REMOTE_LCD
+#ifdef HAVE_REMOTE_LCD
if ( global_settings.remote_font_file[0]
&& global_settings.remote_font_file[0] != '-') {
int font_ui = screens[SCREEN_REMOTE].getuifont();
@@ -1064,17 +1064,27 @@ void settings_apply(bool read_disk)
#ifdef HAVE_BACKLIGHT
set_backlight_filter_keypress(global_settings.bl_filter_first_keypress);
+ set_selective_backlight_actions(global_settings.bl_selective_actions,
+ global_settings.bl_selective_actions_mask,
+ global_settings.bl_filter_first_keypress);
#ifdef HAVE_REMOTE_LCD
set_remote_backlight_filter_keypress(global_settings.remote_bl_filter_first_keypress);
#endif
#ifdef HAS_BUTTON_HOLD
backlight_set_on_button_hold(global_settings.backlight_on_button_hold);
#endif
+
#ifdef HAVE_LCD_SLEEP_SETTING
lcd_set_sleep_after_backlight_off(global_settings.lcd_sleep_after_backlight_off);
#endif
#endif /* HAVE_BACKLIGHT */
+#ifndef HAS_BUTTON_HOLD
+ set_selective_softlock_actions(
+ global_settings.bt_selective_softlock_actions,
+ global_settings.bt_selective_softlock_actions_mask);
+#endif
+
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
touchpad_set_sensitivity(global_settings.touchpad_sensitivity);
#endif
@@ -1243,7 +1253,7 @@ bool set_int_ex(const unsigned char* string,
(void)unit;
struct settings_list item;
struct int_setting data = {
- function, voice_unit, min, max, step,
+ function, voice_unit, min, max, step,
formatter, get_talk_id
};
item.int_setting = &data;
@@ -1269,7 +1279,7 @@ static int32_t set_option_get_talk_id(int value, int unit)
}
bool set_option(const char* string, const void* variable, enum optiontype type,
- const struct opt_items* options,
+ const struct opt_items* options,
int numoptions, void (*function)(int))
{
int temp;
@@ -1287,7 +1297,7 @@ bool set_option(const char* string, const void* variable, enum optiontype type,
item.setting = &temp;
if (type == BOOL)
temp = *(bool*)variable? 1: 0;
- else
+ else
temp = *(int*)variable;
if (!option_screen(&item, NULL, false, NULL))
{