mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Fix of G-code Viewer not loading .gco files #5536
".gcode", ".gco", ".g" and ".ngc" were considered to be G-code file extensions by the G-code import / export file dialogs, but not by various other functions. Now the G-code extension is tested by a single function is_gcode_file(string).
This commit is contained in:
parent
b93c2aea44
commit
fb29325b14
7 changed files with 17 additions and 19 deletions
|
@ -1866,11 +1866,9 @@ bool GUI_App::OnExceptionInMainLoop()
|
|||
void GUI_App::OSXStoreOpenFiles(const wxArrayString &fileNames)
|
||||
{
|
||||
size_t num_gcodes = 0;
|
||||
for (const wxString &filename : fileNames) {
|
||||
wxString fn = filename.Upper();
|
||||
if (fn.EndsWith(".G") || fn.EndsWith(".GCODE"))
|
||||
for (const wxString &filename : fileNames)
|
||||
if (is_gcode_file(into_u8(filename)))
|
||||
++ num_gcodes;
|
||||
}
|
||||
if (fileNames.size() == num_gcodes) {
|
||||
// Opening PrusaSlicer by drag & dropping a G-Code onto PrusaSlicer icon in Finder,
|
||||
// just G-codes were passed. Switch to G-code viewer mode.
|
||||
|
@ -1890,8 +1888,7 @@ void GUI_App::MacOpenFiles(const wxArrayString &fileNames)
|
|||
std::vector<wxString> gcode_files;
|
||||
std::vector<wxString> non_gcode_files;
|
||||
for (const auto& filename : fileNames) {
|
||||
wxString fn = filename.Upper();
|
||||
if (fn.EndsWith(".G") || fn.EndsWith(".GCODE"))
|
||||
if (is_gcode_file(into_u8(filename)))
|
||||
gcode_files.emplace_back(filename);
|
||||
else {
|
||||
files.emplace_back(into_u8(filename));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue