Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] User-only settings #92

Open
irgolic opened this issue Sep 6, 2020 · 2 comments
Open

[RFC] User-only settings #92

irgolic opened this issue Sep 6, 2020 · 2 comments

Comments

@irgolic
Copy link
Member

irgolic commented Sep 6, 2020

We discussed this at a meeting and postponed the idea, but I've thought about this a bit more...

There's a use case for saving a Setting locally, as opposed to in the workflow file.

This could be done not with QSettings, but the following way:

  • each workflow is assigned a randomly generated ID
  • each widget is assigned a sequential ID
  • a JSON file named <workflow-id>.json is created somewhere in the data directory (~/Library/Application Support/Orange on Mac), mapping widgets to their user-only setting values
@janezd
Copy link
Contributor

janezd commented Sep 14, 2020

Who would delete these files? A frequent user can easily have hundreds. We cannot automatically delete the oldest ones, because the user may still have a copy of the workspace.

What about saving these settings in the .ows file, but encrypted with a machine-dependent key? Is there such a thing? One that would also survive reinstallation of Orange? Let us assume that these settings are not critical w.r.t. information loss -- neither vim mode nor absolute path is something that couldn't be fixed by the user if it's lost.

This would also be easy to implement: every Setting would have an additional flag encode (default would be False), which would be observed by the two methods that encode/decode settings. This would probably require changing just these two particular methods.

@irgolic
Copy link
Member Author

irgolic commented Sep 14, 2020

My bad, this is actually two different issues.

  • absolute paths. These should be obscured. If someone else opens the workflow and changes it, it should be overwritten.
  • recent paths, vim mode. These should keep state across all instances of Orange. E.g., after opening a path in File, and opening a new workflow, the path should be shown as a recent path in File in the new workflow.

Your proposed solution works great for the first case. You could use reporting/machine-id, a random UUID generated with uuid.uuid4(). Although, this is currently only generated upon enabling usage statistics. Alternatively, you could use uuid.uuid1() with a specified clock sequence value.

For the second case, it would be either QSettings or one file saved in application support. Either way, it'd be nice to have this functionality abstracted in a Setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants