mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 02:49:04 +08:00
Make it possible to skip project file check in readLocalFile()
CURA-5203
This commit is contained in:
parent
95c6258d0f
commit
95f4515e93
@ -1557,8 +1557,8 @@ class CuraApplication(QtApplication):
|
||||
|
||||
openProjectFile = pyqtSignal(QUrl, arguments = ["project_file"]) # Emitted when a project file is about to open.
|
||||
|
||||
@pyqtSlot(QUrl)
|
||||
def readLocalFile(self, file):
|
||||
@pyqtSlot(QUrl, bool)
|
||||
def readLocalFile(self, file, skip_project_file_check = False):
|
||||
if not file.isValid():
|
||||
return
|
||||
|
||||
@ -1569,7 +1569,7 @@ class CuraApplication(QtApplication):
|
||||
self.deleteAll()
|
||||
break
|
||||
|
||||
if self.checkIsValidProjectFile(file):
|
||||
if not skip_project_file_check and self.checkIsValidProjectFile(file):
|
||||
self.callLater(self.openProjectFile.emit, file)
|
||||
return
|
||||
|
||||
|
@ -53,7 +53,7 @@ UM.Dialog
|
||||
UM.Preferences.setValue("cura/choice_on_open_project", "open_as_model")
|
||||
}
|
||||
|
||||
CuraApplication.readLocalFile(base.fileUrl)
|
||||
CuraApplication.readLocalFile(base.fileUrl, true)
|
||||
var meshName = backgroundItem.getMeshName(base.fileUrl.toString())
|
||||
backgroundItem.hasMesh(decodeURIComponent(meshName))
|
||||
|
||||
|
@ -61,7 +61,7 @@ Menu
|
||||
}
|
||||
else if (toOpenAsModel)
|
||||
{
|
||||
CuraApplication.readLocalFile(modelData);
|
||||
CuraApplication.readLocalFile(modelData, true);
|
||||
}
|
||||
var meshName = backgroundItem.getMeshName(modelData.toString())
|
||||
backgroundItem.hasMesh(decodeURIComponent(meshName))
|
||||
|
@ -42,7 +42,7 @@ UM.Dialog
|
||||
{
|
||||
for (var i in fileUrls)
|
||||
{
|
||||
CuraApplication.readLocalFile(fileUrls[i]);
|
||||
CuraApplication.readLocalFile(fileUrls[i], true);
|
||||
}
|
||||
|
||||
var meshName = backgroundItem.getMeshName(fileUrls[0].toString());
|
||||
|
Loading…
x
Reference in New Issue
Block a user