mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
fix an issue the bbl printer not working
This commit is contained in:
@@ -3482,12 +3482,16 @@ void GUI_App::switch_printer_agent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Read printer_agent from config, falling back to default
|
// Read printer_agent from config, falling back to default
|
||||||
const DynamicPrintConfig& config = preset_bundle->printers.get_edited_preset().config;
|
|
||||||
std::string effective_agent_id = ORCA_PRINTER_AGENT_ID;
|
std::string effective_agent_id = ORCA_PRINTER_AGENT_ID;
|
||||||
if (config.has("printer_agent")) {
|
if (preset_bundle->is_bbl_vendor()) {
|
||||||
const std::string& value = config.option<ConfigOptionString>("printer_agent")->value;
|
effective_agent_id = BBL_PRINTER_AGENT_ID;
|
||||||
if (!value.empty())
|
} else {
|
||||||
effective_agent_id = value;
|
const DynamicPrintConfig& config = preset_bundle->printers.get_edited_preset().config;
|
||||||
|
if (config.has("printer_agent")) {
|
||||||
|
const std::string& value = config.option<ConfigOptionString>("printer_agent")->value;
|
||||||
|
if (!value.empty())
|
||||||
|
effective_agent_id = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if agent is registered
|
// Check if agent is registered
|
||||||
|
|||||||
@@ -9826,7 +9826,7 @@ void Plater::priv::on_tab_selection_changing(wxBookCtrlEvent& e)
|
|||||||
update_sidebar();
|
update_sidebar();
|
||||||
int old_sel = e.GetOldSelection();
|
int old_sel = e.GetOldSelection();
|
||||||
if (wxGetApp().preset_bundle && wxGetApp().preset_bundle->use_bbl_device_tab() && new_sel == MainFrame::tpMonitor) {
|
if (wxGetApp().preset_bundle && wxGetApp().preset_bundle->use_bbl_device_tab() && new_sel == MainFrame::tpMonitor) {
|
||||||
if (!wxGetApp().getAgent()) {
|
if (!Slic3r::NetworkAgent::is_network_module_loaded()) {
|
||||||
e.Veto();
|
e.Veto();
|
||||||
BOOST_LOG_TRIVIAL(info) << boost::format("skipped tab switch from %1% to %2%, lack of network plugins") % old_sel % new_sel;
|
BOOST_LOG_TRIVIAL(info) << boost::format("skipped tab switch from %1% to %2%, lack of network plugins") % old_sel % new_sel;
|
||||||
if (q) {
|
if (q) {
|
||||||
|
|||||||
@@ -487,24 +487,24 @@ void WebViewPanel::SendLoginInfo()
|
|||||||
|
|
||||||
void WebViewPanel::ShowNetpluginTip()
|
void WebViewPanel::ShowNetpluginTip()
|
||||||
{
|
{
|
||||||
// Install Network Plugin
|
const auto bblnetwork_enabled = wxGetApp().app_config->get_bool("installed_networking");
|
||||||
const auto bblnetwork_enabled =wxGetApp().app_config->get_bool("installed_networking");
|
|
||||||
if(!bblnetwork_enabled) {
|
// Show tip if: plugin is enabled but incompatible, OR BBL printer selected but plugin not loaded
|
||||||
return;
|
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;
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": need_show=%1%") % need_show;
|
||||||
if (!bValid) nShow = 1;
|
|
||||||
|
|
||||||
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();
|
wxString strJS = wxString::Format("window.postMessage(%s)", res.dump(-1, ' ', false, json::error_handler_t::ignore));
|
||||||
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);
|
RunScript(strJS);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user