Support showing invalid entries in Freqman and allow minor edits (#1269)

* Support showing invalid entries in Freqman and allow minor edits
* Use light_grey instead of grey
* Fix comment
* Fix null in description bug
* Fix spacing in delete entry dialog
* trim in delete modal
This commit is contained in:
Kyle Reed 2023-07-12 23:28:27 -07:00 committed by GitHub
parent 4ed06b9eff
commit d72d935607
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 16 deletions

View file

@ -140,7 +140,7 @@ FrequencySaveView::FrequencySaveView(
button_edit.on_select = [this, &nav](Button&) {
temp_buffer_ = entry_.description;
text_prompt(nav_, temp_buffer_, 30, [this](std::string& new_desc) {
text_prompt(nav_, temp_buffer_, desc_edit_max, [this](std::string& new_desc) {
entry_.description = new_desc;
refresh_ui();
});
@ -189,7 +189,7 @@ FrequencyLoadView::FrequencyLoadView(
/* FrequencyManagerView **********************************/
void FrequencyManagerView::on_edit_freq() {
// TODO: range edit support?
// TODO: range edit support.
auto freq_edit_view = nav_.push<FrequencyKeypadView>(current_entry().frequency_a);
freq_edit_view->on_changed = [this](rf::Frequency f) {
auto entry = current_entry();
@ -201,7 +201,7 @@ void FrequencyManagerView::on_edit_freq() {
void FrequencyManagerView::on_edit_desc() {
temp_buffer_ = current_entry().description;
text_prompt(nav_, temp_buffer_, 28, [this](std::string& new_desc) {
text_prompt(nav_, temp_buffer_, desc_edit_max, [this](std::string& new_desc) {
auto entry = current_entry();
entry.description = std::move(new_desc);
db_.replace_entry(current_index(), entry);
@ -211,7 +211,7 @@ void FrequencyManagerView::on_edit_desc() {
void FrequencyManagerView::on_add_category() {
temp_buffer_.clear();
text_prompt(nav_, temp_buffer_, 12, [this](std::string& new_name) {
text_prompt(nav_, temp_buffer_, 20, [this](std::string& new_name) {
if (!new_name.empty()) {
create_freqman_file(new_name);
refresh_categories();
@ -249,7 +249,7 @@ void FrequencyManagerView::on_del_entry() {
return;
nav_.push<ModalMessageView>(
"Delete", "Delete" + pretty_string(current_entry(), 23) + "\nAre you sure?", YESNO,
"Delete", "Delete " + trim(pretty_string(current_entry(), 23)) + "\nAre you sure?", YESNO,
[this](bool choice) {
if (choice) {
db_.delete_entry(current_index());