Skip to content

Introducing Reusable Setting Views #197

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

Merged
merged 3 commits into from
Dec 9, 2022

Conversation

jarolrod
Copy link
Member

@jarolrod jarolrod commented Dec 7, 2022

This makes the settings views independent from the onboarding views and refactors the definition of the settings views so that these now independent settings view pages can be reused anywhere and as many times as we need to; they are not delegated to only be used within the onboarding wizard.

Desktop

Master

master-1 master-2 master-3 master-4
master-1 master-2 master-3 master-4

PR

pr-1 pr-2 pr-3 pr-4
Screen Shot 2022-12-07 at 6 40 12 PM Screen Shot 2022-12-07 at 6 40 17 PM Screen Shot 2022-12-07 at 6 40 25 PM Screen Shot 2022-12-07 at 6 40 31 PM

Windows
Intel macOS
Apple Silicon macOS
ARM64 Android

@hebasto
Copy link
Member

hebasto commented Dec 8, 2022

based on #192

#192 has just been merged. Rebase?

Copy link
Collaborator

@johnny9 johnny9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 3e62f27

Much clearer definition of the Settings pages and much better file naming when looking for a page with specific context. One minor quirk with the naming of the page and the selection component that can be thought about and addressed later if a solution is found.

Views render as expected and no qml warnings when run.

detailActive: true
detailItem: ColumnLayout {
spacing: 0
StorageSettings {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming here ends up being a bit funny as its nearly identical to the parent component's name. Maybe append to the component name something that signifies that it is just the selection piece or use "import as" when bringing in the component.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed the naming here are the same words in reversed order :D, can anyone suggest better naming here?

@GBKS: SettingsStorage.qml represents the actualy page view for the Settings that are related to Storage. And StorageSettings is a component we place inside of SettingsStorage.qml that represents the table of advanced settings which are related to Storage.

Copy link
Collaborator

@johnny9 johnny9 Dec 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this component is already under a "settings" folder. Maybe StorageSettingsPage is better name for the component and then something equivalent for the other components since it is a "Page" that holds the "StorageSettings"

Loader {
source:"onboarding01a.qml"
InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

@johnny9 johnny9 Dec 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SwipeViews don't handle Layout properties. Think this can be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for spotting these, it's a bad habit of mine to place this until the view is working correctly. Since you've already opened a PR to address them, i've left this as is.

Copy link
Collaborator

@johnny9 johnny9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed some Layout properties that likely are unused. Might be best to address in a separate PR.

Edit: Starting PR #201

Page {
background: null
clip: true
InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Layout property can be removed

Page {
background: null
clip: true
InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@@ -9,31 +9,26 @@ import org.bitcoincore.qt 1.0
import "../../controls"
import "../../components"

Page {
background: null
InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

Loader {
source:"onboarding05a.qml"
InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

Loader {
source:"onboarding06a.qml"
InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

import "../../components"

InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove


InformationPage {
background: null
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

import "../../components"

InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

import "../../components"

InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

This extracts out the navbar element defintions from the settings page
itself, and moves it to where the page is instantiated. This allows the
settings views to be reused anywhere else we want to use them, and are
now no longer limited to being used within the onboarding wizard.
@jarolrod jarolrod force-pushed the extract-settings-pages branch from 3e62f27 to 30db8cc Compare December 8, 2022 17:15
@jarolrod
Copy link
Member Author

jarolrod commented Dec 8, 2022

Updated from 3e62f27 to 30db8cc

changes: rebased over master

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 30db8cc, I have reviewed the code and it looks OK, I agree it can be merged.

@hebasto hebasto merged commit c071463 into bitcoin-core:main Dec 9, 2022
hebasto pushed a commit to hebasto/gui-qml that referenced this pull request Jun 8, 2025
hebasto pushed a commit to hebasto/gui-qml that referenced this pull request Jun 8, 2025
hebasto pushed a commit to hebasto/gui-qml that referenced this pull request Jun 8, 2025
This extracts out the navbar element defintions from the settings page
itself, and moves it to where the page is instantiated. This allows the
settings views to be reused anywhere else we want to use them, and are
now no longer limited to being used within the onboarding wizard.

Github-Pull: bitcoin-core#197
Rebased-From: 30db8cc
hebasto pushed a commit to hebasto/gui-qml that referenced this pull request Jun 9, 2025
hebasto pushed a commit to hebasto/gui-qml that referenced this pull request Jun 9, 2025
hebasto pushed a commit to hebasto/gui-qml that referenced this pull request Jun 9, 2025
This extracts out the navbar element defintions from the settings page
itself, and moves it to where the page is instantiated. This allows the
settings views to be reused anywhere else we want to use them, and are
now no longer limited to being used within the onboarding wizard.

Github-Pull: bitcoin-core#197
Rebased-From: 30db8cc
hebasto pushed a commit to hebasto/gui-qml that referenced this pull request Jun 9, 2025
hebasto pushed a commit to hebasto/gui-qml that referenced this pull request Jun 9, 2025
hebasto pushed a commit to hebasto/gui-qml that referenced this pull request Jun 9, 2025
This extracts out the navbar element defintions from the settings page
itself, and moves it to where the page is instantiated. This allows the
settings views to be reused anywhere else we want to use them, and are
now no longer limited to being used within the onboarding wizard.

Github-Pull: bitcoin-core#197
Rebased-From: 30db8cc
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

Successfully merging this pull request may close these issues.

3 participants