From 6784fe72dd651b54e88a6a749d3c9952dd939fbc Mon Sep 17 00:00:00 2001 From: gullradriel <3157857+gullradriel@users.noreply.github.com> Date: Mon, 6 Nov 2023 20:38:37 +0100 Subject: [PATCH] fixed display when delete/remove entry (#1563) --- firmware/application/apps/ui_recon.cpp | 18 +++++++++--------- firmware/application/apps/ui_recon.hpp | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/firmware/application/apps/ui_recon.cpp b/firmware/application/apps/ui_recon.cpp index 7ec759e8a..cdfc63d74 100644 --- a/firmware/application/apps/ui_recon.cpp +++ b/firmware/application/apps/ui_recon.cpp @@ -481,10 +481,9 @@ ReconView::ReconView(NavigationView& nav) button_remove.on_select = [this](ButtonWithEncoder&) { handle_remove_current_item(); - - // TODO: refresh UI. timer = 0; freq_lock = 0; + recon_redraw(); }; button_remove.on_change = [this]() { @@ -567,7 +566,7 @@ ReconView::ReconView(NavigationView& nav) }; button_restart.on_select = [this](Button&) { - frequency_file_load(true); + frequency_file_load(); if (frequency_list.size() > 0) { if (fwd) { button_dir.set_text("FW>"); @@ -614,7 +613,7 @@ ReconView::ReconView(NavigationView& nav) button_scanner_mode.set_text("SCAN"); button_remove.set_text("DELETE"); } - frequency_file_load(true); + frequency_file_load(); if (autostart) { recon_resume(); } else { @@ -642,7 +641,7 @@ ReconView::ReconView(NavigationView& nav) load_persisted_settings(); ui_settings.save(); - frequency_file_load(false); + frequency_file_load(); freqlist_cleared_for_ui_action = false; if (autostart) { @@ -709,7 +708,7 @@ ReconView::ReconView(NavigationView& nav) delete_file(freq_file_path); } - frequency_file_load(false); /* do not stop all at start */ + frequency_file_load(); /* do not stop all at start */ if (autostart) { recon_resume(); } else { @@ -718,7 +717,7 @@ ReconView::ReconView(NavigationView& nav) recon_redraw(); } -void ReconView::frequency_file_load(bool) { +void ReconView::frequency_file_load() { if (field_mode.selected_index_value() != SPEC_MODULATION) audio::output::stop(); @@ -784,7 +783,7 @@ void ReconView::on_statistics_update(const ChannelStatistics& statistics) { // hack to reload the list if it was cleared by going into CONFIG if (freqlist_cleared_for_ui_action) { if (!manual_mode) { - frequency_file_load(false); + frequency_file_load(); } if (autostart && !user_pause) { recon_resume(); @@ -1214,11 +1213,12 @@ void ReconView::handle_remove_current_item() { if (frequency_list.size() > 0) { current_index = clip(current_index, 0u, frequency_list.size() - 1); text_cycle.set_text(to_string_dec_uint(current_index + 1, 3)); + entry = current_entry(); + freq = entry.frequency_a; } else { current_index = 0; text_cycle.set_text(" "); } - update_description(); } diff --git a/firmware/application/apps/ui_recon.hpp b/firmware/application/apps/ui_recon.hpp index 411755344..477524c41 100644 --- a/firmware/application/apps/ui_recon.hpp +++ b/firmware/application/apps/ui_recon.hpp @@ -81,7 +81,7 @@ class ReconView : public View { void show_max(bool refresh_display = false); void recon_pause(); void recon_resume(); - void frequency_file_load(bool stop_all_before = false); + void frequency_file_load(); void on_statistics_update(const ChannelStatistics& statistics); void on_index_delta(int32_t v); void on_stepper_delta(int32_t v); @@ -154,8 +154,8 @@ class ReconView : public View { uint16_t last_nb_match{999}; uint16_t last_freq_lock{999}; size_t last_list_size{0}; - int8_t last_rssi_min{-127}; - int8_t last_rssi_med{-127}; + int8_t last_rssi_min{127}; + int8_t last_rssi_med{0}; int8_t last_rssi_max{-127}; int32_t last_index{-1}; int64_t last_freq{0};