Host upload backwards compatibility

* Added legacy code to preserve backwards compatibility
* renamed some cli option names  to better match option names
This commit is contained in:
Martin Loidl 2018-08-20 20:19:22 +02:00 committed by Vojtech Kral
parent d4b73701d9
commit ee9f7eaef6
2 changed files with 11 additions and 5 deletions

View file

@ -1007,8 +1007,8 @@ max_layer_height = 0.25
min_layer_height = 0.07 min_layer_height = 0.07
max_print_height = 200 max_print_height = 200
nozzle_diameter = 0.4 nozzle_diameter = 0.4
printhost_apikey = octoprint_apikey =
print_host = octoprint_host =
printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MK2\n printer_notes = Don't remove the following keywords! These keywords are used in the "compatible printer" condition of the print and filament profiles to link the particular print and filament profiles to this printer profile.\nPRINTER_VENDOR_PRUSA3D\nPRINTER_MODEL_MK2\n
printer_settings_id = printer_settings_id =
retract_before_travel = 1 retract_before_travel = 1

View file

@ -1153,21 +1153,21 @@ PrintConfigDef::PrintConfigDef()
def->label = L("API Key / Password"); def->label = L("API Key / Password");
def->tooltip = L("Slic3r can upload G-code files to a printer host. This field should contain " def->tooltip = L("Slic3r can upload G-code files to a printer host. This field should contain "
"the API Key or the password required for authentication."); "the API Key or the password required for authentication.");
def->cli = "octoprint-apikey=s"; def->cli = "printhost-apikey=s";
def->default_value = new ConfigOptionString(""); def->default_value = new ConfigOptionString("");
def = this->add("printhost_cafile", coString); def = this->add("printhost_cafile", coString);
def->label = "HTTPS CA file"; def->label = "HTTPS CA file";
def->tooltip = "Custom CA certificate file can be specified for HTTPS OctoPrint connections, in crt/pem format. " def->tooltip = "Custom CA certificate file can be specified for HTTPS OctoPrint connections, in crt/pem format. "
"If left blank, the default OS CA certificate repository is used."; "If left blank, the default OS CA certificate repository is used.";
def->cli = "octoprint-cafile=s"; def->cli = "printhost-cafile=s";
def->default_value = new ConfigOptionString(""); def->default_value = new ConfigOptionString("");
def = this->add("print_host", coString); def = this->add("print_host", coString);
def->label = L("Hostname, IP or URL"); def->label = L("Hostname, IP or URL");
def->tooltip = L("Slic3r can upload G-code files to a printer host. This field should contain " def->tooltip = L("Slic3r can upload G-code files to a printer host. This field should contain "
"the hostname, IP address or URL of the printer host instance."); "the hostname, IP address or URL of the printer host instance.");
def->cli = "octoprint-host=s"; def->cli = "print-host=s";
def->default_value = new ConfigOptionString(""); def->default_value = new ConfigOptionString("");
def = this->add("only_retract_when_crossing_perimeters", coBool); def = this->add("only_retract_when_crossing_perimeters", coBool);
@ -2129,6 +2129,12 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
} else if (opt_key == "support_material_pattern" && value == "pillars") { } else if (opt_key == "support_material_pattern" && value == "pillars") {
// Slic3r PE does not support the pillars. They never worked well. // Slic3r PE does not support the pillars. They never worked well.
value = "rectilinear"; value = "rectilinear";
} else if (opt_key == "octoprint_host") {
opt_key = "print_host";
} else if (opt_key == "octoprint_cafile") {
opt_key = "printhost_cafile";
} else if (opt_key == "octoprint_apikey") {
opt_key = "printhost_apikey";
} }
// Ignore the following obsolete configuration keys: // Ignore the following obsolete configuration keys: