mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-18 14:32:36 +00:00
Revert unrelated Stealth mode and cloud login changes
This commit is contained in:
@@ -86,17 +86,8 @@ std::string AppConfig::get_hms_host()
|
||||
|
||||
bool AppConfig::get_stealth_mode()
|
||||
{
|
||||
// Before the setup wizard has been completed the user has not been asked whether the app may
|
||||
// use the network, so default to no. Signing in to a cloud account IS that answer, though, and
|
||||
// the latch must not survive it: a user who closes the wizard and logs in from the account menu
|
||||
// — the workaround people share for the wizard never offering login — otherwise gets every
|
||||
// cloud feature silently switched off. No post-login sync prompt, no user presets fetched, and
|
||||
// "Sync Presets" greyed out with nothing to say why, because on_user_login_handle() returns
|
||||
// early on stealth. Upstream #15239.
|
||||
//
|
||||
// This releases the pre-wizard DEFAULT only. An explicit Stealth mode setting still wins, so a
|
||||
// user who deliberately turned it on stays offline whether or not they are signed in.
|
||||
if (!m_cloud_logged_in && !get_bool("firstguide","finish")) {
|
||||
// always return true when user did not finish setup wizard yet
|
||||
if (!get_bool("firstguide","finish")) {
|
||||
return true;
|
||||
}
|
||||
return get_bool("stealth_mode");
|
||||
|
||||
@@ -105,13 +105,6 @@ public:
|
||||
std::string get_language_code();
|
||||
std::string get_hms_host();
|
||||
bool get_stealth_mode();
|
||||
// The user's OWN Stealth mode setting, without the pre-wizard default that get_stealth_mode()
|
||||
// applies. Use this wherever "the wizard is unfinished" must not count as stealth — blocking
|
||||
// sign-in above all, since signing in is how a user leaves that state in the first place.
|
||||
bool get_stealth_mode_setting() { return get_bool("stealth_mode"); }
|
||||
// Session state, not a setting: mirrors whether a cloud account is currently signed in, so
|
||||
// get_stealth_mode() can tell "the user has not been asked yet" from "the user said no".
|
||||
void set_cloud_logged_in(bool logged_in) { m_cloud_logged_in = logged_in; }
|
||||
bool get_hide_login_side_panel();
|
||||
|
||||
// Clear and reset to defaults.
|
||||
@@ -449,9 +442,6 @@ private:
|
||||
Semver m_orig_version;
|
||||
// Whether the existing version is before system profiles & configuration updating
|
||||
bool m_legacy_datadir;
|
||||
// A cloud account is signed in right now. Deliberately NOT persisted: it is mirrored from the
|
||||
// network agent on login/logout, so a stale value cannot outlive the session that set it.
|
||||
bool m_cloud_logged_in{false};
|
||||
|
||||
std::string m_loading_path;
|
||||
|
||||
|
||||
@@ -3848,10 +3848,6 @@ bool GUI_App::on_init_network(bool try_backup)
|
||||
std::string country_code = app_config->get_country_code();
|
||||
m_agent->set_country_code(country_code);
|
||||
m_agent->start();
|
||||
// A session restored from a saved token fires no login event, so seed the flag here too —
|
||||
// otherwise the pre-wizard stealth default would come back on the next launch for a user
|
||||
// who is already signed in.
|
||||
app_config->set_cloud_logged_in(m_agent->is_user_login(ORCA_CLOUD_PROVIDER));
|
||||
// Orca: disable Bambu telemetry up-front (before any login) so it never starts.
|
||||
check_track_enable();
|
||||
}
|
||||
@@ -5027,7 +5023,6 @@ void GUI_App::request_user_logout(const std::string& provider/* = ORCA_CLOUD_PRO
|
||||
{
|
||||
if (m_agent && m_agent->is_user_login(provider)) {
|
||||
m_agent->user_logout(true, provider);
|
||||
app_config->set_cloud_logged_in(m_agent->is_user_login(ORCA_CLOUD_PROVIDER));
|
||||
|
||||
if (provider == get_printer_cloud_provider()) {
|
||||
m_agent->set_user_selected_machine("");
|
||||
@@ -5104,12 +5099,7 @@ std::string GUI_App::handle_web_request(std::string cmd)
|
||||
});
|
||||
return "";
|
||||
}
|
||||
// The user's own setting only. Blocking sign-in because the setup wizard is unfinished
|
||||
// is backwards — signing in is how you leave that state — and it told a user who had
|
||||
// never touched the toggle "You are currently in Stealth Mode", then offered a Quit
|
||||
// button that writes stealth_mode=false when it was already false and leaves the
|
||||
// pre-wizard default exactly where it was.
|
||||
if (app_config->get_stealth_mode_setting() && stealth_blocked_login_commands.count(command_str)) {
|
||||
if (app_config->get_stealth_mode() && stealth_blocked_login_commands.count(command_str)) {
|
||||
CallAfter([this, command_str] {
|
||||
MessageDialog dlg(mainframe,
|
||||
_L("You are currently in Stealth Mode. To log into the Cloud, you need to disable Stealth Mode first."),
|
||||
@@ -5618,12 +5608,6 @@ void GUI_App::on_update_machine_list(wxCommandEvent &evt)
|
||||
void GUI_App::on_user_login_handle(wxCommandEvent &evt)
|
||||
{
|
||||
if (!m_agent) { return; }
|
||||
// Tell AppConfig a cloud account is signed in BEFORE asking about stealth: an unfinished setup
|
||||
// wizard makes get_stealth_mode() report stealth by default, and without this the early return
|
||||
// below would swallow the whole post-login flow — presets, plugins and the sync prompt — for
|
||||
// anyone who closed the wizard and signed in afterwards. An explicit Stealth mode setting is
|
||||
// unaffected and still returns here.
|
||||
app_config->set_cloud_logged_in(m_agent->is_user_login(ORCA_CLOUD_PROVIDER));
|
||||
if (app_config->get_stealth_mode()) {
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": stealth mode enabled, skipping cloud connection";
|
||||
return;
|
||||
|
||||
@@ -3429,22 +3429,14 @@ void MainFrame::init_menubar_as_editor()
|
||||
info_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
if (wxGetApp().app_config->get_stealth_mode()) {
|
||||
MessageDialog info_dlg(this,
|
||||
_L("Stealth mode is on, so Orca Cloud syncing is switched off. "
|
||||
"Turn Stealth mode off in Preferences to sync your presets."),
|
||||
_L("Sync Presets"), wxOK | wxICON_INFORMATION);
|
||||
info_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
if (m_plater)
|
||||
m_plater->get_notification_manager()->push_notification(
|
||||
into_u8(_L("Syncing presets from cloud\u2026")));
|
||||
wxGetApp().restart_sync_user_preset();
|
||||
}, "", nullptr,
|
||||
// Stays ENABLED whatever the cloud state: both refusals above name their reason, and a
|
||||
// greyed-out item names none. A user who could not sync had no way to find out why.
|
||||
[]() { return true; }, this);
|
||||
[this]() {
|
||||
return wxGetApp().is_user_login() && !wxGetApp().app_config->get_stealth_mode();
|
||||
}, this);
|
||||
|
||||
top_menu->AppendSeparator();
|
||||
append_menu_item(
|
||||
@@ -3574,22 +3566,14 @@ void MainFrame::init_menubar_as_editor()
|
||||
info_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
if (wxGetApp().app_config->get_stealth_mode()) {
|
||||
MessageDialog info_dlg(this,
|
||||
_L("Stealth mode is on, so Orca Cloud syncing is switched off. "
|
||||
"Turn Stealth mode off in Preferences to sync your presets."),
|
||||
_L("Sync Presets"), wxOK | wxICON_INFORMATION);
|
||||
info_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
if (m_plater)
|
||||
m_plater->get_notification_manager()->push_notification(
|
||||
into_u8(_L("Syncing presets from cloud\u2026")));
|
||||
wxGetApp().restart_sync_user_preset();
|
||||
}, "", nullptr,
|
||||
// Stays ENABLED whatever the cloud state: both refusals above name their reason, and a
|
||||
// greyed-out item names none. A user who could not sync had no way to find out why.
|
||||
[]() { return true; }, this);
|
||||
[this]() {
|
||||
return wxGetApp().is_user_login() && !wxGetApp().app_config->get_stealth_mode();
|
||||
}, this);
|
||||
|
||||
fileMenu->AppendSeparator();
|
||||
append_menu_item(
|
||||
|
||||
Reference in New Issue
Block a user