diff --git a/firmware/application/external/hopper/ui_hopper.cpp b/firmware/application/external/hopper/ui_hopper.cpp index f9ac1bd01..093a3c3ac 100644 --- a/firmware/application/external/hopper/ui_hopper.cpp +++ b/firmware/application/external/hopper/ui_hopper.cpp @@ -33,7 +33,6 @@ #include "baseband_api.hpp" #include "string_format.hpp" - using namespace portapack; namespace ui::external_app::hopper { @@ -47,7 +46,7 @@ HopperView::~HopperView() { baseband::shutdown(); } -void HopperView::update_freq_list_menu_view() { +void HopperView::update_freq_list_menu_view() { menu_freq_list.clear(); uint8_t list_count = freq_list.size(); @@ -66,7 +65,6 @@ void HopperView::update_freq_list_menu_view() { } set_dirty(); - } void HopperView::on_retune(const rf::Frequency freq, const uint32_t range) { @@ -96,10 +94,7 @@ void HopperView::start_tx() { if (true) { uint8_t channel_count = freq_list.size(); - if (channel_count <= JAMMER_MAX_CH) { - - for (c = 0; c < channel_count; c++) { if (i >= JAMMER_MAX_CH) { out_of_ranges = true; @@ -266,6 +261,7 @@ HopperView::HopperView( &button_add_freq, &button_delete_freq, &button_save_list, + &button_add_freq_from_freqman, &button_clear, &labels, &options_type, @@ -323,7 +319,12 @@ HopperView::HopperView( }; button_clear.on_select = [this]() { - freq_list.clear(); + nav_.display_modal("Del:", "Clean all?\n", YESNO, [this](bool choice) { + if (choice){ + freq_list.clear(); + update_freq_list_menu_view(); + } }, TRUE); + update_freq_list_menu_view(); }; @@ -334,6 +335,14 @@ HopperView::HopperView( start_tx(); }; + menu_freq_list.on_left = [this]() { + button_load_list.focus(); + }; + + menu_freq_list.on_right = [this]() { + button_load_list.focus(); + }; + update_freq_list_menu_view(); } diff --git a/firmware/application/external/hopper/ui_hopper.hpp b/firmware/application/external/hopper/ui_hopper.hpp index 0b9ec2f08..591555e55 100644 --- a/firmware/application/external/hopper/ui_hopper.hpp +++ b/firmware/application/external/hopper/ui_hopper.hpp @@ -84,7 +84,7 @@ class HopperView : public View { const Style& style_cancel = *Theme::getInstance()->fg_red; MenuView menu_freq_list{ - {0, 0, screen_width, 9 * 16}, + {0, 0, screen_width, 8 * 16}, false}; NewButton button_load_list{ @@ -108,15 +108,22 @@ class HopperView : public View { Color::dark_green(), /*vcenter*/ true}; - NewButton button_delete_freq{ + NewButton button_add_freq_from_freqman{ {12 * 8 + 4, 9 * 16 + 4, 4 * 8, 32}, {}, + &bitmap_icon_add, + Color::dark_green(), + /*vcenter*/ true}; + + NewButton button_delete_freq{ + {16 * 8 + 4, 9 * 16 + 4, 4 * 8, 32}, + {}, &bitmap_icon_trash, Color::dark_red(), /*vcenter*/ true}; NewButton button_clear{ - {16 * 8 + 8, 9 * 16 + 4, 4 * 8, 32}, + {screen_width - 4 * 8, 9 * 16 + 4, 4 * 8, 32}, {}, &bitmap_icon_tools_wipesd, Color::red(),