mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-03 09:28:44 +03:00
Update PrintHostDialogs.cpp
This commit is contained in:
@@ -62,6 +62,19 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
|
|||||||
//B53
|
//B53
|
||||||
wxBoxSizer * checkbox_sizer = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer * checkbox_sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
PresetBundle & preset_bundle = *wxGetApp().preset_bundle;
|
PresetBundle & preset_bundle = *wxGetApp().preset_bundle;
|
||||||
|
|
||||||
|
wxButton* select_all_btn = new wxButton(this, wxID_ANY, _L("Select All"));
|
||||||
|
wxGetApp().SetWindowVariantForButton(select_all_btn);
|
||||||
|
checkbox_sizer->Add(select_all_btn, 0, wxEXPAND | wxALL, 5);
|
||||||
|
select_all_btn->Bind(wxEVT_BUTTON, [checkbox_sizer](wxCommandEvent &event) {
|
||||||
|
for (int i = 0; i < checkbox_sizer->GetItemCount(); i++) {
|
||||||
|
wxCheckBox *checkbox = dynamic_cast<wxCheckBox *>(checkbox_sizer->GetItem(i)->GetWindow());
|
||||||
|
if (checkbox) {
|
||||||
|
checkbox->SetValue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const PhysicalPrinterCollection & ph_printers = preset_bundle.physical_printers;
|
const PhysicalPrinterCollection & ph_printers = preset_bundle.physical_printers;
|
||||||
std::vector<PhysicalPrinterPresetData> preset_data;
|
std::vector<PhysicalPrinterPresetData> preset_data;
|
||||||
for (PhysicalPrinterCollection::ConstIterator it = ph_printers.begin(); it != ph_printers.end(); ++it) {
|
for (PhysicalPrinterCollection::ConstIterator it = ph_printers.begin(); it != ph_printers.end(); ++it) {
|
||||||
@@ -80,22 +93,6 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo
|
|||||||
checkbox_sizer->Add(checkbox, 0, wxEXPAND | wxALL, 5);
|
checkbox_sizer->Add(checkbox, 0, wxEXPAND | wxALL, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCheckBox *select_all_checkbox = new wxCheckBox(this, wxID_ANY, "Select All");
|
|
||||||
|
|
||||||
checkbox_sizer->Add(select_all_checkbox, 0, wxEXPAND | wxALL, 5);
|
|
||||||
|
|
||||||
select_all_checkbox->Bind(wxEVT_CHECKBOX, [checkbox_sizer](wxCommandEvent &event) {
|
|
||||||
bool selectAll = event.IsChecked();
|
|
||||||
|
|
||||||
for (int i = 0; i < checkbox_sizer->GetItemCount(); i++) {
|
|
||||||
wxCheckBox *checkbox = dynamic_cast<wxCheckBox *>(checkbox_sizer->GetItem(i)->GetWindow());
|
|
||||||
if (checkbox) {
|
|
||||||
checkbox->SetValue(selectAll);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
content_sizer->Add(checkbox_sizer);
|
content_sizer->Add(checkbox_sizer);
|
||||||
|
|
||||||
if (combo_groups != nullptr) {
|
if (combo_groups != nullptr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user