mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-13 05:08:09 +08:00
Fixed crash on Windows when dragging and dropping a non gcode file into gcode viewer exe file
This commit is contained in:
parent
8d59abfdf8
commit
4222d80afe
@ -156,7 +156,7 @@ int CLI::run(int argc, char **argv)
|
|||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
for (const std::string& file : m_input_files) {
|
for (const std::string& file : m_input_files) {
|
||||||
std::string ext = boost::filesystem::path(file).extension().string();
|
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)) {
|
if (boost::filesystem::exists(file)) {
|
||||||
start_as_gcodeviewer = true;
|
start_as_gcodeviewer = true;
|
||||||
break;
|
break;
|
||||||
|
@ -4702,7 +4702,9 @@ void Plater::load_gcode()
|
|||||||
|
|
||||||
void Plater::load_gcode(const wxString& filename)
|
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;
|
return;
|
||||||
|
|
||||||
m_last_loaded_gcode = filename;
|
m_last_loaded_gcode = filename;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user