@ -36,17 +36,19 @@ namespace {
SettingBluetooth : : SettingBluetooth ( Pinetime : : Applications : : DisplayApp * app , Pinetime : : Controllers : : Settings & settingsController )
SettingBluetooth : : SettingBluetooth ( Pinetime : : Applications : : DisplayApp * app , Pinetime : : Controllers : : Settings & settingsController )
: app { app } ,
: app { app } ,
settings { settingsController } ,
checkboxList (
checkboxList (
0 ,
0 ,
1 ,
1 ,
" Bluetooth " ,
" Bluetooth " ,
Symbols : : bluetooth ,
Symbols : : bluetooth ,
settingsController . GetBleRadioEnabled ( ) ? 0 : 1 ,
settingsController . GetBleRadioEnabled ( ) ? 0 : 1 ,
[ & settings = settingsController ] ( uint32_t index ) {
[ this ] ( uint32_t index ) {
const bool priorMode = settings . GetBleRadioEnabled ( ) ;
const bool priorMode = settings . GetBleRadioEnabled ( ) ;
const bool newMode = options [ index ] . radioEnabled ;
const bool newMode = options [ index ] . radioEnabled ;
if ( newMode ! = priorMode ) {
if ( newMode ! = priorMode ) {
settings . SetBleRadioEnabled ( newMode ) ;
settings . SetBleRadioEnabled ( newMode ) ;
this - > app - > PushMessage ( Pinetime : : Applications : : Display : : Messages : : BleRadioEnableToggle ) ;
}
}
} ,
} ,
CreateOptionArray ( ) ) {
CreateOptionArray ( ) ) {
@ -54,6 +56,4 @@ SettingBluetooth::SettingBluetooth(Pinetime::Applications::DisplayApp* app, Pine
SettingBluetooth : : ~ SettingBluetooth ( ) {
SettingBluetooth : : ~ SettingBluetooth ( ) {
lv_obj_clean ( lv_scr_act ( ) ) ;
lv_obj_clean ( lv_scr_act ( ) ) ;
// Pushing the message in the OnValueChanged function causes a freeze?
app - > PushMessage ( Pinetime : : Applications : : Display : : Messages : : BleRadioEnableToggle ) ;
}
}