mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Merge pull request #822 from heurist1/fix-tuning-radio-when-opening-app-with-settings
Fix the initialisation of frquency when apps are launched
This commit is contained in:
commit
e2620f1a33
@ -129,6 +129,11 @@ AnalogAudioView::AnalogAudioView(
|
|||||||
&waterfall
|
&waterfall
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Set on_change before initialising the field
|
||||||
|
field_frequency.on_change = [this](rf::Frequency f) {
|
||||||
|
this->on_tuning_frequency_changed(f);
|
||||||
|
};
|
||||||
|
|
||||||
// load app settings
|
// load app settings
|
||||||
auto rc = settings.load("rx_audio", &app_settings);
|
auto rc = settings.load("rx_audio", &app_settings);
|
||||||
if(rc == SETTINGS_OK) {
|
if(rc == SETTINGS_OK) {
|
||||||
@ -144,9 +149,6 @@ AnalogAudioView::AnalogAudioView(
|
|||||||
record_view.set_filename_date_frequency(true);
|
record_view.set_filename_date_frequency(true);
|
||||||
|
|
||||||
field_frequency.set_step(receiver_model.frequency_step());
|
field_frequency.set_step(receiver_model.frequency_step());
|
||||||
field_frequency.on_change = [this](rf::Frequency f) {
|
|
||||||
this->on_tuning_frequency_changed(f);
|
|
||||||
};
|
|
||||||
field_frequency.on_edit = [this, &nav]() {
|
field_frequency.on_edit = [this, &nav]() {
|
||||||
// TODO: Provide separate modal method/scheme?
|
// TODO: Provide separate modal method/scheme?
|
||||||
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
|
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
|
||||||
|
@ -57,6 +57,10 @@ AnalogTvView::AnalogTvView(
|
|||||||
&tv
|
&tv
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Set on_change before initialising the field
|
||||||
|
field_frequency.on_change = [this](rf::Frequency f) {
|
||||||
|
this->on_tuning_frequency_changed(f);
|
||||||
|
};
|
||||||
|
|
||||||
// load app settings
|
// load app settings
|
||||||
auto rc = settings.load("rx_tv", &app_settings);
|
auto rc = settings.load("rx_tv", &app_settings);
|
||||||
@ -70,9 +74,6 @@ AnalogTvView::AnalogTvView(
|
|||||||
|
|
||||||
|
|
||||||
field_frequency.set_step(receiver_model.frequency_step());
|
field_frequency.set_step(receiver_model.frequency_step());
|
||||||
field_frequency.on_change = [this](rf::Frequency f) {
|
|
||||||
this->on_tuning_frequency_changed(f);
|
|
||||||
};
|
|
||||||
field_frequency.on_edit = [this, &nav]() {
|
field_frequency.on_edit = [this, &nav]() {
|
||||||
// TODO: Provide separate modal method/scheme?
|
// TODO: Provide separate modal method/scheme?
|
||||||
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
|
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
|
||||||
|
@ -77,6 +77,11 @@ POCSAGAppView::POCSAGAppView(NavigationView& nav) {
|
|||||||
&console
|
&console
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Set on_change before initialising the field
|
||||||
|
field_frequency.on_change = [this](rf::Frequency f) {
|
||||||
|
update_freq(f);
|
||||||
|
};
|
||||||
|
|
||||||
// load app settings
|
// load app settings
|
||||||
auto rc = settings.load("rx_pocsag", &app_settings);
|
auto rc = settings.load("rx_pocsag", &app_settings);
|
||||||
if(rc == SETTINGS_OK) {
|
if(rc == SETTINGS_OK) {
|
||||||
@ -94,9 +99,6 @@ POCSAGAppView::POCSAGAppView(NavigationView& nav) {
|
|||||||
receiver_model.enable();
|
receiver_model.enable();
|
||||||
|
|
||||||
field_frequency.set_step(receiver_model.frequency_step());
|
field_frequency.set_step(receiver_model.frequency_step());
|
||||||
field_frequency.on_change = [this](rf::Frequency f) {
|
|
||||||
update_freq(f);
|
|
||||||
};
|
|
||||||
field_frequency.on_edit = [this, &nav]() {
|
field_frequency.on_edit = [this, &nav]() {
|
||||||
// TODO: Provide separate modal method/scheme?
|
// TODO: Provide separate modal method/scheme?
|
||||||
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
|
auto new_view = nav.push<FrequencyKeypadView>(receiver_model.tuning_frequency());
|
||||||
|
Loading…
Reference in New Issue
Block a user