mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-30 23:12:04 +08:00
Follow-up 85c0d636 - Fix for get_printer_profiles_node()
Clear nodes before filling. + Fixed tooltips for "query-..." options
This commit is contained in:
parent
eb8a460b24
commit
5bea4e7104
@ -1012,7 +1012,6 @@ bool CLI::processed_profiles_sharing()
|
||||
|
||||
std::string cmdline_param = m_config.opt_string("output");
|
||||
if (cmdline_param.empty()) {
|
||||
printf("\n");
|
||||
if (ret.empty())
|
||||
printf("Wrong request");
|
||||
else
|
||||
|
@ -5125,29 +5125,36 @@ CLIProfilesSharingConfigDef::CLIProfilesSharingConfigDef()
|
||||
{
|
||||
ConfigOptionDef* def;
|
||||
|
||||
// Information from this def will be used just for console output.
|
||||
// So, don't use L marker to label and tooltips values to avoid extract those phrases to translation.
|
||||
|
||||
def = this->add("query-printer-models", coBool);
|
||||
def->label = L("Get list of printer models");
|
||||
def->tooltip = L("Get available printer models into JSON.\n"
|
||||
"Note:\nTo print printer models for required technology use 'printer-technology' option. By default printer_technology is FFF.\n"
|
||||
"To print out JSON into file use 'output' option.");
|
||||
def->label = ("Get list of printer models");
|
||||
def->tooltip = ("Get list of installed printer models into JSON.\n"
|
||||
"Note:\n"
|
||||
"To print printer models for required technology use 'printer-technology' option with value FFF or SLA. By default printer_technology is FFF.\n"
|
||||
"To print out JSON into file use 'output' option.\n"
|
||||
"To specify configuration folder use 'datadir' option.");
|
||||
|
||||
/*
|
||||
def = this->add("query-printer-profiles", coBool);
|
||||
def->label = L("Get list of printer profiles in respect to selected printer model and printer variant");
|
||||
def->tooltip = L("Get list of printer profiles in respect to selected 'printer-model' and 'printer-variant' into JSON.\n"
|
||||
def->label = ("Get list of printer profiles for the selected printer model and printer variant");
|
||||
def->tooltip = ("Get list of printer profiles for the selected 'printer-model' and 'printer-variant' into JSON.\n"
|
||||
"Note:\n"
|
||||
"To print out JSON into file use 'output' option.");
|
||||
"To print out JSON into file use 'output' option.\n"
|
||||
"To specify configuration folder use 'datadir' option.");
|
||||
*/
|
||||
|
||||
def = this->add("query-print-filament-profiles", coBool);
|
||||
def->label = L("Get list of prints and filaments profiles in respect to selected printer profile");
|
||||
def->tooltip = L("Get list of prints and filaments profiles in respect to selected 'printer-profile' into JSON.\n"
|
||||
def->label = ("Get list of print profiles and filament profiles for the selected printer profile");
|
||||
def->tooltip = ("Get list of print profiles and filament profiles for the selected 'printer-profile' into JSON.\n"
|
||||
"Note:\n"
|
||||
"To print out JSON into file use 'output' option.");
|
||||
"To print out JSON into file use 'output' option.\n"
|
||||
"To specify configuration folder use 'datadir' option.");
|
||||
|
||||
def = this->add("printer-profile", coString);
|
||||
def->label = L("Printer preset name");
|
||||
def->tooltip = L("Name of the printer preset used for slicing.");
|
||||
def->label = ("Printer preset name");
|
||||
def->tooltip = ("Name of the printer preset used for slicing.");
|
||||
def->set_default_value(new ConfigOptionString());
|
||||
}
|
||||
|
||||
|
@ -268,6 +268,9 @@ static void get_printer_profiles_node(pt::ptree& printer_profiles_node,
|
||||
const PrinterPresetCollection& printer_presets,
|
||||
const PrinterAttr& attr)
|
||||
{
|
||||
printer_profiles_node.clear();
|
||||
user_printer_profiles_node.clear();
|
||||
|
||||
for (const Preset& printer_preset : printer_presets) {
|
||||
|
||||
if (printer_preset.is_user()) {
|
||||
@ -465,23 +468,23 @@ DynamicPrintConfig load_full_print_config(const std::string& print_preset_name,
|
||||
if (print_preset)
|
||||
config.apply_only(print_preset->config, print_preset->config.keys());
|
||||
else
|
||||
printf("Print profile '%s' wasn't found.\n", print_preset->name.c_str());
|
||||
BOOST_LOG_TRIVIAL(warning) << Slic3r::format("Print profile '%1%' wasn't found.", print_preset_name);
|
||||
|
||||
const Preset* filament_preset = preset_bundle.filaments.find_preset(filament_preset_name);
|
||||
if (filament_preset)
|
||||
config.apply_only(filament_preset->config, filament_preset->config.keys());
|
||||
else
|
||||
printf("Filament profile '%s' wasn't found.\n", filament_preset->name.c_str());
|
||||
BOOST_LOG_TRIVIAL(warning) << Slic3r::format("Filament profile '%1%' wasn't found.", filament_preset_name);
|
||||
|
||||
const Preset* printer_preset = preset_bundle.printers.find_preset(printer_preset_name);
|
||||
if (printer_preset)
|
||||
config.apply_only(printer_preset->config, printer_preset->config.keys());
|
||||
else
|
||||
printf("Printer profile '%s' wasn't found.\n", printer_preset->name.c_str());
|
||||
BOOST_LOG_TRIVIAL(warning) << Slic3r::format("Printer profile '%1%' wasn't found.", printer_preset_name);
|
||||
}
|
||||
}
|
||||
else
|
||||
printf("Datadir wasn't found\n");
|
||||
BOOST_LOG_TRIVIAL(error) << "Datadir wasn't found\n";
|
||||
|
||||
return config;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user