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

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'xs/src/slic3r/GUI/ConfigWizard.cpp')
-rw-r--r--xs/src/slic3r/GUI/ConfigWizard.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/xs/src/slic3r/GUI/ConfigWizard.cpp b/xs/src/slic3r/GUI/ConfigWizard.cpp
index ce06da853..642c6dce7 100644
--- a/xs/src/slic3r/GUI/ConfigWizard.cpp
+++ b/xs/src/slic3r/GUI/ConfigWizard.cpp
@@ -83,8 +83,11 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, cons
const auto model_id = model.id;
+ bool default_variant = true; // Mark the first variant as default in the GUI
for (const auto &variant : model.variants) {
- const auto label = wxString::Format("%s %s %s", variant.name, _(L("mm")), _(L("nozzle")));
+ const auto label = wxString::Format("%s %s %s %s", variant.name, _(L("mm")), _(L("nozzle")),
+ (default_variant ? _(L("(default)")) : wxString()));
+ default_variant = false;
auto *cbox = new Checkbox(panel, label, model_id, variant.name);
const size_t idx = cboxes.size();
cboxes.push_back(cbox);
@@ -113,11 +116,6 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, cons
sizer->Add(all_none_sizer, 0, wxEXPAND);
SetSizer(sizer);
-
- if (cboxes.size() > 0) {
- cboxes[0]->SetValue(true);
- on_checkbox(cboxes[0], true);
- }
}
void PrinterPicker::select_all(bool select)
@@ -130,6 +128,14 @@ void PrinterPicker::select_all(bool select)
}
}
+void PrinterPicker::select_one(size_t i, bool select)
+{
+ if (i < cboxes.size() && cboxes[i]->GetValue() != select) {
+ cboxes[i]->SetValue(select);
+ on_checkbox(cboxes[i], select);
+ }
+}
+
void PrinterPicker::on_checkbox(const Checkbox *cbox, bool checked)
{
variants_checked += checked ? 1 : -1;
@@ -232,6 +238,7 @@ PageWelcome::PageWelcome(ConfigWizard *parent) :
AppConfig &appconfig_vendors = this->wizard_p()->appconfig_vendors;
printer_picker = new PrinterPicker(this, vendor_prusa->second, appconfig_vendors);
+ printer_picker->select_one(0, true); // Select the default (first) model/variant on the Prusa vendor
printer_picker->Bind(EVT_PRINTER_PICK, [this, &appconfig_vendors](const PrinterPickerEvent &evt) {
appconfig_vendors.set_variant(evt.vendor_id, evt.model_id, evt.variant_name, evt.enable);
this->on_variant_checked();