Fixed a bug about setting password.

This commit is contained in:
xiaojiazhu 2023-10-26 17:48:11 +08:00
parent 6fec7f0960
commit 37aff7d963
2 changed files with 20 additions and 12 deletions

View File

@ -46,13 +46,13 @@ TMDEF_EMNU(gQrMenu, QR, Qr_MenuCallback)
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
int Qr_MenuCallback(UINT32 uiMessage, UINT32 uiParam) int Qr_MenuCallback(UINT32 uiMessage, UINT32 uiParam)
{ {
printf(" ====================================================== gQrMenu\n");
UINT16 uwItemId; UINT16 uwItemId;
// UINT16 uwOption; UINT16 uwOption;
UIMenuStoreInfo *puiPara = sf_ui_para_get();
if (uiMessage == TMM_CONFIRM_OPTION) if (uiMessage == TMM_CONFIRM_OPTION)
{ {
uwItemId = LO_WORD(uiParam); uwItemId = LO_WORD(uiParam);
// uwOption = HI_WORD(uiParam); uwOption = HI_WORD(uiParam);
switch (uwItemId) switch (uwItemId)
{ {
case IDM_NETWORK_SELECTION: case IDM_NETWORK_SELECTION:
@ -65,6 +65,8 @@ int Qr_MenuCallback(UINT32 uiMessage, UINT32 uiParam)
} }
case IDM_PASSWORD: case IDM_PASSWORD:
{ {
puiPara->PwdSwitch = uwOption;
printf("password switch %d\n", puiPara->PwdSwitch);
break; break;
} }
case IDM_CAMERA_NAME: case IDM_CAMERA_NAME:
@ -253,12 +255,12 @@ void hidde_qr_picture_page(void)
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
static int PasswordIndex = 0; static int PasswordIndex = 0;
static lv_obj_t* PasswordMatrixObj = NULL; static lv_obj_t* PasswordMatrixObj = NULL;
static char PasswordBuf1[2] = "0"; static char PasswordBuf1[2] = {'0', 0};
static char PasswordBuf2[2] = "0"; static char PasswordBuf2[2] = {'0', 0};
static char PasswordBuf3[2] = "0"; static char PasswordBuf3[2] = {'0', 0};
static char PasswordBuf4[2] = "0"; static char PasswordBuf4[2] = {'0', 0};
static char PasswordBuf5[2] = "0"; static char PasswordBuf5[2] = {'0', 0};
static char PasswordBuf6[2] = "0"; static char PasswordBuf6[2] = {'0', 0};
static const char* PasswordMap[7] = static const char* PasswordMap[7] =
{ {
PasswordBuf1, PasswordBuf1,
@ -291,7 +293,7 @@ void show_Password_page(lv_obj_t* obj)
init_Matrix_style(); init_Matrix_style();
UIMenuStoreInfo *puiPara = sf_ui_para_get(); UIMenuStoreInfo *puiPara = sf_ui_para_get();
if(!puiPara->PwdSwitch) // if(!puiPara->PwdSwitch)
{ {
memset(puiPara->PwdStr, '0' ,sizeof(puiPara->PwdStr)); memset(puiPara->PwdStr, '0' ,sizeof(puiPara->PwdStr));
} }

View File

@ -3,6 +3,7 @@
#include "GxStrg.h" #include "GxStrg.h"
#include "UIFlowLVGL/UIFlowLVGL.h" #include "UIFlowLVGL/UIFlowLVGL.h"
#include "UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgAPI.h" #include "UIFlowLVGL/UIFlowWrnMsg/UIFlowWrnMsgAPI.h"
#include "UIFlowLVGL/UIFlowPassword/UIFlowPasswordEventCallback.h"
#include <kwrap/debug.h> #include <kwrap/debug.h>
#include "SysMain.h" #include "SysMain.h"
#if (USE_DCF == ENABLE) #if (USE_DCF == ENABLE)
@ -1439,11 +1440,16 @@ static void UIFlowMovie_NVTMSG(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* m
void UIFlowMovieEventCallback(lv_obj_t* obj, lv_event_t event) void UIFlowMovieEventCallback(lv_obj_t* obj, lv_event_t event)
{ {
#define PASSWORD_SWITCH_ON 1
UIMenuStoreInfo *puiPara = sf_ui_para_get();
switch(event) switch(event)
{ {
case LV_PLUGIN_EVENT_SCR_OPEN: case LV_PLUGIN_EVENT_SCR_OPEN:
UIFlowMovie_ScrOpen(obj); UIFlowMovie_ScrOpen(obj);
if(PASSWORD_SWITCH_ON == puiPara->PwdSwitch)
{
OpenPasswordScreen();
}
#if HUNTING_CAMERA_MCU == ENABLE #if HUNTING_CAMERA_MCU == ENABLE
UIMenuStoreInfo *puiPara = sf_ui_para_get(); UIMenuStoreInfo *puiPara = sf_ui_para_get();
if((SF_CAM_MODE_VIDEO == puiPara->CamMode)) if((SF_CAM_MODE_VIDEO == puiPara->CamMode))
@ -1462,7 +1468,7 @@ void UIFlowMovieEventCallback(lv_obj_t* obj, lv_event_t event)
break; break;
case LV_EVENT_CLICKED: case LV_EVENT_CLICKED:
UIFlowMovie_OnKeyMenu(obj); // UIFlowMovie_OnKeyMenu(obj);
break; break;
case LV_EVENT_KEY: case LV_EVENT_KEY: