From 7653611ec1d34372c2edd8f24b8eb48e8310091d Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 12 Oct 2020 11:47:11 +0200 Subject: [PATCH] Fixed build when tech ENABLE_GCODE_VIEWER is disabled --- src/slic3r/GUI/GUI_App.cpp | 10 ++++++---- src/slic3r/GUI/GUI_App.hpp | 4 +++- src/slic3r/GUI/Plater.cpp | 2 ++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 0eac01749..08be63842 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -738,10 +738,13 @@ bool GUI_App::on_init_inner() wxInitAllImageHandlers(); SplashScreen* scrn = nullptr; - if (app_config->get("show_splash_screen") == "1") - { + if (app_config->get("show_splash_screen") == "1") { // make a bitmap with dark grey banner on the left side +#if ENABLE_GCODE_VIEWER wxBitmap bmp = SplashScreen::MakeBitmap(wxBitmap(from_u8(var(is_editor() ? "splashscreen.jpg" : "splashscreen-gcodepreview.jpg")), wxBITMAP_TYPE_JPEG)); +#else + wxBitmap bmp = SplashScreen::MakeBitmap(wxBitmap(from_u8(var("splashscreen.jpg")), wxBITMAP_TYPE_JPEG)); +#endif // ENABLE_GCODE_VIEWER // Detect position (display) to show the splash screen // Now this position is equal to the mainframe position @@ -851,8 +854,7 @@ bool GUI_App::on_init_inner() this->obj_manipul()->update_if_dirty(); static bool update_gui_after_init = true; - if (update_gui_after_init) - { + if (update_gui_after_init) { update_gui_after_init = false; m_after_init_loads.on_loads(this); } diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index 4e95e854f..17b554d07 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -157,9 +157,11 @@ private: void set_params( const std::vector& load_configs, const DynamicPrintConfig& extra_config, - const std::vector& input_files, #if ENABLE_GCODE_VIEWER + const std::vector& input_files, bool start_as_gcodeviewer +#else + const std::vector& input_files #endif // ENABLE_GCODE_VIEWER ) { m_load_configs = load_configs; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 9a6334459..d3b383ce7 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1419,8 +1419,10 @@ bool PlaterDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &fi fs::path path(into_path(filename)); if (std::regex_match(path.string(), pattern_drop)) paths.push_back(std::move(path)); +#if ENABLE_GCODE_VIEWER else if (std::regex_match(path.string(), pattern_gcode_drop)) start_new_gcodeviewer(&filename); +#endif // ENABLE_GCODE_VIEWER else return false; }