Repetier-Server: Enable "Start printing after upload" (#5351)
This commit is contained in:
parent
7ce13b4a26
commit
992031620e
@ -107,7 +107,7 @@ bool Repetier::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, Error
|
|||||||
|
|
||||||
bool res = true;
|
bool res = true;
|
||||||
|
|
||||||
auto url = make_url((boost::format("printer/model/%1%") % port).str());
|
auto url = upload_data.start_print?make_url((boost::format("printer/job/%1%") % port).str()):make_url((boost::format("printer/model/%1%") % port).str());
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(info) << boost::format("%1%: Uploading file %2% at %3%, filename: %4%, path: %5%, print: %6%, group: %7%")
|
BOOST_LOG_TRIVIAL(info) << boost::format("%1%: Uploading file %2% at %3%, filename: %4%, path: %5%, print: %6%, group: %7%")
|
||||||
% name
|
% name
|
||||||
@ -125,6 +125,10 @@ bool Repetier::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, Error
|
|||||||
http.form_add("group", upload_data.group);
|
http.form_add("group", upload_data.group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(upload_data.start_print) {
|
||||||
|
http.form_add("name", upload_filename.string());
|
||||||
|
}
|
||||||
|
|
||||||
http.form_add("a", "upload")
|
http.form_add("a", "upload")
|
||||||
.form_add_file("filename", upload_data.source_path.string(), upload_filename.string())
|
.form_add_file("filename", upload_data.source_path.string(), upload_filename.string())
|
||||||
.on_complete([&](std::string body, unsigned status) {
|
.on_complete([&](std::string body, unsigned status) {
|
||||||
|
@ -27,7 +27,7 @@ public:
|
|||||||
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
bool upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, ErrorFn error_fn) const override;
|
||||||
bool has_auto_discovery() const override { return false; }
|
bool has_auto_discovery() const override { return false; }
|
||||||
bool can_test() const override { return true; }
|
bool can_test() const override { return true; }
|
||||||
bool can_start_print() const override { return false; }
|
bool can_start_print() const override { return true; }
|
||||||
bool supports_multiple_printers() const override { return true; }
|
bool supports_multiple_printers() const override { return true; }
|
||||||
std::string get_host() const override { return host; }
|
std::string get_host() const override { return host; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user