mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 06:25:59 +08:00
BulkExportDialog: Added enable/disable state for text control and status icon
This commit is contained in:
parent
642d0529fb
commit
834930fbe6
@ -37,6 +37,7 @@ void BulkExportDialog::Item::init_input_name_ctrl(wxBoxSizer* row_sizer, const s
|
|||||||
m_text_ctrl = new wxTextCtrl(m_parent, wxID_ANY, from_u8(path), wxDefaultPosition, wxSize(45 * wxGetApp().em_unit(), -1), style);
|
m_text_ctrl = new wxTextCtrl(m_parent, wxID_ANY, from_u8(path), wxDefaultPosition, wxSize(45 * wxGetApp().em_unit(), -1), style);
|
||||||
wxGetApp().UpdateDarkUI(m_text_ctrl);
|
wxGetApp().UpdateDarkUI(m_text_ctrl);
|
||||||
m_text_ctrl->Bind(wxEVT_TEXT, [this](wxCommandEvent&) { update(); });
|
m_text_ctrl->Bind(wxEVT_TEXT, [this](wxCommandEvent&) { update(); });
|
||||||
|
m_text_ctrl->Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& event) { event.Enable(selected); });
|
||||||
|
|
||||||
row_sizer->Add(m_text_ctrl, 1, wxEXPAND, BORDER_W);
|
row_sizer->Add(m_text_ctrl, 1, wxEXPAND, BORDER_W);
|
||||||
}
|
}
|
||||||
@ -75,6 +76,7 @@ BulkExportDialog::Item::Item(
|
|||||||
|
|
||||||
sizer->Add(row_sizer,0, wxEXPAND | wxTOP, BORDER_W);
|
sizer->Add(row_sizer,0, wxEXPAND | wxTOP, BORDER_W);
|
||||||
|
|
||||||
|
m_valid_bmp->Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& event) { event.Show(selected); });
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,11 +247,18 @@ void BulkExportDialog::AddItem(const fs::path& path, int bed_index)
|
|||||||
bool BulkExportDialog::enable_ok_btn() const
|
bool BulkExportDialog::enable_ok_btn() const
|
||||||
{
|
{
|
||||||
for (const auto &item : m_items)
|
for (const auto &item : m_items)
|
||||||
if (!item->is_valid()) {
|
if (item->selected && !item->is_valid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
bool all_unselected{ true };
|
||||||
|
for (const auto& item : m_items)
|
||||||
|
if (item->selected) {
|
||||||
|
all_unselected = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !all_unselected;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BulkExportDialog::Layout()
|
bool BulkExportDialog::Layout()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user