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

New mechanism for project settings #168

Closed
12 tasks done
Tracked by #177
svetter opened this issue Nov 2, 2023 · 0 comments
Closed
12 tasks done
Tracked by #177

New mechanism for project settings #168

svetter opened this issue Nov 2, 2023 · 0 comments
Assignees
Labels
implementation Adding necessary functionality
Milestone

Comments

@svetter
Copy link
Owner

svetter commented Nov 2, 2023

Store an arbitrary number of settings by using just one string column in the settings table, with a string column identifying what setting it is. A table in code then lists and reserves the key for every single setting, or a number of consecutive keys for a collection of settings.

Needs functions to encode to and decode from string from/to various data types.

Also needs a new mechanism to update the database structure to new versions (to get rid of the old table and create a new one), and to block incompatible versions from opening.

This will enable storing all implicit settings where it makes the most sense - in the system or the database, that is, as global implicit settings or as project-specific implicit settings, without the need for a new column in the project settings table, which is obviously not a good usage of a table, especially when settings have different amounts of values. E.g., column widths can then be stored per project, which makes more sense.

  • Adapt SettingsTable and ProjectSettings classes to use only one column and store/load project settings by key
    • Use string column for the identifying keys (mimicking global settings via QSettings)
  • Create a method to store a generic project setting
  • Create a method to load a generic project setting
  • Create methods to encode and store project settings of various types
  • Create methods to load and decode project settings of various types
  • Create the table of project settings, where single or grouped settings are mapped to keys
    • Store app version as the first setting
  • Create project settings update mechanism which deletes the old table and creates the new one
    • Make the update process explicit by prompting the user to greenlight it
    • Transfer default hiker, filters can be discarded
  • Show warning when opening database with newer version than app

Implementing uses for this more convenient mechanism can be done after this issue is completed.

@svetter svetter added the implementation Adding necessary functionality label Nov 2, 2023
@svetter svetter added this to the New features milestone Nov 2, 2023
@svetter svetter self-assigned this Nov 2, 2023
@svetter svetter pinned this issue Nov 3, 2023
@svetter svetter unpinned this issue Nov 6, 2023
@svetter svetter pinned this issue Nov 6, 2023
@svetter svetter modified the milestones: New features, Improvements Nov 10, 2023
svetter added a commit that referenced this issue Nov 11, 2023
Still missing:
- Group settings and encoding/decoding (if necessary)
- Database upgrade
- Compatibility warning for db version > app version

For #168
svetter added a commit that referenced this issue Nov 11, 2023
svetter added a commit that referenced this issue Nov 11, 2023
svetter added a commit that referenced this issue Nov 11, 2023
svetter added a commit that referenced this issue Nov 12, 2023
New class DatabaseUpgrader detects and/or reads version and if necessary, asks for user confirmatino before performing the upgrade.

For #168
svetter added a commit that referenced this issue Nov 12, 2023
And allow resetting them instead of always having to remove them

For #168
@svetter svetter unpinned this issue Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implementation Adding necessary functionality
Projects
None yet
Development

No branches or pull requests

1 participant