fix an issue the bbl printer not working

This commit is contained in:
SoftFever
2026-02-02 23:48:22 +08:00
parent 671760b9d4
commit 01a21ed1eb
3 changed files with 24 additions and 20 deletions

View File

@@ -487,24 +487,24 @@ void WebViewPanel::SendLoginInfo()
void WebViewPanel::ShowNetpluginTip()
{
// Install Network Plugin
const auto bblnetwork_enabled =wxGetApp().app_config->get_bool("installed_networking");
if(!bblnetwork_enabled) {
return;
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;
}
bool bValid = wxGetApp().is_compatibility_version();
int nShow = 0;
if (!bValid) nShow = 1;
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": need_show=%1%") % need_show;
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": bValid=%1%, nShow=%2%")%bValid %nShow;
json res = json::object();
res["command"] = "network_plugin_installtip";
res["sequence_id"] = "10001";
res["show"] = need_show ? 1 : 0;
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));
wxString strJS = wxString::Format("window.postMessage(%s)", res.dump(-1, ' ', false, json::error_handler_t::ignore));
RunScript(strJS);
}