Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVojtech Kral <vojtech@kral.hk>2018-09-03 17:19:16 +0300
committerbubnikv <bubnikv@gmail.com>2018-09-14 16:10:50 +0300
commit646e991d4b6907a2bcba40073e7895f63522d86d (patch)
tree599745b4d49dd24a504fdb784aa03ffc975e6cf0
parenta744ed7897982b1932b39b26e8cf8e9e2bf2ffff (diff)
ConfigWizard: Properly apply gcode_flavor
Fixes #1138
-rw-r--r--xs/src/slic3r/GUI/ConfigWizard.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/xs/src/slic3r/GUI/ConfigWizard.cpp b/xs/src/slic3r/GUI/ConfigWizard.cpp
index 9f736ded8..bd9b9328a 100644
--- a/xs/src/slic3r/GUI/ConfigWizard.cpp
+++ b/xs/src/slic3r/GUI/ConfigWizard.cpp
@@ -409,11 +409,10 @@ PageFirmware::PageFirmware(ConfigWizard *parent) :
void PageFirmware::apply_custom_config(DynamicPrintConfig &config)
{
- ConfigOptionEnum<GCodeFlavor> opt;
-
auto sel = gcode_picker->GetSelection();
- if (sel != wxNOT_FOUND && opt.deserialize(gcode_picker->GetString(sel).ToStdString())) {
- config.set_key_value("gcode_flavor", &opt);
+ if (sel >= 0 && sel < gcode_opt.enum_labels.size()) {
+ auto *opt = new ConfigOptionEnum<GCodeFlavor>(static_cast<GCodeFlavor>(sel));
+ config.set_key_value("gcode_flavor", opt);
}
}