Merge pull request #361 from ArjanOnwezen/iso-date-time

ISO datetime for Clock, FileManager, Frequency manager, added clock UI options
This commit is contained in:
Erwin Ried 2021-06-07 23:48:19 +02:00 committed by GitHub
commit f1ba8c3dee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 114 additions and 41 deletions

View file

@ -103,19 +103,19 @@ private:
};
Labels labels {
{ { 2 * 8, 14 * 8 }, "Save as:", Color::white() }
{ { 1 * 8, 12 * 8 }, "Save as:", Color::white() }
};
Button button_save_name {
{ 2 * 8, 17 * 8, 14 * 8, 48 },
{ 1 * 8, 17 * 8, 12 * 8, 48 },
"Name (set)"
};
Button button_save_timestamp {
{ 2 * 8, 25 * 8, 14 * 8, 48 },
{ 1 * 8, 25 * 8, 12 * 8, 48 },
"Timestamp:"
};
LiveDateTime live_timestamp {
{ 17 * 8, 27 * 8, 11 * 8, 16 }
{ 14 * 8, 27 * 8, 16 * 8, 16 }
};
};

View file

@ -285,15 +285,17 @@ SetUIView::SetUIView(NavigationView& nav) {
&checkbox_bloff,
&options_bloff,
&checkbox_showsplash,
&checkbox_showclock,
&options_clockformat,
&button_ok
});
checkbox_speaker.set_value(persistent_memory::config_speaker());
checkbox_showsplash.set_value(persistent_memory::config_splash());
checkbox_showclock.set_value(!persistent_memory::hide_clock());
//checkbox_login.set_value(persistent_memory::config_login());
uint32_t backlight_timer = persistent_memory::config_backlight_timer();
if (backlight_timer) {
checkbox_bloff.set_value(true);
options_bloff.set_by_value(backlight_timer);
@ -301,6 +303,12 @@ SetUIView::SetUIView(NavigationView& nav) {
options_bloff.set_selected_index(0);
}
if (persistent_memory::clock_with_date()) {
options_clockformat.set_selected_index(1);
} else {
options_clockformat.set_selected_index(0);
}
checkbox_speaker.on_select = [this](Checkbox&, bool v) {
if (v) audio::output::speaker_mute(); //Just mute audio if speaker is disabled
@ -316,7 +324,14 @@ SetUIView::SetUIView(NavigationView& nav) {
else
persistent_memory::set_config_backlight_timer(0);
if (checkbox_showclock.value()){
if (options_clockformat.selected_index() == 1)
persistent_memory::set_clock_with_date(true);
else
persistent_memory::set_clock_with_date(false);
}
persistent_memory::set_config_splash(checkbox_showsplash.value());
persistent_memory::set_clock_hidden(!checkbox_showclock.value());
//persistent_memory::set_config_login(checkbox_login.value());
nav.pop();
};

View file

@ -51,8 +51,8 @@ public:
private:
Labels labels {
{ { 6 * 8, 7 * 16 }, "YYYY/MM/DD HH:MM:SS", Color::grey() },
{ { 10 * 8, 9 * 16 }, "/ / : :", Color::light_grey() }
{ { 6 * 8, 7 * 16 }, "YYYY-MM-DD HH:MM:SS", Color::grey() },
{ { 10 * 8, 9 * 16 }, "- - : :", Color::light_grey() }
};
NumberField field_year {
@ -226,19 +226,19 @@ private:
};*/
Checkbox checkbox_speaker {
{ 3 * 8, 2 * 16 },
{ 3 * 8, 4 * 16 },
20,
"Hide H1 Speaker option"
};
Checkbox checkbox_bloff {
{ 3 * 8, 5 * 16 },
{ 3 * 8, 6 * 16 },
20,
"Backlight off after:"
};
OptionsField options_bloff {
{ 52, 6 * 16 + 8 },
10,
{ 52, 7 * 16 + 8 },
20,
{
{ "5 seconds", 5 },
{ "15 seconds", 15 },
@ -252,10 +252,25 @@ private:
Checkbox checkbox_showsplash {
{ 3 * 8, 9 * 16 },
11,
20,
"Show splash"
};
Checkbox checkbox_showclock {
{ 3 * 8, 11 * 16 },
20,
"Show clock with:"
};
OptionsField options_clockformat {
{ 52, 12 * 16 + 8 },
20,
{
{ "time only", 0 },
{ "time and date", 1 }
}
};
Button button_ok {
{ 2 * 8, 16 * 16, 12 * 8, 32 },
"Save"