ENH: Fix some possible issues when enter/exit user guide

JIRA: none
Change-Id: I1598e31fc1c4475f1a6cc63f2ff5036517a8456f
This commit is contained in:
zorro.zhang 2025-04-14 17:04:02 +08:00 committed by lane.wei
parent 994a2c3fdd
commit fdb2fafb52
2 changed files with 14 additions and 6 deletions

View File

@ -108,7 +108,10 @@ GuideFrame::GuideFrame(GUI_App *pGUI, long style)
SetBackgroundColour(*wxWHITE);
// INI
m_SectionName = "firstguide";
PrivacyUse = true;
m_PrivacyUse = "";
m_PrivacyUse = wxGetApp().app_config->get(std::string(m_SectionName.mb_str()), "privacyuse");
m_GuideFinish = false;
InstallNetplugin = false;
m_MainPtr = pGUI;
@ -389,10 +392,12 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt)
wxString strAction = j["data"]["action"];
if (strAction == "agree") {
PrivacyUse = true;
m_PrivacyUse = "true";
} else {
PrivacyUse = false;
m_PrivacyUse = "false";
}
m_GuideFinish = true;
}
else if (strCmd == "request_userguide_profile") {
json m_Res = json::object();
@ -627,14 +632,16 @@ bool GuideFrame::IsFirstUse()
int GuideFrame::SaveProfile()
{
//privacy
if (PrivacyUse == true) {
if (m_PrivacyUse == "true") {
m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "privacyuse", true);
} else
}
else if (m_PrivacyUse == "false")
m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "privacyuse", false);
m_MainPtr->app_config->set("region", m_Region);
//finish
if (m_GuideFinish)
m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "finish", "1");
m_MainPtr->app_config->save();

View File

@ -114,7 +114,8 @@ private:
boost::thread* m_load_task{ nullptr };
// User Config
bool PrivacyUse;
bool m_GuideFinish;
std::string m_PrivacyUse;
std::string m_Region;
bool InstallNetplugin;