From 88670b48fd66b8f7561d7a4b54ba71460e4fbf19 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 22 Jun 2020 12:10:18 +0200 Subject: [PATCH] ENABLE_GCODE_VIEWER_AS_STATE -> Added dialog informing user that all objects will be removed when switching to g-code viewer mode --- src/slic3r/GUI/MainFrame.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 2e25752a1..366dc4471 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1105,7 +1105,10 @@ void MainFrame::init_menubar() #if ENABLE_GCODE_VIEWER_AS_STATE fileMenu->AppendSeparator(); append_menu_item(fileMenu, wxID_ANY, _L("&G-code preview"), _L("Switch to G-code preview mode"), - [this](wxCommandEvent&) { set_mode(EMode::GCodeViewer); }, "", nullptr, + [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) + set_mode(EMode::GCodeViewer); + }, "", nullptr, [this]() { return m_plater != nullptr && m_plater->printer_technology() != ptSLA; }, this); #endif // ENABLE_GCODE_VIEWER_AS_STATE fileMenu->AppendSeparator();