Add option to toggle between legacy and new network plugins

This commit is contained in:
Noisyfox
2025-05-01 16:23:56 +08:00
parent e4d8c2e440
commit 461d42635f
4 changed files with 26 additions and 0 deletions

View File

@@ -2516,6 +2516,20 @@ bool GUI_App::on_init_inner()
std::map<std::string, std::string> extra_headers = get_extra_header();
Slic3r::Http::set_extra_headers(extra_headers);
// Orca: select network plugin version
NetworkAgent::use_legacy_network = app_config->get_bool("legacy_networking");
// Force legacy network plugin if debugger attached
// See https://github.com/bambulab/BambuStudio/issues/6726
if (!NetworkAgent::use_legacy_network) {
bool debugger_attached = false;
#ifdef __WINDOWS__
debugger_attached = IsDebuggerPresent();
#endif
if (debugger_attached) {
NetworkAgent::use_legacy_network = true;
wxMessageBox("Force using legacy bambu networking plugin because debugger is attached! If the app terminates itself immediately, please delete installed plugin and try again!");
}
}
copy_network_if_available();
on_init_network();