diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp index be432d487a..1bd981a5da 100644 --- a/src/PrusaSlicer.cpp +++ b/src/PrusaSlicer.cpp @@ -156,7 +156,7 @@ int CLI::run(int argc, char **argv) #if ENABLE_GCODE_VIEWER for (const std::string& file : m_input_files) { std::string ext = boost::filesystem::path(file).extension().string(); - if (boost::filesystem::path(file).extension().string() == ".gcode") { + if (ext == ".gcode" || ext == ".g") { if (boost::filesystem::exists(file)) { start_as_gcodeviewer = true; break; diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index b3cd1ef000..b62ff4dcc8 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -4702,7 +4702,9 @@ void Plater::load_gcode() void Plater::load_gcode(const wxString& filename) { - if (filename.empty() || m_last_loaded_gcode == filename) + if (filename.empty() || + (!filename.Lower().EndsWith(".gcode") && !filename.Lower().EndsWith(".g")) || + m_last_loaded_gcode == filename) return; m_last_loaded_gcode = filename;