mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-01 02:22:03 +08:00
Don't check the content of repetier server name
supermerill/SuperSlicer#1376 Also don't crash on identification error
This commit is contained in:
parent
4d947212f4
commit
d0c3cc5553
@ -271,6 +271,7 @@ void PhysicalPrinterDialog::update_printers()
|
||||
|
||||
wxArrayString printers;
|
||||
Field* rs = m_optgroup->get_field("printhost_port");
|
||||
try {
|
||||
if (!host->get_printers(printers)) {
|
||||
std::vector<std::string> slugs;
|
||||
|
||||
@ -297,6 +298,9 @@ void PhysicalPrinterDialog::update_printers()
|
||||
}
|
||||
rs->enable();
|
||||
}
|
||||
} catch (HostNetworkError error) {
|
||||
show_error(this, error.what());
|
||||
}
|
||||
}
|
||||
|
||||
void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgroup)
|
||||
|
@ -63,10 +63,13 @@ bool Repetier::test(wxString &msg) const
|
||||
pt::ptree ptree;
|
||||
pt::read_json(ss, ptree);
|
||||
|
||||
const auto text = ptree.get_optional<std::string>("name");
|
||||
res = validate_version_text(text);
|
||||
if (! res) {
|
||||
msg = GUI::from_u8((boost::format(_u8L("Mismatched type of print host: %s")) % (text ? *text : "Repetier")).str());
|
||||
res = ptree.get_optional<std::string>("name").has_value();
|
||||
if (!res)
|
||||
msg = GUI::from_u8((boost::format(_u8L("Can't process the repetier return message: missing field '%s'")) % ("name")).str());
|
||||
else {
|
||||
res = ptree.get_optional<std::string>("printers").has_value();
|
||||
if (!res)
|
||||
msg = GUI::from_u8((boost::format(_u8L("Can't process the repetier return message: missing field '%s'")) % ("printers")).str());
|
||||
}
|
||||
}
|
||||
catch (const std::exception &) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user