Duet: Implement upload() (refactoring from old code)

This commit is contained in:
Vojtech Kral 2018-12-20 16:00:51 +01:00
parent f318536556
commit af08626398
6 changed files with 55 additions and 109 deletions

View file

@ -38,6 +38,16 @@ PrintHost* PrintHost::get_print_host(DynamicPrintConfig *config)
}
}
wxString PrintHost::format_error(const std::string &body, const std::string &error, unsigned status) const
{
if (status != 0) {
auto wxbody = wxString::FromUTF8(body.data());
return wxString::Format("HTTP %u: %s", status, wxbody);
} else {
return wxString::FromUTF8(error.data());
}
}
struct PrintHostJobQueue::priv
{