mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-12 08:37:38 +00:00
removed some std stuff only used here (#2681)
This commit is contained in:
@@ -102,8 +102,15 @@ void MorseView::on_set_tone(NavigationView& nav) {
|
|||||||
tone_input_buffer = to_string_dec_uint(tone);
|
tone_input_buffer = to_string_dec_uint(tone);
|
||||||
|
|
||||||
text_prompt(nav, tone_input_buffer, 4, ENTER_KEYBOARD_MODE_DIGITS, [this](std::string& buffer) {
|
text_prompt(nav, tone_input_buffer, 4, ENTER_KEYBOARD_MODE_DIGITS, [this](std::string& buffer) {
|
||||||
if (!buffer.empty() && std::all_of(buffer.begin(), buffer.end(), ::isdigit)) {
|
bool is_digit_only = true;
|
||||||
int new_tone = std::stoi(buffer);
|
for (size_t i = 0; i < tone_input_buffer.size(); ++i) {
|
||||||
|
if (tone_input_buffer[i] < '0' || tone_input_buffer[i] > '9') {
|
||||||
|
is_digit_only = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!buffer.empty() && is_digit_only) {
|
||||||
|
int new_tone = atoi(buffer.c_str());
|
||||||
if (new_tone >= 100 && new_tone <= 9999) {
|
if (new_tone >= 100 && new_tone <= 9999) {
|
||||||
tone = new_tone;
|
tone = new_tone;
|
||||||
field_tone.set_value(tone);
|
field_tone.set_value(tone);
|
||||||
@@ -116,7 +123,6 @@ void MorseView::on_set_tone(NavigationView& nav) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void MorseView::on_set_text(NavigationView& nav) {
|
void MorseView::on_set_text(NavigationView& nav) {
|
||||||
text_prompt(nav, buffer, 28, ENTER_KEYBOARD_MODE_ALPHA);
|
text_prompt(nav, buffer, 28, ENTER_KEYBOARD_MODE_ALPHA);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user