feat: add stealth mode select step to setup wizard (#6104)

feat: add stealth mode select to setup wizard

feat: enable stealth mode until user finishes setup wizard

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Pim 2024-07-31 13:51:07 +02:00 committed by GitHub
parent 3510158cd8
commit f0f5c3bbe9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 157 additions and 7 deletions

View file

@ -940,7 +940,7 @@ void GUI_App::post_init()
}
#endif
if (app_config->get("stealth_mode") == "false")
if (!app_config->get_stealth_mode())
hms_query = new HMSQuery();
m_show_gcode_window = app_config->get_bool("show_gcode_window");
@ -971,7 +971,7 @@ void GUI_App::post_init()
this->preset_updater->sync(http_url, language, network_ver, sys_preset ? preset_bundle : nullptr);
this->check_new_version_sf();
if (is_user_login() && app_config->get("stealth_mode") == "false") {
if (is_user_login() && !app_config->get_stealth_mode()) {
// this->check_privacy_version(0);
request_user_handle(0);
}
@ -4141,6 +4141,7 @@ void GUI_App::check_update(bool show_tips, int by_user)
void GUI_App::check_new_version(bool show_tips, int by_user)
{
return; // orca: not used, see check_new_version_sf
std::string platform = "windows";
#ifdef __WINDOWS__
@ -4674,7 +4675,7 @@ void GUI_App::sync_preset(Preset* preset)
void GUI_App::start_sync_user_preset(bool with_progress_dlg)
{
if (app_config->get("stealth_mode") == "true")
if (app_config->get_stealth_mode())
return;
if (!m_agent || !m_agent->is_user_login()) return;

View file

@ -109,6 +109,7 @@ GuideFrame::GuideFrame(GUI_App *pGUI, long style)
// INI
m_SectionName = "firstguide";
PrivacyUse = false;
StealthMode = false;
InstallNetplugin = false;
m_MainPtr = pGUI;
@ -486,6 +487,15 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt)
else
InstallNetplugin = false;
}
else if (strCmd == "save_stealth_mode") {
wxString strAction = j["data"]["action"];
if (strAction == "yes") {
StealthMode = true;
} else {
StealthMode = false;
}
}
} catch (std::exception &e) {
// wxMessageBox(e.what(), "json Exception", MB_OK);
BOOST_LOG_TRIVIAL(trace) << "GuideFrame::OnScriptMessage;Error:" << e.what();
@ -616,6 +626,7 @@ int GuideFrame::SaveProfile()
// m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "privacyuse", "0");
m_MainPtr->app_config->set("region", m_Region);
m_MainPtr->app_config->set_bool("stealth_mode", StealthMode);
//finish
m_MainPtr->app_config->set(std::string(m_SectionName.mb_str()), "finish", "1");
@ -1222,6 +1233,9 @@ int GuideFrame::LoadProfile()
m_ProfileJson["network_plugin_install"] = wxGetApp().app_config->get("app","installed_networking");
m_ProfileJson["network_plugin_compability"] = wxGetApp().is_compatibility_version() ? "1" : "0";
network_plugin_ready = wxGetApp().is_compatibility_version();
StealthMode = wxGetApp().app_config->get_bool("app","stealth_mode");
m_ProfileJson["stealth_mode"] = StealthMode;
}
catch (std::exception &e) {
//wxLogMessage("GUIDE: load_profile_error %s ", e.what());

View file

@ -109,6 +109,7 @@ private:
// User Config
bool PrivacyUse;
bool StealthMode;
std::string m_Region;
bool InstallNetplugin;