From fbd077e91da593ff97375842bc44dd3fa65a4ad1 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Thu, 3 Dec 2015 20:54:18 -0800 Subject: [PATCH] Restore receiver mode when View is displayed. Needs refactor because on_modulation_changed() doesn't change the modulation so much as the "app" or receiver mode. --- firmware/application/ui_receiver.cpp | 13 +++++++++++++ firmware/application/ui_receiver.hpp | 3 +++ 2 files changed, 16 insertions(+) diff --git a/firmware/application/ui_receiver.cpp b/firmware/application/ui_receiver.cpp index 421442e1..78682d14 100644 --- a/firmware/application/ui_receiver.cpp +++ b/firmware/application/ui_receiver.cpp @@ -498,6 +498,19 @@ ReceiverView::~ReceiverView() { receiver_model.disable(); } +void ReceiverView::on_show() { + View::on_show(); + + // TODO: Separate concepts of baseband "modulation" and receiver "mode". + on_modulation_changed(static_cast(receiver_model.modulation())); +} + +void ReceiverView::on_hide() { + on_modulation_changed(static_cast(-1)); + + View::on_hide(); +} + void ReceiverView::focus() { button_done.focus(); } diff --git a/firmware/application/ui_receiver.hpp b/firmware/application/ui_receiver.hpp index af948c3c..e2cbf1f7 100644 --- a/firmware/application/ui_receiver.hpp +++ b/firmware/application/ui_receiver.hpp @@ -362,6 +362,9 @@ public: ReceiverView(NavigationView& nav, ReceiverModel& receiver_model); ~ReceiverView(); + void on_show() override; + void on_hide() override; + void focus() override; private: