PhysicalPrinter. PhysicalPrinterDialog improvements

This commit is contained in:
YuSanka 2020-06-25 12:58:59 +02:00
parent 8ac839f427
commit 1a2926050f
10 changed files with 85 additions and 22 deletions

View file

@ -1354,7 +1354,8 @@ const std::vector<std::string>& PhysicalPrinter::printer_options()
"host_type",
"print_host",
"printhost_apikey",
"printhost_cafile",
"printhost_cafile",
"authorization_type",
"login",
"password"
};

View file

@ -150,6 +150,17 @@ void PrintConfigDef::init_common_params()
def->tooltip = L("Related printer preset name");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionString(""));
def = this->add("authorization_type", coEnum);
def->label = L("Authorization Type");
// def->tooltip = L("");
def->enum_keys_map = &ConfigOptionEnum<AuthorizationType>::get_enum_values();
def->enum_values.push_back("key");
def->enum_values.push_back("user");
def->enum_labels.push_back("KeyPassword");
def->enum_labels.push_back("UserPassword");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionEnum<AuthorizationType>(atKeyPassword));
}
void PrintConfigDef::init_fff_params()

View file

@ -33,6 +33,10 @@ enum PrintHostType {
htOctoPrint, htDuet, htFlashAir, htAstroBox
};
enum AuthorizationType {
atKeyPassword, atUserPassword
};
enum InfillPattern : int {
ipRectilinear, ipMonotonous, ipGrid, ipTriangles, ipStars, ipCubic, ipLine, ipConcentric, ipHoneycomb, ip3DHoneycomb,
ipGyroid, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, ipCount,
@ -109,6 +113,15 @@ template<> inline const t_config_enum_values& ConfigOptionEnum<PrintHostType>::g
return keys_map;
}
template<> inline const t_config_enum_values& ConfigOptionEnum<AuthorizationType>::get_enum_values() {
static t_config_enum_values keys_map;
if (keys_map.empty()) {
keys_map["key"] = atKeyPassword;
keys_map["user"] = atUserPassword;
}
return keys_map;
}
template<> inline const t_config_enum_values& ConfigOptionEnum<InfillPattern>::get_enum_values() {
static t_config_enum_values keys_map;
if (keys_map.empty()) {