diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/english.lang | 15 | ||||
-rw-r--r-- | apps/recorder/icons.c | 8 | ||||
-rw-r--r-- | apps/settings.c | 13 | ||||
-rw-r--r-- | apps/settings.h | 1 | ||||
-rw-r--r-- | apps/settings_menu.c | 9 |
5 files changed, 41 insertions, 5 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 75490b766d..846edde24a 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -900,3 +900,18 @@ eng: "OFF=Cancel" | |||
900 | new: | 900 | new: |
901 | 901 | ||
902 | id: LANG_TETRIS_LEVEL | 902 | id: LANG_TETRIS_LEVEL |
903 | |||
904 | id: LANG_TIMEFORMAT | ||
905 | desc: select the time format of time in status bar | ||
906 | eng: "Time Format" | ||
907 | new: | ||
908 | |||
909 | id: LANG_12_HOUR_CLOCK | ||
910 | desc: option for 12 hour clock | ||
911 | eng: "12 hour clock" | ||
912 | new: | ||
913 | |||
914 | id: LANG_24_HOUR_CLOCK | ||
915 | desc: option for 24 hour clock | ||
916 | eng: "24 hour clock" | ||
917 | new: | ||
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index 81de5b8006..adcfda5255 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include "sprintf.h" | 23 | #include "sprintf.h" |
24 | #include "rtc.h" | 24 | #include "rtc.h" |
25 | 25 | ||
26 | #include "settings.h" | ||
27 | |||
26 | #include "icons.h" | 28 | #include "icons.h" |
27 | 29 | ||
28 | unsigned char slider_bar[] = | 30 | unsigned char slider_bar[] = |
@@ -277,6 +279,12 @@ void statusbar_time(int hour, int minute) | |||
277 | hour <= 23 && | 279 | hour <= 23 && |
278 | minute >= 0 && | 280 | minute >= 0 && |
279 | minute <= 59 ) { | 281 | minute <= 59 ) { |
282 | if ( global_settings.timeformat ) { /* 12 hour clock */ | ||
283 | hour %= 12; | ||
284 | if ( hour == 0 ) { | ||
285 | hour +=12; | ||
286 | } | ||
287 | } | ||
280 | snprintf(buffer, sizeof(buffer), "%02d:%02d", hour, minute); | 288 | snprintf(buffer, sizeof(buffer), "%02d:%02d", hour, minute); |
281 | } | 289 | } |
282 | else { | 290 | else { |
diff --git a/apps/settings.c b/apps/settings.c index e9e171250f..3dafebc368 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -295,7 +295,9 @@ int settings_save( void ) | |||
295 | ((global_settings.dirfilter & 2) << 4) | | 295 | ((global_settings.dirfilter & 2) << 4) | |
296 | ((global_settings.scrollbar & 1) << 6)); | 296 | ((global_settings.scrollbar & 1) << 6)); |
297 | 297 | ||
298 | config_block[0xf] = (unsigned char)(global_settings.scroll_speed << 3); | 298 | config_block[0xf] = (unsigned char) |
299 | ((global_settings.timeformat & 1) << 2) | | ||
300 | ((global_settings.scroll_speed << 3)); | ||
299 | 301 | ||
300 | config_block[0x10] = (unsigned char) | 302 | config_block[0x10] = (unsigned char) |
301 | ((global_settings.ff_rewind_min_step & 15) << 4 | | 303 | ((global_settings.ff_rewind_min_step & 15) << 4 | |
@@ -410,7 +412,6 @@ void settings_apply(void) | |||
410 | */ | 412 | */ |
411 | void settings_load(void) | 413 | void settings_load(void) |
412 | { | 414 | { |
413 | unsigned char c; | ||
414 | 415 | ||
415 | DEBUGF( "reload_all_settings()\n" ); | 416 | DEBUGF( "reload_all_settings()\n" ); |
416 | 417 | ||
@@ -462,9 +463,10 @@ void settings_load(void) | |||
462 | an uninitialized entry */ | 463 | an uninitialized entry */ |
463 | } | 464 | } |
464 | 465 | ||
465 | c = config_block[0xf] >> 3; | 466 | if (config_block[0xf] != 0xFF) { |
466 | if (c != 31) | 467 | global_settings.timeformat = (config_block[0xf] >> 2) & 1; |
467 | global_settings.scroll_speed = c; | 468 | global_settings.scroll_speed = config_block[0xf] >> 3; |
469 | } | ||
468 | 470 | ||
469 | if (config_block[0x10] != 0xFF) { | 471 | if (config_block[0x10] != 0xFF) { |
470 | global_settings.ff_rewind_min_step = (config_block[0x10] >> 4) & 15; | 472 | global_settings.ff_rewind_min_step = (config_block[0x10] >> 4) & 15; |
@@ -667,6 +669,7 @@ void settings_reset(void) { | |||
667 | global_settings.playlist_shuffle = false; | 669 | global_settings.playlist_shuffle = false; |
668 | global_settings.discharge = 0; | 670 | global_settings.discharge = 0; |
669 | global_settings.total_uptime = 0; | 671 | global_settings.total_uptime = 0; |
672 | global_settings.timeformat = 0; | ||
670 | global_settings.scroll_speed = 8; | 673 | global_settings.scroll_speed = 8; |
671 | global_settings.ff_rewind_min_step = DEFAULT_FF_REWIND_MIN_STEP; | 674 | global_settings.ff_rewind_min_step = DEFAULT_FF_REWIND_MIN_STEP; |
672 | global_settings.ff_rewind_accel = DEFAULT_FF_REWIND_ACCEL_SETTING; | 675 | global_settings.ff_rewind_accel = DEFAULT_FF_REWIND_ACCEL_SETTING; |
diff --git a/apps/settings.h b/apps/settings.h index c2f5c925fb..39a7b7c74e 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -86,6 +86,7 @@ struct user_settings | |||
86 | int repeat_mode; /* 0=off 1=repeat all 2=repeat one */ | 86 | int repeat_mode; /* 0=off 1=repeat all 2=repeat one */ |
87 | int dirfilter; /* 0=display all, 1=only supported, 2=only music */ | 87 | int dirfilter; /* 0=display all, 1=only supported, 2=only music */ |
88 | bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */ | 88 | bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */ |
89 | int timeformat; /* time format: 0=24 hour clock, 1=12 hour clock */ | ||
89 | int scroll_speed; /* long texts scrolling speed: 1-30 */ | 90 | int scroll_speed; /* long texts scrolling speed: 1-30 */ |
90 | bool playlist_shuffle; | 91 | bool playlist_shuffle; |
91 | bool play_selected; /* Plays selected file even in shuffle mode */ | 92 | bool play_selected; /* Plays selected file even in shuffle mode */ |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index f91d884df9..7a7dceacc3 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -285,6 +285,14 @@ static bool timedate_set(void) | |||
285 | #endif | 285 | #endif |
286 | return result; | 286 | return result; |
287 | } | 287 | } |
288 | |||
289 | static bool timeformat_set(void) | ||
290 | { | ||
291 | char* names[] = { str(LANG_24_HOUR_CLOCK), | ||
292 | str(LANG_12_HOUR_CLOCK) }; | ||
293 | |||
294 | return set_option(str(LANG_TIMEFORMAT), &global_settings.timeformat, names, 2, NULL); | ||
295 | } | ||
288 | #endif | 296 | #endif |
289 | 297 | ||
290 | static bool spindown(void) | 298 | static bool spindown(void) |
@@ -454,6 +462,7 @@ static bool system_settings_menu(void) | |||
454 | #endif | 462 | #endif |
455 | #ifdef HAVE_LCD_BITMAP | 463 | #ifdef HAVE_LCD_BITMAP |
456 | { str(LANG_TIME), timedate_set }, | 464 | { str(LANG_TIME), timedate_set }, |
465 | { str(LANG_TIMEFORMAT), timeformat_set }, | ||
457 | #endif | 466 | #endif |
458 | { str(LANG_POWEROFF_IDLE), poweroff_idle_timer }, | 467 | { str(LANG_POWEROFF_IDLE), poweroff_idle_timer }, |
459 | { str(LANG_RESET), reset_settings }, | 468 | { str(LANG_RESET), reset_settings }, |