mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 01:35:53 +08:00
Ignore gcode when selected multiple files
CURA-3495
This commit is contained in:
parent
208935960f
commit
42b8f06e99
@ -733,20 +733,22 @@ UM.MainWindow
|
|||||||
// look for valid project files
|
// look for valid project files
|
||||||
var projectFileUrlList = [];
|
var projectFileUrlList = [];
|
||||||
var hasGcode = false;
|
var hasGcode = false;
|
||||||
|
var nonGcodeFileList = [];
|
||||||
for (var i in fileUrls)
|
for (var i in fileUrls)
|
||||||
{
|
{
|
||||||
var endsWithG = /\.g$/;
|
var endsWithG = /\.g$/;
|
||||||
var endsWithGcode = /\.gcode$/;
|
var endsWithGcode = /\.gcode$/;
|
||||||
if (endsWithG.test(fileUrls[i]) || endsWithGcode.test(fileUrls[i]))
|
if (endsWithG.test(fileUrls[i]) || endsWithGcode.test(fileUrls[i]))
|
||||||
{
|
{
|
||||||
hasGcode = true;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (CuraApplication.checkIsValidProjectFile(fileUrls[i]))
|
else if (CuraApplication.checkIsValidProjectFile(fileUrls[i]))
|
||||||
{
|
{
|
||||||
projectFileUrlList.push(fileUrls[i]);
|
projectFileUrlList.push(fileUrls[i]);
|
||||||
}
|
}
|
||||||
|
nonGcodeFileList.push(fileUrls[i]);
|
||||||
}
|
}
|
||||||
|
hasGcode = nonGcodeFileList.length < fileUrls.length;
|
||||||
|
|
||||||
// show a warning if selected multiple files together with Gcode
|
// show a warning if selected multiple files together with Gcode
|
||||||
var hasProjectFile = projectFileUrlList.length > 0;
|
var hasProjectFile = projectFileUrlList.length > 0;
|
||||||
@ -755,7 +757,7 @@ UM.MainWindow
|
|||||||
{
|
{
|
||||||
infoMultipleFilesWithGcodeDialog.selectedMultipleFiles = selectedMultipleFiles;
|
infoMultipleFilesWithGcodeDialog.selectedMultipleFiles = selectedMultipleFiles;
|
||||||
infoMultipleFilesWithGcodeDialog.hasProjectFile = hasProjectFile;
|
infoMultipleFilesWithGcodeDialog.hasProjectFile = hasProjectFile;
|
||||||
infoMultipleFilesWithGcodeDialog.fileUrls = fileUrls.slice();
|
infoMultipleFilesWithGcodeDialog.fileUrls = nonGcodeFileList.slice();
|
||||||
infoMultipleFilesWithGcodeDialog.projectFileUrlList = projectFileUrlList.slice();
|
infoMultipleFilesWithGcodeDialog.projectFileUrlList = projectFileUrlList.slice();
|
||||||
infoMultipleFilesWithGcodeDialog.open();
|
infoMultipleFilesWithGcodeDialog.open();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user