ENABLE_GCODE_VIEWER -> More general drag and drop for .gcode files

This commit is contained in:
enricoturri1966 2020-08-11 15:44:32 +02:00
parent 5a0e048079
commit 4ca026d4b6
3 changed files with 34 additions and 14 deletions

View file

@ -1006,7 +1006,9 @@ void MainFrame::init_menubar()
fileMenu->AppendSeparator();
append_menu_item(fileMenu, wxID_ANY, _L("&G-code preview"), _L("Switch to G-code preview mode"),
[this](wxCommandEvent&) {
if (m_plater->model().objects.empty() || wxMessageDialog((wxWindow*)this, _L("Switching to G-code preview mode will remove all objects, continue?"), wxString(SLIC3R_APP_NAME) + " - " + _L("Switch to G-code preview mode"), wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxCENTRE).ShowModal() == wxID_YES)
if (m_plater->model().objects.empty() ||
wxMessageDialog((wxWindow*)this, _L("Switching to G-code preview mode will remove all objects, continue?"),
wxString(SLIC3R_APP_NAME) + " - " + _L("Switch to G-code preview mode"), wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxICON_QUESTION | wxCENTRE).ShowModal() == wxID_YES)
set_mode(EMode::GCodeViewer);
}, "", nullptr,
[this]() { return m_plater != nullptr && m_plater->printer_technology() != ptSLA; }, this);