From 5d121b12eef4ef58d617c5b0cbca5f81b1f21385 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Fri, 6 Feb 2026 09:18:52 +0800 Subject: [PATCH] Fix a regression where the login panel is displayed even when the plugin is disabled (#12185) Update GUI_App to show or hide the login panel based on the "installed_networking" setting. --- src/libslic3r/AppConfig.cpp | 4 ++++ src/slic3r/GUI/GUI_App.cpp | 6 +++++- src/slic3r/GUI/WebViewDialog.cpp | 28 ++++++++++++++-------------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index e963948d98..42767b7349 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -499,6 +499,10 @@ void AppConfig::set_defaults() set_bool("is_split_compound", false); } + if(get("installed_networking").empty()) { + set_bool("installed_networking", false); + } + // Remove legacy window positions/sizes erase("app", "main_frame_maximized"); erase("app", "main_frame_pos"); diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 1a3db613f9..6d328c490a 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4439,7 +4439,11 @@ void GUI_App::get_login_info() GUI::wxGetApp().run_script(strJS); } } - mainframe->m_webview->SetLoginPanelVisibility(true); + if(app_config->get_bool("installed_networking")) { + mainframe->m_webview->SetLoginPanelVisibility(true); + } else { + mainframe->m_webview->SetLoginPanelVisibility(false); + } } } diff --git a/src/slic3r/GUI/WebViewDialog.cpp b/src/slic3r/GUI/WebViewDialog.cpp index 46dddf3812..5d9301b7ca 100644 --- a/src/slic3r/GUI/WebViewDialog.cpp +++ b/src/slic3r/GUI/WebViewDialog.cpp @@ -487,24 +487,24 @@ void WebViewPanel::SendLoginInfo() void WebViewPanel::ShowNetpluginTip() { - const auto bblnetwork_enabled = wxGetApp().app_config->get_bool("installed_networking"); - - // Show tip if: plugin is enabled but incompatible, OR BBL printer selected but plugin not loaded - bool need_show = false; - if (bblnetwork_enabled) { - need_show = !wxGetApp().is_compatibility_version(); - } else if (wxGetApp().preset_bundle && wxGetApp().preset_bundle->is_bbl_vendor()) { - need_show = true; + // Install Network Plugin + const auto bblnetwork_enabled =wxGetApp().app_config->get_bool("installed_networking"); + if(!bblnetwork_enabled) { + return; } + bool bValid = wxGetApp().is_compatibility_version(); - BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": need_show=%1%") % need_show; + int nShow = 0; + if (!bValid) nShow = 1; - json res = json::object(); - res["command"] = "network_plugin_installtip"; - res["sequence_id"] = "10001"; - res["show"] = need_show ? 1 : 0; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": bValid=%1%, nShow=%2%")%bValid %nShow; - wxString strJS = wxString::Format("window.postMessage(%s)", res.dump(-1, ' ', false, json::error_handler_t::ignore)); + json m_Res = json::object(); + m_Res["command"] = "network_plugin_installtip"; + m_Res["sequence_id"] = "10001"; + m_Res["show"] = nShow; + + wxString strJS = wxString::Format("window.postMessage(%s)", m_Res.dump(-1, ' ', false, json::error_handler_t::ignore)); RunScript(strJS); }