From ccd8e3644ecd25c379c1a8841e927d21d598cab7 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Fri, 16 Oct 2020 14:08:24 +0200 Subject: [PATCH] Fixed build when tech ENABLE_GCODE_VIEWER is disabled --- src/PrusaSlicer.cpp | 14 +++++++------- src/slic3r/GUI/GUI_App.cpp | 2 ++ src/slic3r/GUI/GUI_Preview.cpp | 2 ++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp index 0663eddbb..be66d5c54 100644 --- a/src/PrusaSlicer.cpp +++ b/src/PrusaSlicer.cpp @@ -577,17 +577,17 @@ int CLI::run(int argc, char **argv) // #ifdef USE_WX #if ENABLE_GCODE_VIEWER GUI::GUI_App* gui = new GUI::GUI_App(start_as_gcodeviewer ? GUI::GUI_App::EAppMode::GCodeViewer : GUI::GUI_App::EAppMode::Editor); + if (gui->get_app_mode() != GUI::GUI_App::EAppMode::GCodeViewer) { // gcode viewer is currently not performing instance check + bool gui_single_instance_setting = gui->app_config->get("single_instance") == "1"; + if (Slic3r::instance_check(argc, argv, gui_single_instance_setting)) { + //TODO: do we have delete gui and other stuff? + return -1; + } + } #else GUI::GUI_App *gui = new GUI::GUI_App(); #endif // ENABLE_GCODE_VIEWER - if(gui->get_app_mode() != GUI::GUI_App::EAppMode::GCodeViewer){ // gcode viewer is currently not performing instance check - bool gui_single_instance_setting = gui->app_config->get("single_instance") == "1"; - if (Slic3r::instance_check(argc, argv, gui_single_instance_setting)) { - //TODO: do we have delete gui and other stuff? - return -1; - } - } // gui->autosave = m_config.opt_string("autosave"); GUI::GUI_App::SetInstance(gui); #if ENABLE_GCODE_VIEWER diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 944cd2391..2dc2676b9 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1578,8 +1578,10 @@ void GUI_App::add_config_menu(wxMenuBar *menu) PreferencesDialog dlg(mainframe); dlg.ShowModal(); app_layout_changed = dlg.settings_layout_changed(); +#if ENABLE_GCODE_VIEWER if (dlg.seq_top_layer_only_changed()) this->plater_->refresh_print(); +#endif // ENABLE_GCODE_VIEWER } if (app_layout_changed) { // hide full main_sizer for mainFrame diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index b91105100..150c2d46f 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -541,7 +541,9 @@ void Preview::refresh_print() return; load_print(true); +#if ENABLE_GCODE_VIEWER m_moves_slider->set_lower_editable(get_app_config()->get("seq_top_layer_only") == "0"); +#endif // ENABLE_GCODE_VIEWER } void Preview::msw_rescale()