Fixed build when tech ENABLE_GCODE_VIEWER is disabled

This commit is contained in:
enricoturri1966 2020-10-12 11:47:11 +02:00
parent 7630be6cf1
commit 7653611ec1
3 changed files with 11 additions and 5 deletions

View file

@ -738,10 +738,13 @@ bool GUI_App::on_init_inner()
wxInitAllImageHandlers(); wxInitAllImageHandlers();
SplashScreen* scrn = nullptr; 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 // 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)); 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 // Detect position (display) to show the splash screen
// Now this position is equal to the mainframe position // 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(); this->obj_manipul()->update_if_dirty();
static bool update_gui_after_init = true; static bool update_gui_after_init = true;
if (update_gui_after_init) if (update_gui_after_init) {
{
update_gui_after_init = false; update_gui_after_init = false;
m_after_init_loads.on_loads(this); m_after_init_loads.on_loads(this);
} }

View file

@ -157,9 +157,11 @@ private:
void set_params( void set_params(
const std::vector<std::string>& load_configs, const std::vector<std::string>& load_configs,
const DynamicPrintConfig& extra_config, const DynamicPrintConfig& extra_config,
const std::vector<std::string>& input_files,
#if ENABLE_GCODE_VIEWER #if ENABLE_GCODE_VIEWER
const std::vector<std::string>& input_files,
bool start_as_gcodeviewer bool start_as_gcodeviewer
#else
const std::vector<std::string>& input_files
#endif // ENABLE_GCODE_VIEWER #endif // ENABLE_GCODE_VIEWER
) { ) {
m_load_configs = load_configs; m_load_configs = load_configs;

View file

@ -1419,8 +1419,10 @@ bool PlaterDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &fi
fs::path path(into_path(filename)); fs::path path(into_path(filename));
if (std::regex_match(path.string(), pattern_drop)) if (std::regex_match(path.string(), pattern_drop))
paths.push_back(std::move(path)); paths.push_back(std::move(path));
#if ENABLE_GCODE_VIEWER
else if (std::regex_match(path.string(), pattern_gcode_drop)) else if (std::regex_match(path.string(), pattern_gcode_drop))
start_new_gcodeviewer(&filename); start_new_gcodeviewer(&filename);
#endif // ENABLE_GCODE_VIEWER
else else
return false; return false;
} }