Skip to content

qml: Stabilize onboarding settings and data directories - #883

Draft
johnny9 wants to merge 5 commits into
bitcoin-core:qt6from
johnny9:onboarding-settings-combined
Draft

qml: Stabilize onboarding settings and data directories#883
johnny9 wants to merge 5 commits into
bitcoin-core:qt6from
johnny9:onboarding-settings-combined

Conversation

@johnny9

@johnny9 johnny9 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

This combines #812 by @jarolrod with #864 and the review fixes for #812. Jarol's original commit keeps its authorship.

Pre-init onboarding was reading config and settings through the live gArgs, then normal startup read them again. A redirected data directory could make the second read use a different profile. GUI reset also ran before Core knew the active data directory and network.

This change builds the onboarding preview with a scratch ArgsManager. It keeps the selected data directory separate from the profile resolved by Core, then applies settings after InitConfig() and chain-specific QSettings setup. Canceling onboarding does not change settings.

Fixes

Reset now uses the final Core settings precedence, treats -resetguisettings=0 as false, preserves strDataDir, and backs up both Core and GUI settings. If a later write fails, it restores the earlier state. For malformed settings.json files, the backup keeps the original bytes. Settings stores are opened only when needed, and an apply is rejected if its target profile changed while onboarding was open.

User-facing startup errors and translator context are included.

The Settings-page reset and bitcoin.conf actions tracked by #600 remain separate work.

Tests

  • C++ unit tests: 579 passed.
  • QML tests: 419 passed.
  • Reset GUI settings functional harness with the minimal platform plugin: passed.
  • bitcoin-core-app build: passed.

Fixes #773
Fixes #774
Fixes #775
Fixes #783
Fixes #846

@hebasto

hebasto commented Sep 1, 2026

Copy link
Copy Markdown
Member

Please rebase.

@johnny9
johnny9 force-pushed the onboarding-settings-combined branch from c94ed83 to 0ac316d Compare September 1, 2026 23:42
jarolrod and others added 5 commits September 5, 2026 17:27
Keep the datadir selected in onboarding separate from the path Core resolves after config parsing. Run pre-init preview and apply through a scratch ArgsManager seeded from the original argv so live gArgs reaches InitConfig without preloaded config or settings state.

Finalize onboarding settings after InitConfig and chain-specific QSettings setup. Apply reset across Core and GUI stores transactionally, preserve strDataDir, honor final source precedence, and recover unreadable settings with the Qt reset-or-abort behavior.

Only open and synchronize settings stores that are used or modified, preserving rollback without allowing unrelated stores to block startup. Add unit and functional coverage for datadir precedence, reset behavior, recovery, persistence, and rollback.
@johnny9
johnny9 force-pushed the onboarding-settings-combined branch from 0ac316d to 23c4492 Compare September 5, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants