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

@ -691,6 +691,9 @@ UM.MainWindow
function handleOpenFiles(selectedMultipleFiles, hasProjectFile, fileUrlList, projectFileUrlList)
{
// Make sure the files opened through the openFilesIncludingProjectDialog are added to the recent files list
openFilesIncludingProjectsDialog.addtoRecent = true;
// we only allow opening one project file
if (selectedMultipleFiles && hasProjectFile)
{
@ -717,6 +720,7 @@ UM.MainWindow
{
// ask whether to open as project or as models
askOpenAsProjectOrModelsDialog.fileUrl = projectFile;
askOpenAsProjectOrModelsDialog.addToRecent = true;
askOpenAsProjectOrModelsDialog.show();
}
}
@ -776,6 +780,7 @@ UM.MainWindow
onOpenProjectFile:
{
askOpenAsProjectOrModelsDialog.fileUrl = project_file;
askOpenAsProjectOrModelsDialog.addToRecent = add_to_recent_files;
askOpenAsProjectOrModelsDialog.show();
}
}