Merge branch 'master' into wipe_tower_improvements

This commit is contained in:
Lukas Matena 2018-04-04 13:06:46 +02:00
commit eb9917536c
27 changed files with 457 additions and 170 deletions

View file

@ -715,8 +715,53 @@ ConfigOptionsGroup* get_optgroup()
return m_optgroup.get();
}
wxButton* get_wiping_dialog_button(){
return g_wiping_dialog_button;
wxWindow* export_option_creator(wxWindow* parent)
{
wxPanel* panel = new wxPanel(parent, -1);
wxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
wxCheckBox* cbox = new wxCheckBox(panel, wxID_HIGHEST + 1, L("Export print config"));
sizer->AddSpacer(5);
sizer->Add(cbox, 0, wxEXPAND | wxALL | wxALIGN_CENTER_VERTICAL, 5);
panel->SetSizer(sizer);
sizer->SetSizeHints(panel);
return panel;
}
void add_export_option(wxFileDialog* dlg, const std::string& format)
{
if ((dlg != nullptr) && (format == "AMF") || (format == "3MF"))
{
if (dlg->SupportsExtraControl())
dlg->SetExtraControlCreator(export_option_creator);
}
}
int get_export_option(wxFileDialog* dlg)
{
if (dlg != nullptr)
{
wxWindow* wnd = dlg->GetExtraControl();
if (wnd != nullptr)
{
wxPanel* panel = dynamic_cast<wxPanel*>(wnd);
if (panel != nullptr)
{
wxWindow* child = panel->FindWindow(wxID_HIGHEST + 1);
if (child != nullptr)
{
wxCheckBox* cbox = dynamic_cast<wxCheckBox*>(child);
if (cbox != nullptr)
return cbox->IsChecked() ? 1 : 0;
}
}
}
}
return 0;
}
} }