mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
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:
parent
3510158cd8
commit
f0f5c3bbe9
11 changed files with 157 additions and 7 deletions
|
@ -107,6 +107,9 @@ var LangText = {
|
||||||
t113: "You may change your choice in preference anytime.",
|
t113: "You may change your choice in preference anytime.",
|
||||||
orca1: "Edit Project Info",
|
orca1: "Edit Project Info",
|
||||||
orca2: "no model information",
|
orca2: "no model information",
|
||||||
|
orca3: "Stealth Mode",
|
||||||
|
orca4: "This stops the transmission of data to Bambu's cloud services. Users who don't use BBL machines or use LAN mode only can safely turn on this function.",
|
||||||
|
orca5: "Enable Stealth Mode.",
|
||||||
},
|
},
|
||||||
ca_ES: {
|
ca_ES: {
|
||||||
t1: "Benvingut a Orca Slicer",
|
t1: "Benvingut a Orca Slicer",
|
||||||
|
|
|
@ -100,7 +100,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="AcceptArea">
|
<div id="AcceptArea">
|
||||||
<div class="GrayBtn trans" id="PreBtn" tid="t8" onclick="window.open('../3/index.html','_self')">Back</div>
|
<div class="GrayBtn trans" id="PreBtn" tid="t8" onclick="window.open('../1/index.html','_self')">Back</div>
|
||||||
<div class="NormalBtn trans" id="AcceptBtn" tid="t9" onclick="GotoFilamentPage()">Next</div>
|
<div class="NormalBtn trans" id="AcceptBtn" tid="t9" onclick="GotoFilamentPage()">Next</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -562,7 +562,7 @@ function ReturnPreviewPage()
|
||||||
let nMode=m_ProfileItem["model"].length;
|
let nMode=m_ProfileItem["model"].length;
|
||||||
|
|
||||||
if( nMode==1)
|
if( nMode==1)
|
||||||
document.location.href="../3/index.html";
|
document.location.href="../1/index.html";
|
||||||
else
|
else
|
||||||
document.location.href="../21/index.html";
|
document.location.href="../21/index.html";
|
||||||
}
|
}
|
||||||
|
@ -573,7 +573,7 @@ function GotoNetPluginPage()
|
||||||
let bRet=ResponseFilamentResult();
|
let bRet=ResponseFilamentResult();
|
||||||
|
|
||||||
if(bRet)
|
if(bRet)
|
||||||
window.location.href="../5/index.html";
|
window.location.href="../4orca/index.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
function FinishGuide()
|
function FinishGuide()
|
||||||
|
|
33
resources/web/guide/4orca/4orca.css
Normal file
33
resources/web/guide/4orca/4orca.css
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
|
||||||
|
#Content
|
||||||
|
{
|
||||||
|
padding:0% 15%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#FeatureText
|
||||||
|
{
|
||||||
|
line-height: 30px;
|
||||||
|
margin-top: 10mm;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#CheckArea
|
||||||
|
{
|
||||||
|
margin-top:10mm;
|
||||||
|
line-height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#StealthMode
|
||||||
|
{
|
||||||
|
width: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#RestartText
|
||||||
|
{
|
||||||
|
padding-left:30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.TextPoint
|
||||||
|
{
|
||||||
|
font-size:14px;
|
||||||
|
}
|
48
resources/web/guide/4orca/4orca.js
Normal file
48
resources/web/guide/4orca/4orca.js
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
|
||||||
|
function OnInit()
|
||||||
|
{
|
||||||
|
TranslatePage();
|
||||||
|
|
||||||
|
SendStealthModeCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function SendStealthModeCheck()
|
||||||
|
{
|
||||||
|
let nVal="no";
|
||||||
|
if( $('#StealthMode').is(':checked') )
|
||||||
|
nVal="yes";
|
||||||
|
|
||||||
|
var tSend={};
|
||||||
|
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||||
|
tSend['command']="save_stealth_mode";
|
||||||
|
tSend['data']={};
|
||||||
|
tSend['data']['action']=nVal;
|
||||||
|
|
||||||
|
SendWXMessage( JSON.stringify(tSend) );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GotoNetPluginPage()
|
||||||
|
{
|
||||||
|
let bRet=SendStealthModeCheck();
|
||||||
|
|
||||||
|
if(bRet)
|
||||||
|
window.location.href="../5/index.html";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function FinishGuide()
|
||||||
|
{
|
||||||
|
var tSend={};
|
||||||
|
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||||
|
tSend['command']="user_guide_finish";
|
||||||
|
tSend['data']={};
|
||||||
|
tSend['data']['action']="finish";
|
||||||
|
|
||||||
|
SendWXMessage( JSON.stringify(tSend) );
|
||||||
|
|
||||||
|
//window.location.href="../6/index.html";
|
||||||
|
}
|
38
resources/web/guide/4orca/index.html
Normal file
38
resources/web/guide/4orca/index.html
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||||
|
<title>引导_P1</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../css/common.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../css/dark.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="4orca.css" />
|
||||||
|
<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/json2.js"></script>
|
||||||
|
<script type="text/javascript" src="../../data/text.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/globalapi.js"></script>
|
||||||
|
<script type="text/javascript" src="../js/common.js"></script>
|
||||||
|
<script type="text/javascript" src="4orca.js"></script>
|
||||||
|
</head>
|
||||||
|
<body onLoad="OnInit()">
|
||||||
|
<div id="Title">
|
||||||
|
<div class="trans" tid="orca3">Stealth Mode</div>
|
||||||
|
</div>
|
||||||
|
<div id="Content">
|
||||||
|
|
||||||
|
<div id="FeatureText">
|
||||||
|
<div><a tid="orca4" class="trans TextS1">This stops the transmission of data to Bambu's cloud services. Users who don't use BBL machines or use LAN mode only can safely turn on this function.</a></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="CheckArea"><input id="StealthMode" onClick="SendStealthModeCheck()" type="checkbox"><a tid="orca5" class="trans TextS1">Enable Stealth Mode.</a></div>
|
||||||
|
<div id="RestartText" tid="t70" class="trans" ></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="AcceptArea">
|
||||||
|
<div class="GrayBtn trans" tid="t8" id="PreBtn" onclick="window.history.back()">Back</div>
|
||||||
|
<div class="NormalBtn trans" tid="t9" id="GotoNetPluginBtn" onclick="GotoNetPluginPage()">Next</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -81,6 +81,15 @@ std::string AppConfig::get_hms_host()
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AppConfig::get_stealth_mode()
|
||||||
|
{
|
||||||
|
// always return true when user did not finish setup wizard yet
|
||||||
|
if (!get_bool("firstguide","finish")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return get_bool("stealth_mode");
|
||||||
|
}
|
||||||
|
|
||||||
void AppConfig::reset()
|
void AppConfig::reset()
|
||||||
{
|
{
|
||||||
m_storage.clear();
|
m_storage.clear();
|
||||||
|
|
|
@ -45,6 +45,7 @@ public:
|
||||||
|
|
||||||
std::string get_language_code();
|
std::string get_language_code();
|
||||||
std::string get_hms_host();
|
std::string get_hms_host();
|
||||||
|
bool get_stealth_mode();
|
||||||
|
|
||||||
// Clear and reset to defaults.
|
// Clear and reset to defaults.
|
||||||
void reset();
|
void reset();
|
||||||
|
@ -80,8 +81,10 @@ public:
|
||||||
{ std::string value; this->get(section, key, value); return value; }
|
{ std::string value; this->get(section, key, value); return value; }
|
||||||
std::string get(const std::string &key) const
|
std::string get(const std::string &key) const
|
||||||
{ std::string value; this->get("app", key, value); return value; }
|
{ std::string value; this->get("app", key, value); return value; }
|
||||||
|
bool get_bool(const std::string §ion, const std::string &key) const
|
||||||
|
{ return this->get(section, key) == "true" || this->get(key) == "1"; }
|
||||||
bool get_bool(const std::string &key) const
|
bool get_bool(const std::string &key) const
|
||||||
{ return this->get(key) == "true" || this->get(key) == "1"; }
|
{ return this->get_bool("app", key); }
|
||||||
void set(const std::string §ion, const std::string &key, const std::string &value)
|
void set(const std::string §ion, const std::string &key, const std::string &value)
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
|
@ -940,7 +940,7 @@ void GUI_App::post_init()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (app_config->get("stealth_mode") == "false")
|
if (!app_config->get_stealth_mode())
|
||||||
hms_query = new HMSQuery();
|
hms_query = new HMSQuery();
|
||||||
|
|
||||||
m_show_gcode_window = app_config->get_bool("show_gcode_window");
|
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->preset_updater->sync(http_url, language, network_ver, sys_preset ? preset_bundle : nullptr);
|
||||||
|
|
||||||
this->check_new_version_sf();
|
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);
|
// this->check_privacy_version(0);
|
||||||
request_user_handle(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)
|
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";
|
std::string platform = "windows";
|
||||||
|
|
||||||
#ifdef __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)
|
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;
|
return;
|
||||||
|
|
||||||
if (!m_agent || !m_agent->is_user_login()) return;
|
if (!m_agent || !m_agent->is_user_login()) return;
|
||||||
|
|
|
@ -109,6 +109,7 @@ GuideFrame::GuideFrame(GUI_App *pGUI, long style)
|
||||||
// INI
|
// INI
|
||||||
m_SectionName = "firstguide";
|
m_SectionName = "firstguide";
|
||||||
PrivacyUse = false;
|
PrivacyUse = false;
|
||||||
|
StealthMode = false;
|
||||||
InstallNetplugin = false;
|
InstallNetplugin = false;
|
||||||
|
|
||||||
m_MainPtr = pGUI;
|
m_MainPtr = pGUI;
|
||||||
|
@ -486,6 +487,15 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt)
|
||||||
else
|
else
|
||||||
InstallNetplugin = false;
|
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) {
|
} catch (std::exception &e) {
|
||||||
// wxMessageBox(e.what(), "json Exception", MB_OK);
|
// wxMessageBox(e.what(), "json Exception", MB_OK);
|
||||||
BOOST_LOG_TRIVIAL(trace) << "GuideFrame::OnScriptMessage;Error:" << e.what();
|
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(std::string(m_SectionName.mb_str()), "privacyuse", "0");
|
||||||
|
|
||||||
m_MainPtr->app_config->set("region", m_Region);
|
m_MainPtr->app_config->set("region", m_Region);
|
||||||
|
m_MainPtr->app_config->set_bool("stealth_mode", StealthMode);
|
||||||
|
|
||||||
//finish
|
//finish
|
||||||
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");
|
||||||
|
@ -1222,6 +1233,9 @@ int GuideFrame::LoadProfile()
|
||||||
m_ProfileJson["network_plugin_install"] = wxGetApp().app_config->get("app","installed_networking");
|
m_ProfileJson["network_plugin_install"] = wxGetApp().app_config->get("app","installed_networking");
|
||||||
m_ProfileJson["network_plugin_compability"] = wxGetApp().is_compatibility_version() ? "1" : "0";
|
m_ProfileJson["network_plugin_compability"] = wxGetApp().is_compatibility_version() ? "1" : "0";
|
||||||
network_plugin_ready = wxGetApp().is_compatibility_version();
|
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) {
|
catch (std::exception &e) {
|
||||||
//wxLogMessage("GUIDE: load_profile_error %s ", e.what());
|
//wxLogMessage("GUIDE: load_profile_error %s ", e.what());
|
||||||
|
|
|
@ -109,6 +109,7 @@ private:
|
||||||
|
|
||||||
// User Config
|
// User Config
|
||||||
bool PrivacyUse;
|
bool PrivacyUse;
|
||||||
|
bool StealthMode;
|
||||||
std::string m_Region;
|
std::string m_Region;
|
||||||
|
|
||||||
bool InstallNetplugin;
|
bool InstallNetplugin;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue