mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-10 06:54:19 +00:00
after merge fixes
This commit is contained in:
parent
bf6c6c231f
commit
6c0dadad3f
4 changed files with 14 additions and 9 deletions
|
@ -445,6 +445,12 @@ static Power* power_alloc(void) {
|
|||
// State initialization
|
||||
power->power_off_timeout = POWER_OFF_TIMEOUT_S;
|
||||
power->show_battery_low_warning = true;
|
||||
|
||||
// Load UI settings
|
||||
DesktopSettings* settings = malloc(sizeof(DesktopSettings));
|
||||
desktop_settings_load(settings);
|
||||
power->displayBatteryPercentage = settings->displayBatteryPercentage;
|
||||
free(settings);
|
||||
// Gui
|
||||
Gui* gui = furi_record_open(RECORD_GUI);
|
||||
|
||||
|
|
|
@ -127,7 +127,8 @@ void desktop_settings_app_free(DesktopSettingsApp* app) {
|
|||
free(app);
|
||||
|
||||
if(temp_save_name) {
|
||||
power_reboot(PowerBootModeNormal);
|
||||
Power* power = furi_record_open(RECORD_POWER);
|
||||
power_reboot(power, PowerBootModeNormal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,10 +92,9 @@ static void js_keyboard_text(struct mjs* mjs) {
|
|||
view_holder_set_back_callback(keyboard->view_holder, keyboard_exit, keyboard);
|
||||
|
||||
view_holder_set_view(keyboard->view_holder, text_input_get_view(keyboard->text_input));
|
||||
view_holder_start(keyboard->view_holder);
|
||||
api_lock_wait_unlock(keyboard->lock);
|
||||
|
||||
view_holder_stop(keyboard->view_holder);
|
||||
view_holder_set_view(keyboard->view_holder, NULL);
|
||||
view_holder_free(keyboard->view_holder);
|
||||
|
||||
furi_record_close(RECORD_GUI);
|
||||
|
@ -148,10 +147,9 @@ static void js_keyboard_byte(struct mjs* mjs) {
|
|||
view_holder_set_back_callback(keyboard->view_holder, keyboard_exit, keyboard);
|
||||
|
||||
view_holder_set_view(keyboard->view_holder, byte_input_get_view(keyboard->byte_input));
|
||||
view_holder_start(keyboard->view_holder);
|
||||
api_lock_wait_unlock(keyboard->lock);
|
||||
|
||||
view_holder_stop(keyboard->view_holder);
|
||||
view_holder_set_view(keyboard->view_holder, NULL);
|
||||
view_holder_free(keyboard->view_holder);
|
||||
|
||||
furi_record_close(RECORD_GUI);
|
||||
|
|
|
@ -759,7 +759,7 @@ static void js_widget_is_open(struct mjs* mjs) {
|
|||
static void widget_callback(void* context, uint32_t arg) {
|
||||
UNUSED(arg);
|
||||
JsWidgetInst* widget = context;
|
||||
view_holder_stop(widget->view_holder);
|
||||
view_holder_set_view(widget->view_holder, NULL);
|
||||
widget->is_shown = false;
|
||||
}
|
||||
|
||||
|
@ -779,7 +779,7 @@ static void js_widget_show(struct mjs* mjs) {
|
|||
return;
|
||||
}
|
||||
|
||||
view_holder_start(widget->view_holder);
|
||||
view_holder_set_view(widget->view_holder, widget->view);
|
||||
widget->is_shown = true;
|
||||
|
||||
mjs_return(mjs, MJS_UNDEFINED);
|
||||
|
@ -789,7 +789,7 @@ static void js_widget_close(struct mjs* mjs) {
|
|||
JsWidgetInst* widget = get_this_ctx(mjs);
|
||||
if(!check_arg_count(mjs, 0)) return;
|
||||
|
||||
view_holder_stop(widget->view_holder);
|
||||
view_holder_set_view(widget->view_holder, NULL);
|
||||
widget->is_shown = false;
|
||||
|
||||
mjs_return(mjs, MJS_UNDEFINED);
|
||||
|
@ -874,7 +874,7 @@ static void* js_widget_create(struct mjs* mjs, mjs_val_t* object) {
|
|||
static void js_widget_destroy(void* inst) {
|
||||
JsWidgetInst* widget = inst;
|
||||
|
||||
view_holder_stop(widget->view_holder);
|
||||
view_holder_set_view(widget->view_holder, NULL);
|
||||
view_holder_free(widget->view_holder);
|
||||
widget->view_holder = NULL;
|
||||
|
||||
|
|
Loading…
Reference in a new issue