ENH: Fix some possible issues when enter/exit user guide
JIRA: none Change-Id: I1598e31fc1c4475f1a6cc63f2ff5036517a8456f
This commit is contained in:
parent
994a2c3fdd
commit
fdb2fafb52
|
@ -108,7 +108,10 @@ GuideFrame::GuideFrame(GUI_App *pGUI, long style)
|
||||||
SetBackgroundColour(*wxWHITE);
|
SetBackgroundColour(*wxWHITE);
|
||||||
// INI
|
// INI
|
||||||
m_SectionName = "firstguide";
|
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;
|
InstallNetplugin = false;
|
||||||
|
|
||||||
m_MainPtr = pGUI;
|
m_MainPtr = pGUI;
|
||||||
|
@ -389,10 +392,12 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt)
|
||||||
wxString strAction = j["data"]["action"];
|
wxString strAction = j["data"]["action"];
|
||||||
|
|
||||||
if (strAction == "agree") {
|
if (strAction == "agree") {
|
||||||
PrivacyUse = true;
|
m_PrivacyUse = "true";
|
||||||
} else {
|
} else {
|
||||||
PrivacyUse = false;
|
m_PrivacyUse = "false";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_GuideFinish = true;
|
||||||
}
|
}
|
||||||
else if (strCmd == "request_userguide_profile") {
|
else if (strCmd == "request_userguide_profile") {
|
||||||
json m_Res = json::object();
|
json m_Res = json::object();
|
||||||
|
@ -627,14 +632,16 @@ bool GuideFrame::IsFirstUse()
|
||||||
int GuideFrame::SaveProfile()
|
int GuideFrame::SaveProfile()
|
||||||
{
|
{
|
||||||
//privacy
|
//privacy
|
||||||
if (PrivacyUse == true) {
|
if (m_PrivacyUse == "true") {
|
||||||
m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "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(std::string(m_SectionName.mb_str()), "privacyuse", false);
|
||||||
|
|
||||||
m_MainPtr->app_config->set("region", m_Region);
|
m_MainPtr->app_config->set("region", m_Region);
|
||||||
|
|
||||||
//finish
|
//finish
|
||||||
|
if (m_GuideFinish)
|
||||||
m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "finish", "1");
|
m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "finish", "1");
|
||||||
|
|
||||||
m_MainPtr->app_config->save();
|
m_MainPtr->app_config->save();
|
||||||
|
|
|
@ -114,7 +114,8 @@ private:
|
||||||
boost::thread* m_load_task{ nullptr };
|
boost::thread* m_load_task{ nullptr };
|
||||||
|
|
||||||
// User Config
|
// User Config
|
||||||
bool PrivacyUse;
|
bool m_GuideFinish;
|
||||||
|
std::string m_PrivacyUse;
|
||||||
std::string m_Region;
|
std::string m_Region;
|
||||||
|
|
||||||
bool InstallNetplugin;
|
bool InstallNetplugin;
|
||||||
|
|
Loading…
Reference in New Issue