mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 04:54:04 -06:00
Fix recent files python function calls
This commit is contained in:
parent
55fe4ee986
commit
11d0462c7a
3 changed files with 3 additions and 36 deletions
|
@ -29,42 +29,8 @@ Menu
|
|||
}
|
||||
onTriggered:
|
||||
{
|
||||
var toShowDialog = false;
|
||||
var toOpenAsProject = false;
|
||||
var toOpenAsModel = false;
|
||||
CuraApplication.readLocalFile(modelData);
|
||||
|
||||
if (CuraApplication.checkIsValidProjectFile(modelData)) {
|
||||
// check preference
|
||||
var choice = UM.Preferences.getValue("cura/choice_on_open_project");
|
||||
|
||||
if (choice == "open_as_project")
|
||||
{
|
||||
toOpenAsProject = true;
|
||||
}else if (choice == "open_as_model"){
|
||||
toOpenAsModel = true;
|
||||
}else{
|
||||
toShowDialog = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
toOpenAsModel = true;
|
||||
}
|
||||
|
||||
if (toShowDialog) {
|
||||
askOpenAsProjectOrModelsDialog.fileUrl = modelData;
|
||||
askOpenAsProjectOrModelsDialog.show();
|
||||
return;
|
||||
}
|
||||
|
||||
// open file in the prefered way
|
||||
if (toOpenAsProject)
|
||||
{
|
||||
UM.WorkspaceFileHandler.readLocalFile(modelData);
|
||||
}
|
||||
else if (toOpenAsModel)
|
||||
{
|
||||
CuraApplication.readLocalFile(modelData, true);
|
||||
}
|
||||
var meshName = backgroundItem.getMeshName(modelData.toString())
|
||||
backgroundItem.hasMesh(decodeURIComponent(meshName))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue