mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-15 01:26:04 +08:00
Treat the printer as a generic printer when loading new printers not found in the system from a project file
This commit is contained in:
parent
92b1ff824a
commit
2903942403
@ -1,5 +1,6 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "Config.hpp"
|
||||||
#include "Exception.hpp"
|
#include "Exception.hpp"
|
||||||
#include "Preset.hpp"
|
#include "Preset.hpp"
|
||||||
#include "PresetBundle.hpp"
|
#include "PresetBundle.hpp"
|
||||||
@ -686,7 +687,7 @@ bool Preset::is_custom_defined()
|
|||||||
|
|
||||||
bool Preset::is_bbl_vendor_preset(PresetBundle *preset_bundle)
|
bool Preset::is_bbl_vendor_preset(PresetBundle *preset_bundle)
|
||||||
{
|
{
|
||||||
bool is_bbl_vendor_preset = true;
|
bool is_bbl_vendor_preset = false;
|
||||||
if (preset_bundle) {
|
if (preset_bundle) {
|
||||||
auto config = &preset_bundle->printers.get_edited_preset().config;
|
auto config = &preset_bundle->printers.get_edited_preset().config;
|
||||||
std::string vendor_name;
|
std::string vendor_name;
|
||||||
@ -1698,11 +1699,13 @@ std::pair<Preset*, bool> PresetCollection::load_external_preset(
|
|||||||
// Load the preset over a default preset, so that the missing fields are filled in from the default preset.
|
// Load the preset over a default preset, so that the missing fields are filled in from the default preset.
|
||||||
DynamicPrintConfig cfg(this->default_preset_for(combined_config).config);
|
DynamicPrintConfig cfg(this->default_preset_for(combined_config).config);
|
||||||
// SoftFever: ignore print connection info from project
|
// SoftFever: ignore print connection info from project
|
||||||
cfg.erase("print_host");
|
auto keys = cfg.keys();
|
||||||
cfg.erase("print_host_webui");
|
keys.erase(std::remove_if(keys.begin(), keys.end(),
|
||||||
cfg.erase("printhost_apikey");
|
[](std::string &val) {
|
||||||
cfg.erase("printhost_cafile");
|
return val == "print_host" || val == "print_host_webui" || val == "printhost_apikey" ||
|
||||||
const auto &keys = cfg.keys();
|
val == "printhost_cafile";
|
||||||
|
}),
|
||||||
|
keys.end());
|
||||||
cfg.apply_only(combined_config, keys, true);
|
cfg.apply_only(combined_config, keys, true);
|
||||||
std::string &inherits = Preset::inherits(cfg);
|
std::string &inherits = Preset::inherits(cfg);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user