Skip to content

[RFC] User-only settings #92

Description

@irgolic

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

Activity

  1. janezd commented on Sep 14, 2020

    @janezd
    Contributor

    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.

  2. irgolic commented on Sep 14, 2020

    @irgolic
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions