Pass the "add to recent" as an input var to dialogs that open projects

This way it is clear before to the dialog whether it should add the file to the recent files list,
before the dialog opens.

CURA-7996
This commit is contained in:
Kostas Karmas 2021-02-08 11:55:28 +01:00
parent b54f792561
commit f8a9e7f2d2
4 changed files with 13 additions and 9 deletions

View file

@ -29,6 +29,7 @@ UM.Dialog
modality: Qt.WindowModal
property var fileUrl
property var addToRecent: true
// load the entire project
function loadProjectFile() {
@ -37,8 +38,7 @@ UM.Dialog
UM.Preferences.setValue("cura/choice_on_open_project", "open_as_project")
}
var addToRecent = UM.WorkspaceFileHandler.getAddToRecentFilesHint(base.fileUrl);
UM.WorkspaceFileHandler.readLocalFile(base.fileUrl, addToRecent);
UM.WorkspaceFileHandler.readLocalFile(base.fileUrl, base.addToRecent);
base.hide()
}
@ -50,8 +50,7 @@ UM.Dialog
UM.Preferences.setValue("cura/choice_on_open_project", "open_as_model")
}
var addToRecent = UM.WorkspaceFileHandler.getAddToRecentFilesHint(base.fileUrl);
CuraApplication.readLocalFile(base.fileUrl, "open_as_model", addToRecent)
CuraApplication.readLocalFile(base.fileUrl, "open_as_model", base.addToRecent)
base.hide()
}