ConfigWizard: Cap width, clarify select buttons
This commit is contained in:
parent
94dc86ec72
commit
cfe0bd6ce1
2 changed files with 20 additions and 16 deletions
src/slic3r/GUI
|
@ -178,10 +178,13 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxSt
|
||||||
if (titles.size() > 1) {
|
if (titles.size() > 1) {
|
||||||
// It only makes sense to add the All / None buttons if there's multiple printers
|
// It only makes sense to add the All / None buttons if there's multiple printers
|
||||||
|
|
||||||
|
auto *sel_all_std = new wxButton(this, wxID_ANY, _(L("All standard")));
|
||||||
auto *sel_all = new wxButton(this, wxID_ANY, _(L("All")));
|
auto *sel_all = new wxButton(this, wxID_ANY, _(L("All")));
|
||||||
auto *sel_none = new wxButton(this, wxID_ANY, _(L("None")));
|
auto *sel_none = new wxButton(this, wxID_ANY, _(L("None")));
|
||||||
sel_all->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &event) { this->select_all(true); });
|
sel_all_std->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &event) { this->select_all(true, false); });
|
||||||
|
sel_all->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &event) { this->select_all(true, true); });
|
||||||
sel_none->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &event) { this->select_all(false); });
|
sel_none->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &event) { this->select_all(false); });
|
||||||
|
title_sizer->Add(sel_all_std, 0, wxRIGHT, BTN_SPACING);
|
||||||
title_sizer->Add(sel_all, 0, wxRIGHT, BTN_SPACING);
|
title_sizer->Add(sel_all, 0, wxRIGHT, BTN_SPACING);
|
||||||
title_sizer->Add(sel_none);
|
title_sizer->Add(sel_none);
|
||||||
}
|
}
|
||||||
|
@ -196,7 +199,7 @@ PrinterPicker::PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxSt
|
||||||
: PrinterPicker(parent, vendor, std::move(title), max_cols, appconfig_vendors, [](const VendorProfile::PrinterModel&) { return true; })
|
: PrinterPicker(parent, vendor, std::move(title), max_cols, appconfig_vendors, [](const VendorProfile::PrinterModel&) { return true; })
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void PrinterPicker::select_all(bool select)
|
void PrinterPicker::select_all(bool select, bool alternates)
|
||||||
{
|
{
|
||||||
for (const auto &cb : cboxes) {
|
for (const auto &cb : cboxes) {
|
||||||
if (cb->GetValue() != select) {
|
if (cb->GetValue() != select) {
|
||||||
|
@ -205,13 +208,12 @@ void PrinterPicker::select_all(bool select)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Alt nozzles are de-selected if this is an all-deselect, left intact otherwise
|
if (! select) { alternates = false; }
|
||||||
if (! select) {
|
|
||||||
for (const auto &cb : cboxes_alt) {
|
for (const auto &cb : cboxes_alt) {
|
||||||
if (cb->GetValue()) {
|
if (cb->GetValue() != alternates) {
|
||||||
cb->SetValue(false);
|
cb->SetValue(alternates);
|
||||||
on_checkbox(cb, false);
|
on_checkbox(cb, alternates);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -340,10 +342,10 @@ PagePrinters::PagePrinters(ConfigWizard *parent, wxString title, wxString shortn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PagePrinters::select_all(bool select)
|
void PagePrinters::select_all(bool select, bool alternates)
|
||||||
{
|
{
|
||||||
for (auto picker : printer_pickers) {
|
for (auto picker : printer_pickers) {
|
||||||
picker->select_all(select);
|
picker->select_all(select, alternates);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,6 +365,7 @@ PageCustom::PageCustom(ConfigWizard *parent)
|
||||||
tc_profile_name = new wxTextCtrl(this, wxID_ANY, default_profile_name);
|
tc_profile_name = new wxTextCtrl(this, wxID_ANY, default_profile_name);
|
||||||
auto *label = new wxStaticText(this, wxID_ANY, _(L("Custom profile name:")));
|
auto *label = new wxStaticText(this, wxID_ANY, _(L("Custom profile name:")));
|
||||||
|
|
||||||
|
tc_profile_name->Enable(false);
|
||||||
tc_profile_name->Bind(wxEVT_KILL_FOCUS, [this](wxFocusEvent &evt) {
|
tc_profile_name->Bind(wxEVT_KILL_FOCUS, [this](wxFocusEvent &evt) {
|
||||||
if (tc_profile_name->GetValue().IsEmpty()) {
|
if (tc_profile_name->GetValue().IsEmpty()) {
|
||||||
if (profile_name_prev.IsEmpty()) { tc_profile_name->SetValue(default_profile_name); }
|
if (profile_name_prev.IsEmpty()) { tc_profile_name->SetValue(default_profile_name); }
|
||||||
|
@ -374,6 +377,7 @@ PageCustom::PageCustom(ConfigWizard *parent)
|
||||||
});
|
});
|
||||||
|
|
||||||
cb_custom->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent &event) {
|
cb_custom->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent &event) {
|
||||||
|
tc_profile_name->Enable(custom_wanted());
|
||||||
wizard_p()->on_custom_setup(custom_wanted());
|
wizard_p()->on_custom_setup(custom_wanted());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -994,7 +998,7 @@ ConfigWizard::ConfigWizard(wxWindow *parent, RunReason reason)
|
||||||
topsizer->AddSpacer(INDEX_MARGIN);
|
topsizer->AddSpacer(INDEX_MARGIN);
|
||||||
topsizer->Add(p->hscroll, 1, wxEXPAND);
|
topsizer->Add(p->hscroll, 1, wxEXPAND);
|
||||||
|
|
||||||
auto *btn_sel_all = new wxButton(this, wxID_ANY, _(L("Select all printers")));
|
auto *btn_sel_all = new wxButton(this, wxID_ANY, _(L("Select all standard printers")));
|
||||||
p->btnsizer->Add(btn_sel_all);
|
p->btnsizer->Add(btn_sel_all);
|
||||||
|
|
||||||
p->btn_prev = new wxButton(this, wxID_ANY, _(L("< &Back")));
|
p->btn_prev = new wxButton(this, wxID_ANY, _(L("< &Back")));
|
||||||
|
@ -1068,8 +1072,8 @@ ConfigWizard::ConfigWizard(wxWindow *parent, RunReason reason)
|
||||||
p->btn_finish->Hide();
|
p->btn_finish->Hide();
|
||||||
|
|
||||||
btn_sel_all->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) {
|
btn_sel_all->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) {
|
||||||
p->page_fff->select_all(true);
|
p->page_fff->select_all(true, false);
|
||||||
p->page_msla->select_all(true);
|
p->page_msla->select_all(true, false);
|
||||||
p->index->go_to(p->page_update);
|
p->index->go_to(p->page_update);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ struct PrinterPicker: wxPanel
|
||||||
PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxString title, size_t max_cols, const AppConfig &appconfig_vendors, const ModelFilter &filter);
|
PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxString title, size_t max_cols, const AppConfig &appconfig_vendors, const ModelFilter &filter);
|
||||||
PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxString title, size_t max_cols, const AppConfig &appconfig_vendors);
|
PrinterPicker(wxWindow *parent, const VendorProfile &vendor, wxString title, size_t max_cols, const AppConfig &appconfig_vendors);
|
||||||
|
|
||||||
void select_all(bool select);
|
void select_all(bool select, bool alternates = false);
|
||||||
void select_one(size_t i, bool select);
|
void select_one(size_t i, bool select);
|
||||||
void on_checkbox(const Checkbox *cbox, bool checked);
|
void on_checkbox(const Checkbox *cbox, bool checked);
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ struct PagePrinters: ConfigWizardPage
|
||||||
|
|
||||||
PagePrinters(ConfigWizard *parent, wxString title, wxString shortname, const VendorProfile &vendor, unsigned indent, Technology technology);
|
PagePrinters(ConfigWizard *parent, wxString title, wxString shortname, const VendorProfile &vendor, unsigned indent, Technology technology);
|
||||||
|
|
||||||
void select_all(bool select);
|
void select_all(bool select, bool alternates = false);
|
||||||
int get_width() const;
|
int get_width() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue