mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-11 14:33:04 +00:00
Merge branch '2.2.3' into dev_upgrade_alves
This commit is contained in:
@@ -4043,13 +4043,18 @@ wxString GUI_App::get_international_url(const wxString& origin_url) {
|
||||
|
||||
string dark_mode = wxGetApp().app_config->get("dark_color_mode");
|
||||
|
||||
auto isAgree = wxGetApp().app_config->get("app", "privacy_policy_isagree");
|
||||
std::string useAgree = (isAgree == "true" ? "1" : "0");
|
||||
|
||||
if (baseUrl.find("?") != std::string::npos) {
|
||||
return baseUrl + wxString::FromUTF8("&locale=") + lang + wxString::FromUTF8("-") + region +
|
||||
wxString::FromUTF8("&dark_mode=" + dark_mode);
|
||||
wxString::FromUTF8("&dark_mode=" + dark_mode) + wxString::FromUTF8("&privacy_policy_isagree=" + useAgree);
|
||||
} else {
|
||||
return baseUrl + wxString::FromUTF8("?locale=") + lang + wxString::FromUTF8("-") + region +
|
||||
wxString::FromUTF8("&dark_mode=" + dark_mode);
|
||||
wxString::FromUTF8("&dark_mode=" + dark_mode) + wxString::FromUTF8("&privacy_policy_isagree=" + useAgree);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool GUI_App::is_user_login()
|
||||
@@ -6713,7 +6718,7 @@ bool GUI_App::run_wizard(ConfigWizard::RunReason reason, ConfigWizard::StartPage
|
||||
}
|
||||
auto isAgree = wxGetApp().app_config->get("app", "privacy_policy_isagree");
|
||||
|
||||
set_privacy_policy(isAgree == "true");
|
||||
user_update_privacy_notify(isAgree == "true");
|
||||
BOOST_LOG_TRIVIAL(warning) << "run_wizard changed the privacy policy with: " << (isAgree);
|
||||
return res;
|
||||
}
|
||||
@@ -6918,6 +6923,23 @@ void GUI_App::cache_notify(const std::string& key, const json& res)
|
||||
}
|
||||
}
|
||||
|
||||
void GUI_App::user_update_privacy_notify(const bool& res)
|
||||
{
|
||||
set_privacy_policy(res);
|
||||
|
||||
json data;
|
||||
|
||||
data["privacy_policy_isagree"] = res;
|
||||
|
||||
for (const auto& instance : m_user_update_privacy_subscribers) {
|
||||
auto ptr = instance.second.lock();
|
||||
if (ptr) {
|
||||
ptr->m_res_data = data;
|
||||
ptr->send_to_js();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void GUI_App::user_login_notify(const json& res)
|
||||
{
|
||||
@@ -6933,7 +6955,7 @@ void GUI_App::user_login_notify(const json& res)
|
||||
bool GUI_App::config_wizard_startup()
|
||||
{
|
||||
auto isAgree = wxGetApp().app_config->get("app", "privacy_policy_isagree");
|
||||
set_privacy_policy(isAgree == "true");
|
||||
user_update_privacy_notify(isAgree == "true");
|
||||
BOOST_LOG_TRIVIAL(warning) << "config_wizard_startup changed the privacy policy with: " << (isAgree);
|
||||
if (!m_app_conf_exists || preset_bundle->printers.only_default_printers()) {
|
||||
BOOST_LOG_TRIVIAL(info) << "run wizard...";
|
||||
|
||||
Reference in New Issue
Block a user