mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-28 08:37:31 -04:00
App settings revamp (#1139)
* WIP AppSetting overhaul * WIP migrating apps to new settings. * remove settings, rename tuned => target * formatting * Minor fixes * Fix hang on app load * run formatter * PR comment fixes * Load modulation into receiver model in app_settings * Run formatter --------- Co-authored-by: kallanreed <kallanreed@outlook.com>
This commit is contained in:
parent
f65e743c4c
commit
8bd3d6249d
105 changed files with 914 additions and 1136 deletions
|
@ -194,17 +194,16 @@ ReplayAppView::ReplayAppView(
|
|||
&waterfall,
|
||||
});
|
||||
|
||||
field_frequency.set_value(target_frequency());
|
||||
field_frequency.set_value(transmitter_model.target_frequency());
|
||||
field_frequency.set_step(receiver_model.frequency_step());
|
||||
field_frequency.on_change = [this](rf::Frequency f) {
|
||||
this->on_target_frequency_changed(f);
|
||||
transmitter_model.set_target_frequency(f);
|
||||
};
|
||||
field_frequency.on_edit = [this, &nav]() {
|
||||
// TODO: Provide separate modal method/scheme?
|
||||
auto new_view = nav.push<FrequencyKeypadView>(this->target_frequency());
|
||||
auto new_view = nav.push<FrequencyKeypadView>(transmitter_model.target_frequency());
|
||||
new_view->on_changed = [this](rf::Frequency f) {
|
||||
this->on_target_frequency_changed(f);
|
||||
this->field_frequency.set_value(f);
|
||||
field_frequency.set_value(f);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -247,16 +246,4 @@ void ReplayAppView::set_parent_rect(const Rect new_parent_rect) {
|
|||
waterfall.set_parent_rect(waterfall_rect);
|
||||
}
|
||||
|
||||
void ReplayAppView::on_target_frequency_changed(rf::Frequency f) {
|
||||
set_target_frequency(f);
|
||||
}
|
||||
|
||||
void ReplayAppView::set_target_frequency(const rf::Frequency new_value) {
|
||||
persistent_memory::set_tuned_frequency(new_value);
|
||||
}
|
||||
|
||||
rf::Frequency ReplayAppView::target_frequency() const {
|
||||
return persistent_memory::tuned_frequency();
|
||||
}
|
||||
|
||||
} /* namespace ui */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue