From 06e2835f8344cbcae88c6534fa7156689376d511 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 26 Jul 2021 11:01:37 +0200 Subject: [PATCH] Follow-up of 8ebb2e2a290ea2bbbcd4d1bd119059a6211f4cd9 -> GCodeViewer: automatically select view type in dependence of gcode content for first loaded gcode file --- src/slic3r/GUI/GUI_Preview.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index eeac517fd4..5eeee546e9 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -966,9 +966,18 @@ void Preview::load_print_as_fff(bool keep_z_range) unsigned int number_extruders = (unsigned int)print->extruders().size(); if (!m_keep_current_preview_type) { +#if ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER + std::vector gcodes = wxGetApp().is_editor() ? + wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes : + m_canvas->get_custom_gcode_per_print_z(); + const wxString choice = !gcodes.empty() ? + _L("Color Print") : + (number_extruders > 1) ? _L("Tool") : _L("Feature type"); +#else const wxString choice = !wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes.empty() ? _L("Color Print") : (number_extruders > 1) ? _L("Tool") : _L("Feature type"); +#endif // ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER int type = m_choice_view_type->FindString(choice); if (m_choice_view_type->GetSelection() != type) {