1
0
Fork 0
mirror of https://github.com/CTCaer/hekate.git synced 2024-11-10 04:21:45 +00:00

nyx: Update AutoRCM status on eMMC restore

This commit is contained in:
CTCaer 2019-08-28 02:06:19 +03:00
parent 6159d94e5d
commit 9533dea124
4 changed files with 23 additions and 3 deletions

View file

@ -38,6 +38,7 @@ lv_style_t hint_small_style_white;
lv_style_t monospace_text; lv_style_t monospace_text;
lv_obj_t *payload_list; lv_obj_t *payload_list;
lv_obj_t *autorcm_btn;
lv_img_dsc_t *icon_switch; lv_img_dsc_t *icon_switch;
lv_img_dsc_t *icon_payload; lv_img_dsc_t *icon_payload;

View file

@ -18,6 +18,7 @@
#include "gui.h" #include "gui.h"
#include "gui_emmc_tools.h" #include "gui_emmc_tools.h"
#include "gui_tools.h"
#include "fe_emmc_tools.h" #include "fe_emmc_tools.h"
#include "../config/config.h" #include "../config/config.h"
#include "../hos/pkg1.h" #include "../hos/pkg1.h"
@ -156,6 +157,22 @@ static void _create_window_backup_restore(emmcPartType_t type, const char* win_l
restore_emmc_selected(type, &emmc_tool_gui_ctxt); restore_emmc_selected(type, &emmc_tool_gui_ctxt);
nyx_window_toggle_buttons(win, false); nyx_window_toggle_buttons(win, false);
// Refresh AutoRCM button.
if (emmc_btn_ctxt.restore && (type == PART_BOOT) && !emmc_btn_ctxt.raw_emummc)
{
if (get_autorcm_status(false))
lv_btn_set_state(autorcm_btn, LV_BTN_STATE_TGL_REL);
else
lv_btn_set_state(autorcm_btn, LV_BTN_STATE_REL);
nyx_generic_onoff_toggle(autorcm_btn);
if (h_cfg.rcm_patched)
{
lv_obj_set_click(autorcm_btn, false);
lv_btn_set_state(autorcm_btn, LV_BTN_STATE_INA);
}
}
} }
static lv_res_t _emmc_backup_buttons_decider(lv_obj_t *btn) static lv_res_t _emmc_backup_buttons_decider(lv_obj_t *btn)

View file

@ -44,7 +44,7 @@ extern void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_st
#pragma GCC push_options #pragma GCC push_options
#pragma GCC target ("thumb") #pragma GCC target ("thumb")
static bool _get_autorcm_status(bool change) bool get_autorcm_status(bool change)
{ {
u8 corr_mod_byte0; u8 corr_mod_byte0;
sdmmc_storage_t storage; sdmmc_storage_t storage;
@ -108,7 +108,7 @@ static lv_res_t _create_mbox_autorcm_status(lv_obj_t *btn)
lv_obj_t * mbox = lv_mbox_create(dark_bg, NULL); lv_obj_t * mbox = lv_mbox_create(dark_bg, NULL);
lv_mbox_set_recolor_text(mbox, true); lv_mbox_set_recolor_text(mbox, true);
bool enabled = _get_autorcm_status(true); bool enabled = get_autorcm_status(true);
if (enabled) if (enabled)
{ {
@ -820,7 +820,7 @@ static void _create_tab_tools_arc_autorcm(lv_theme_t *th, lv_obj_t *parent)
lv_btn_set_action(btn3, LV_BTN_ACTION_CLICK, _create_mbox_autorcm_status); lv_btn_set_action(btn3, LV_BTN_ACTION_CLICK, _create_mbox_autorcm_status);
// Set default state for AutoRCM and lock it out if patched unit. // Set default state for AutoRCM and lock it out if patched unit.
if (_get_autorcm_status(false)) if (get_autorcm_status(false))
lv_btn_set_state(btn3, LV_BTN_STATE_TGL_REL); lv_btn_set_state(btn3, LV_BTN_STATE_TGL_REL);
else else
lv_btn_set_state(btn3, LV_BTN_STATE_REL); lv_btn_set_state(btn3, LV_BTN_STATE_REL);
@ -831,6 +831,7 @@ static void _create_tab_tools_arc_autorcm(lv_theme_t *th, lv_obj_t *parent)
lv_obj_set_click(btn3, false); lv_obj_set_click(btn3, false);
lv_btn_set_state(btn3, LV_BTN_STATE_INA); lv_btn_set_state(btn3, LV_BTN_STATE_INA);
} }
autorcm_btn = btn3;
char *txt_buf = (char *)malloc(0x1000); char *txt_buf = (char *)malloc(0x1000);

View file

@ -21,5 +21,6 @@
void create_tab_tools(lv_theme_t *th, lv_obj_t *parent); void create_tab_tools(lv_theme_t *th, lv_obj_t *parent);
void sept_run_dump(); void sept_run_dump();
bool get_autorcm_status(bool change);
#endif #endif