Open spine-o-bot opened 3 years ago
In GitLab by @manuelma on Jan 24, 2020, 15:19
What is my_source_data.csv
overwritten with? Does the project being saved have a file with that exact name?
In GitLab by @PekkaSavolainen on Jan 24, 2020, 15:24
It is overwritten by my_source_data.csv
in the project that is in directory my_spinetoolbox_project
. And yes, it has to be exact same name for this to happen.
And there has to be a user created data folder in SpineToolboxProjects/my_spinetoolbox_project/input_data
that must match exactly another project that is in directory SpineToolboxProjects/input_data
.
In GitLab by @manuelma on Jan 24, 2020, 15:28
I think I get. So case 3 is saving my_spinetoolbox_project
into SpineToolboxProjects
, right?
In GitLab by @PekkaSavolainen on Jan 24, 2020, 15:29
yes
In GitLab by @PekkaSavolainen on Jan 24, 2020, 14:44
There is a situation when saving the project to a new directory with
File->Save Project As...
overwrites user's files without prompt.Consider the following directory structure, where directory
SpineToolboxProjects
contains three Spine Toolbox projects (my_spinetoolbox_project, another_spinetoolbox_project and input_data).There are three cases to consider with the Save Project As... option:
.spinetoolbox/
directory, the app notices this and asks if overwrite is Ok. After selecting Overwrite, all duplicate files will be overwritten. Any extra files will not be deleted. For example, if the project that is overwritten contained some project item that the replacing project does not have, these extra files will remain in the new project as well.SpineToolboxProjects
directory inSave Project As...
. In this case, the app notices that the directory is not empty and asks if you want to make this directory into a Spine Toolbox project directory. If user chooses to continue, the following happens. Theinput_data
Spine Toolbox project will become an internal directory of theSpineToolboxProjects
directory. my_source_data.csv file will be overwritten.input_data
project would still be a valid Spine Toolbox project though.Even though, the third case seems a bit theoretical, I think people need to be made aware of this since, we can now make any directory a Spine Toolbox project.
The proposed solution for this is to show the user the files that will be overwritten beforehand.