WIP: DRAFT: Custom Datadir Wiring #390

Closed
D33r-Gee wants to merge 11 commits from qml-intro-custom-datadir into main AGit
D33r-Gee commented 2024-03-08 16:08:55 +00:00 (Migrated from github.com)

This pull request introduces the functionality for users to specify a custom data directory (datadir) during the onboarding process.

Ubuntu Screenshots

Screenshot 2024-03-14 124000
Screenshot 2024-01-29 074759
Screenshot 2024-01-29 074734

Prerequisites

For testing this pull request, ensure you have the following Qt modules installed:

  • On Ubuntu 22.04:
sudo apt-get install qtdeclarative5-dev
sudo apt-get install qtquickcontrols2-5-dev
sudo apt-get install qml-module-qtquick-controls2
sudo apt install qml-module-qtquick-dialogs
  • For Android:

Make sure you delete the prior depends folder (i.e. depends/aarch64-linux-android) and rebuild them.

Implementation Details

This enhancement leverages FileDialog class for a user-friendly selection experience. Additionally, necessary code updates and adjustments were made to accommodate the delayed node creation until onboarding completion.

  • QML Backend
    • Introduced a new class within qml/bitcoin.h and cpp to manage custom data directory settings.
    • Integrated pull request #284 by Johny9.
    • Added onboardingmodel files to oversee the onboarding process, specifically custom data directory configuration and placeholders for optionsModel.
  • QML Frontend
    • Updated StorageLocations.qml to incorporate wiring for custom data directory selection and resetting to default.
    • Commented out settings code in OnboardingCover.qml due to the postponed node initialization until onboarding completion.
    • Modified Onboarding qml files to utilize onboardingModel instead of optionsModel. Additionally, arguments referencing chainModel were removed as node initialization now occurs at the end of the onboarding process.
  • The Make process was extended to include the onboardingmodel files.

TODO: will implement a way to display a read only path to the user's custom datadir, most likely tin the StorageOptions file.

This pull request introduces the functionality for users to specify a custom data directory (`datadir`) during the onboarding process. <details> <summary>Ubuntu Screenshots</summary> ![Screenshot 2024-03-14 124000](https://git.fish.foo/attachments/bc9ff9cc-efbd-489d-b24e-b93519dbd37e) ![Screenshot 2024-01-29 074759](https://git.fish.foo/attachments/e6cebec5-e30d-432a-84a1-fdf3beb099e5) ![Screenshot 2024-01-29 074734](https://git.fish.foo/attachments/a345fb8f-856f-4662-af7b-d662565a84fa) </details> **Prerequisites** For testing this pull request, ensure you have the following Qt modules installed: * On Ubuntu 22.04: ```bash sudo apt-get install qtdeclarative5-dev sudo apt-get install qtquickcontrols2-5-dev sudo apt-get install qml-module-qtquick-controls2 sudo apt install qml-module-qtquick-dialogs ``` * For Android: Make sure you delete the prior depends folder (i.e. `depends/aarch64-linux-android`) and rebuild them. <details> <summary>Implementation Details</summary> This enhancement leverages `FileDialog` class for a user-friendly selection experience. Additionally, necessary code updates and adjustments were made to accommodate the delayed node creation until onboarding completion. * **QML Backend** * Introduced a new class within `qml/bitcoin.h` and `cpp` to manage custom data directory settings. * Integrated pull request #284 by Johny9. * Added `onboardingmodel` files to oversee the onboarding process, specifically custom data directory configuration and placeholders for `optionsModel`. * **QML Frontend** * Updated `StorageLocations.qml` to incorporate wiring for custom data directory selection and resetting to default. * Commented out settings code in `OnboardingCover.qml` due to the postponed node initialization until onboarding completion. * Modified Onboarding qml files to utilize `onboardingModel` instead of `optionsModel`. Additionally, arguments referencing `chainModel` were removed as node initialization now occurs at the end of the onboarding process. * The `Make` process was extended to include the `onboardingmodel` files. </details> TODO: will implement a way to display a read only path to the user's custom `datadir`, most likely tin the StorageOptions file.
johnny9 (Migrated from github.com) requested changes 2024-03-12 03:50:56 +00:00
johnny9 (Migrated from github.com) left a comment

Left comments for some obvious code areas that can be cleaned up.

During testing, I was unable to start the app after onboarding. The inital onboarding flow worked, however, It appeared to not find the custom data directory I set on the second time loading the app.

Error: Cannot write to data directory '/home/johnny/.bitcoin/signet'; check permissions.
qrc:/qml/pages/node/NodeRunner.qml:25: ReferenceError: nodeModel is not defined
qrc:/qml/components/BlockClock.qml:31: TypeError: Cannot read property 'text' of undefined
qrc:/qml/components/BlockClock.qml:28: ReferenceError: nodeModel is not defined
qrc:/qml/components/BlockClock.qml:27: ReferenceError: nodeModel is not defined
qrc:/qml/components/BlockClock.qml:53: ReferenceError: nodeModel is not defined
qrc:/qml/components/BlockClock.qml:26: ReferenceError: nodeModel is not defined
qrc:/qml/components/BlockClock.qml:50: ReferenceError: nodeModel is not defined
qrc:/qml/components/BlockClock.qml:49: ReferenceError: chainModel is not defined
qrc:/qml/components/BlockClock.qml:32: TypeError: Cannot read property 'estimating' of undefined
qrc:/qml/components/BlockClock.qml:30: ReferenceError: nodeModel is not defined
qrc:/qml/components/BlockClock.qml:141: ReferenceError: nodeModel is not defined
qrc:/qml/components/BlockClock.qml:140: ReferenceError: nodeModel is not defined
qrc:/qml/components/NetworkIndicator.qml:20: ReferenceError: chainModel is not defined
Left comments for some obvious code areas that can be cleaned up. During testing, I was unable to start the app after onboarding. The inital onboarding flow worked, however, It appeared to not find the custom data directory I set on the second time loading the app. ``` Error: Cannot write to data directory '/home/johnny/.bitcoin/signet'; check permissions. qrc:/qml/pages/node/NodeRunner.qml:25: ReferenceError: nodeModel is not defined qrc:/qml/components/BlockClock.qml:31: TypeError: Cannot read property 'text' of undefined qrc:/qml/components/BlockClock.qml:28: ReferenceError: nodeModel is not defined qrc:/qml/components/BlockClock.qml:27: ReferenceError: nodeModel is not defined qrc:/qml/components/BlockClock.qml:53: ReferenceError: nodeModel is not defined qrc:/qml/components/BlockClock.qml:26: ReferenceError: nodeModel is not defined qrc:/qml/components/BlockClock.qml:50: ReferenceError: nodeModel is not defined qrc:/qml/components/BlockClock.qml:49: ReferenceError: chainModel is not defined qrc:/qml/components/BlockClock.qml:32: TypeError: Cannot read property 'estimating' of undefined qrc:/qml/components/BlockClock.qml:30: ReferenceError: nodeModel is not defined qrc:/qml/components/BlockClock.qml:141: ReferenceError: nodeModel is not defined qrc:/qml/components/BlockClock.qml:140: ReferenceError: nodeModel is not defined qrc:/qml/components/NetworkIndicator.qml:20: ReferenceError: chainModel is not defined ```
johnny9 (Migrated from github.com) commented 2024-03-11 20:56:00 +00:00

Remove the comments here and fix the formatting

Remove the comments here and fix the formatting
johnny9 (Migrated from github.com) commented 2024-03-11 20:56:12 +00:00

remove comments

remove comments
johnny9 (Migrated from github.com) commented 2024-03-11 20:56:23 +00:00

remove commented code or add a TODO

remove commented code or add a TODO
johnny9 (Migrated from github.com) commented 2024-03-11 20:57:50 +00:00

remove commented code

remove commented code
johnny9 (Migrated from github.com) commented 2024-03-11 20:58:54 +00:00

chainstate still gets saved in the custom directory i believe so we probably want to keep this as is.

chainstate still gets saved in the custom directory i believe so we probably want to keep this as is.
johnny9 (Migrated from github.com) commented 2024-03-11 20:59:32 +00:00

check that there is a newline on all of your new files

check that there is a newline on all of your new files
johnny9 (Migrated from github.com) commented 2024-03-11 20:59:43 +00:00

whitespace

whitespace
johnny9 (Migrated from github.com) commented 2024-03-11 21:00:58 +00:00

revert changes in this file?

revert changes in this file?
johnny9 (Migrated from github.com) commented 2024-03-11 21:00:33 +00:00

keep the old way as we want the user to factor in chainstate

keep the old way as we want the user to factor in chainstate
D33r-Gee (Migrated from github.com) reviewed 2024-03-12 15:49:09 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-12 15:49:09 +00:00

done

done
D33r-Gee (Migrated from github.com) reviewed 2024-03-12 15:49:50 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-12 15:49:50 +00:00

done

done
D33r-Gee (Migrated from github.com) reviewed 2024-03-12 15:50:28 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-12 15:50:28 +00:00

done

done
D33r-Gee (Migrated from github.com) reviewed 2024-03-12 15:53:04 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-12 15:53:04 +00:00

done

done
D33r-Gee (Migrated from github.com) reviewed 2024-03-12 15:59:51 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-12 15:59:51 +00:00

good to know, thanks

good to know, thanks
D33r-Gee (Migrated from github.com) reviewed 2024-03-12 16:12:18 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-12 16:12:18 +00:00

fixed

fixed
D33r-Gee commented 2024-03-12 16:53:47 +00:00 (Migrated from github.com)

Thanks @johnny9 for commenting and reviewing!

During testing, I was unable to start the app after onboarding. The initial onboarding flow worked, however, It appeared to not find the custom data directory I set on the second time loading the app.

Was able to reproduce, it seems that if the custom datadir exist but hasn't been fully initialized, meaning the onboarding process didn't finished, it will trigger the error you encountered. Will look into how to mitigate that...

Ok found the problem, I had commented out the gArgs.ClearPathCache(); in qml/bitcoin.cpp, it works now... going to update the commits

Thanks @johnny9 for commenting and reviewing! > During testing, I was unable to start the app after onboarding. The initial onboarding flow worked, however, It appeared to not find the custom data directory I set on the second time loading the app. > Was able to reproduce, it seems that if the custom datadir exist but hasn't been fully initialized, meaning the onboarding process didn't finished, it will trigger the error you encountered. Will look into how to mitigate that... Ok found the problem, I had commented out the gArgs.ClearPathCache(); in qml/bitcoin.cpp, it works now... going to update the commits
D33r-Gee (Migrated from github.com) reviewed 2024-03-12 17:45:33 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-12 17:45:33 +00:00

how crucial is to have the info on the cover page?

The challenge here is that we don't fully initialize nodeModel and optionsModel, until we finish the Onboarding process, and they are referenced in AboutOptions.qml and DeveloperOptions.qml.

If it's important I will look into a way to accomodate for that, also it could be a follow up PR. What are your thoughts?

how crucial is to have the info on the cover page? The challenge here is that we don't fully initialize nodeModel and optionsModel, until we finish the Onboarding process, and they are referenced in AboutOptions.qml and DeveloperOptions.qml. If it's important I will look into a way to accomodate for that, also it could be a follow up PR. What are your thoughts?
D33r-Gee (Migrated from github.com) reviewed 2024-03-12 17:47:27 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-12 17:47:27 +00:00

addressed it using onboardingModel

addressed it using onboardingModel
D33r-Gee (Migrated from github.com) reviewed 2024-03-12 17:48:54 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-12 17:48:54 +00:00

addressed using onboardingModel

addressed using onboardingModel
D33r-Gee commented 2024-03-13 22:53:24 +00:00 (Migrated from github.com)

updated the commits from 87b4d75 to 76f83f2

updated the commits from [87b4d75 ](https://github.com/bitcoin-core/gui-qml/commit/87b4d75a9275c92236aa4654f714d9739e2a81d9)to [76f83f2](https://github.com/bitcoin-core/gui-qml/commit/76f83f25945f12317f42c0da1387e4da6aba282d)
MarnixCroes (Migrated from github.com) reviewed 2024-03-14 09:03:19 +00:00
MarnixCroes (Migrated from github.com) commented 2024-03-14 08:54:35 +00:00

nit

    // Added this signal to account for NodeModel being initialized later
nit ```suggestion // Added this signal to account for NodeModel being initialized later ```
MarnixCroes commented 2024-03-14 09:03:53 +00:00 (Migrated from github.com)

CI is failing, please fix

CI is failing, please fix
D33r-Gee (Migrated from github.com) reviewed 2024-03-14 15:09:51 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-14 15:09:51 +00:00

Thanks for reviewing! Done...

Thanks for reviewing! Done...
johnny9 (Migrated from github.com) reviewed 2024-03-14 15:23:07 +00:00
johnny9 (Migrated from github.com) commented 2024-03-14 15:23:07 +00:00

I think the about page is important but we might need to just disable the options portion until onboarding is completed

I think the about page is important but we might need to just disable the options portion until onboarding is completed
D33r-Gee (Migrated from github.com) reviewed 2024-03-14 15:34:31 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-14 15:34:31 +00:00

sounds good... do you think disabling the options portion should be part of this PR?

sounds good... do you think disabling the options portion should be part of this PR?
D33r-Gee (Migrated from github.com) reviewed 2024-03-14 18:56:15 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-14 18:56:15 +00:00

updated the file from 31ca4220de68ccf85bf4d2a38ef5d5da06f4e624 to 4580643d48fc9e74f66c44f47f6ea9aed3c26941

Added TODO comments

updated the file from 31ca4220de68ccf85bf4d2a38ef5d5da06f4e624 to 4580643d48fc9e74f66c44f47f6ea9aed3c26941 Added TODO comments
pablomartin4btc (Migrated from github.com) reviewed 2024-03-15 20:42:40 +00:00
pablomartin4btc (Migrated from github.com) left a comment

tACK 22fb833b4ae86eee716d41468d9044c218a7bd9f

Tested on Ubuntu 22.04.

1. Building Issues (dynamic)/ Errors while running bitcoin-qt (Prerequisites section).

I wanted to try first if I needed any of the listed packages in the Prerequisites section in the description or if I have them already in my system.

./src/qt/bitcoin-qt -signet
QQmlApplicationEngine failed to load component
qrc:/qml/pages/main.qml:65:13: Type OnboardingStorageLocation unavailable
qrc:/qml/pages/onboarding/OnboardingStorageLocation.qml:25:17: Type StorageLocations unavailable
qrc:/qml/components/StorageLocations.qml:8:1: module "QtQuick.Dialogs" is not installed

I've then ran the commands provided by the author of the PR to install them, but it seems I already have them and the same error persisted when I re-try to execute bitcoin-qt.

qtquickcontrols2-5-dev is already the newest version (5.15.3+dfsg-1).
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
qml-module-qtquick-controls2 is already the newest version (5.15.3+dfsg-1).
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
qtdeclarative5-dev is already the newest version (5.15.3+dfsg-1).
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.

At the end I found I needed also this one qml-module-qtquick-dialogs, so please update the section accordingly if you think this is correct.

2. On-boarding/ Settings defaults behaviour against #284 and main have changed.

Before testing the new feature wanted to check previous (#284/ main) behaviour and I noticed the default values of the settings have changed.

Before, main and #284 branches screenshot:

Screenshot from 2024-03-14 19-33-03

This PR's branch D33r-Gee:qml-intro-custom-datadir screenshot:

Screenshot from 2024-03-14 19-33-50

Not only that, dbcache setting value, introduced by #284 (not merged into main yet), changes every time it's persisted after I delete the default datadir:

(e.g. 3rd. or 4th. time)

{
    "dbcache": 1930848896,
    "prune": 1907
}

(e.g. After...)

{
    "dbcache": 154710288,
    "prune": 1907
}

dbcache is calculated, there's no (at the moment) field where a user can change its value.

Note: the rest of settings are not persisted because all false or 0 (zero) values are not persisted after #284 changes.

It seems there is an issue integrating #284 or basing your code on top of it. Please keep in mind that it would be easier for reviewers to check you haven't missed any changes and that these are in the correct order.

image

Perhaps it's due to this removed line in 1st commit 5cc827339e4c891bcb13f9b41677e4cabab3d981 (?):

image

3. Testing Custom Datadir Wiring feature.

First time I set the new custom data dir I get these errors:

Screenshot from 2024-03-14 19-38-46

./src/qt/bitcoin-qt -signet
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Model size of -23 is less than 0

(bitcoin-qt:1000052): Gtk-CRITICAL **: 19:11:15.772: gtk_image_set_from_gicon: assertion 'GTK_IS_IMAGE (image)' failed
Running initialization in thread
Running Shutdown in thread
Shutdown finished

I checked that Model size of -23 is less than 0 happens once the FileDialog opens.
I tried to get the Gtk-CRITICAL again but only happened to me the very first time I tested the app and never again.

Once I've created a custom datadir and it works fine, everything gets saved there (except for the issue with the correct value of settings mentioned in 2.).

Now, second time I run the app the settings displayed and saved are totally messed up:

{
    "dbcache": -752209344,
    "listen": true,
    "natpmp": false,
    "prune": 0,
    "server": false,
    "upnp": false
}

Another thing I noticed is that once I close the app if I delete the test chain subdirectory of the custom datadir (eg signet), which contains the settings.json file, when I start the app again still believes I'm on-boarded, don't get asked about the settings and that shouldn't be the case I think.

Screenshot from 2024-03-14 19-40-26

As part of this PR, shouldn't we show the custom datadir that has been selected by the user somewhere? Perhaps as a non editable field in the Storage settings page?

tACK 22fb833b4ae86eee716d41468d9044c218a7bd9f Tested on Ubuntu 22.04. <details> <summary>1. Building Issues (dynamic)/ Errors while running <code>bitcoin-qt</code> (<b>Prerequisites</b> section).</summary> I wanted to try first if I needed any of the listed packages in the **Prerequisites** section in the description or if I have them already in my system. ``` ./src/qt/bitcoin-qt -signet QQmlApplicationEngine failed to load component qrc:/qml/pages/main.qml:65:13: Type OnboardingStorageLocation unavailable qrc:/qml/pages/onboarding/OnboardingStorageLocation.qml:25:17: Type StorageLocations unavailable qrc:/qml/components/StorageLocations.qml:8:1: module "QtQuick.Dialogs" is not installed ``` I've then ran the commands provided by the author of the PR to install them, but it seems I already have them and the same error persisted when I re-try to execute `bitcoin-qt`. ``` qtquickcontrols2-5-dev is already the newest version (5.15.3+dfsg-1). 0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. qml-module-qtquick-controls2 is already the newest version (5.15.3+dfsg-1). 0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. qtdeclarative5-dev is already the newest version (5.15.3+dfsg-1). 0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. ``` At the end I found I needed also this one `qml-module-qtquick-dialogs`, so please update the section accordingly if you think this is correct. </details> <details> <summary>2. On-boarding/ Settings defaults behaviour against <a href="https://github.com/bitcoin-core/gui-qml/pull/284">#284</a> and <code>main</code> have changed.</summary> Before testing the new feature wanted to check previous (#284/ `main`) behaviour and I noticed the default values of the settings have changed. Before, `main` and #284 branches screenshot: ![Screenshot from 2024-03-14 19-33-03](https://git.fish.foo/attachments/425f97fe-823f-4dec-90fd-6892c41e84ef) This PR's branch `D33r-Gee:qml-intro-custom-datadir` screenshot: ![Screenshot from 2024-03-14 19-33-50](https://git.fish.foo/attachments/972ec444-fbe1-4cca-888e-47c54f5b9ead) Not only that, `dbcache` setting value, introduced by #284 (not merged into `main` yet), changes every time it's persisted after I delete the default datadir: (e.g. 3rd. or 4th. time) ``` { "dbcache": 1930848896, "prune": 1907 } ``` (e.g. After...) ``` { "dbcache": 154710288, "prune": 1907 } ``` `dbcache` is calculated, there's no (at the moment) field where a user can change its value. Note: the rest of settings are not persisted because all `false` or `0` (zero) values are not persisted after #284 changes. It seems there is an issue integrating #284 or basing your code on top of it. Please keep in mind that it would be easier for reviewers to check you haven't missed any changes and that these are in the correct order. ![image](https://git.fish.foo/attachments/51d42b60-8e3a-4950-8540-54a5a82e9a1a) Perhaps it's due to this removed line in 1st commit 5cc827339e4c891bcb13f9b41677e4cabab3d981 (?): ![image](https://git.fish.foo/attachments/c337cb46-5393-4ff6-8eb8-19c2a876d9a3) </details> <details> <summary>3. Testing Custom Datadir Wiring feature.</summary> First time I set the new custom data dir I get these errors: ![Screenshot from 2024-03-14 19-38-46](https://git.fish.foo/attachments/7cb792b0-e1fc-4946-81a2-b85550184485) ``` ./src/qt/bitcoin-qt -signet Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. Model size of -23 is less than 0 (bitcoin-qt:1000052): Gtk-CRITICAL **: 19:11:15.772: gtk_image_set_from_gicon: assertion 'GTK_IS_IMAGE (image)' failed Running initialization in thread Running Shutdown in thread Shutdown finished ``` I checked that `Model size of -23 is less than 0` happens once the FileDialog opens. I tried to get the `Gtk-CRITICAL` again but only happened to me the very first time I tested the app and never again. Once I've created a custom datadir and it works fine, everything gets saved there (except for the issue with the correct value of settings mentioned in 2.). Now, second time I run the app the settings displayed and saved are totally messed up: ``` { "dbcache": -752209344, "listen": true, "natpmp": false, "prune": 0, "server": false, "upnp": false } ``` Another thing I noticed is that once I close the app if I delete the test chain subdirectory of the custom datadir (eg signet), which contains the `settings.json` file, when I start the app again still believes I'm on-boarded, don't get asked about the settings and that shouldn't be the case I think. ![Screenshot from 2024-03-14 19-40-26](https://git.fish.foo/attachments/fc869721-d991-473c-8be0-6a3e27bcb570) </details> As part of this PR, shouldn't we show the custom datadir that has been selected by the user somewhere? Perhaps as a non editable field in the Storage settings page?
D33r-Gee commented 2024-03-18 22:58:44 +00:00 (Migrated from github.com)

At the end I found I needed also this one qml-module-qtquick-dialogs, so please update the section accordingly if you think this is correct.

Great catch @pablomartin4btc! Updated the description

> At the end I found I needed also this one `qml-module-qtquick-dialogs`, so please update the section accordingly if you think this is correct. Great catch @pablomartin4btc! Updated the description
D33r-Gee commented 2024-03-18 23:06:30 +00:00 (Migrated from github.com)

Another thing I noticed is that once I close the app if I delete the test chain subdirectory of the custom datadir (eg signet), which contains the settings.json file, when I start the app again still believes I'm on-boarded, don't get asked about the settings and that shouldn't be the case I think.

In this case the the custom directory needs to be deleted as well, since the code cached the top level directory and just the chainstate one (i.e. signet). In other words if you'd like to test onboarding again you'd have rm -r custom

> Another thing I noticed is that once I close the app if I delete the test chain subdirectory of the custom datadir (eg signet), which contains the `settings.json` file, when I start the app again still believes I'm on-boarded, don't get asked about the settings and that shouldn't be the case I think. In this case the the `custom` directory needs to be deleted as well, since the code cached the top level directory and just the chainstate one (i.e. `signet`). In other words if you'd like to test onboarding again you'd have `rm -r custom`
D33r-Gee commented 2024-03-18 23:08:31 +00:00 (Migrated from github.com)

As part of this PR, shouldn't we show the custom datadir that has been selected by the user somewhere? Perhaps as a non editable field in the Storage settings page?

that's a good point... will update that along with @johnny9 android patches

> As part of this PR, shouldn't we show the custom datadir that has been selected by the user somewhere? Perhaps as a non editable field in the Storage settings page? that's a good point... will update that along with @johnny9 android patches
jarolrod (Migrated from github.com) reviewed 2024-03-20 08:12:05 +00:00
jarolrod (Migrated from github.com) left a comment

Let's make this draft as it still needs a good bit of work. It's a requirement that changes need to work with all builds (dynamic + static)

Let's make this draft as it still needs a good bit of work. It's a requirement that changes need to work with all builds (dynamic + static)
jarolrod (Migrated from github.com) reviewed 2024-03-20 08:17:34 +00:00
jarolrod (Migrated from github.com) commented 2024-03-20 08:17:30 +00:00

Why is this needed for this change, an idea early on is that we would avoid a class like this if it's not necessary. I don't see the following changes as necessary for setting the strDataDir Setting

Why is this needed for this change, an idea early on is that we would avoid a class like this if it's not necessary. I don't see the following changes as necessary for setting the strDataDir Setting
jarolrod (Migrated from github.com) commented 2024-03-20 08:14:44 +00:00

I really don't think any of this is needed, we can just have a flag in our qml options model to not write settings but store their value in memory. When a new setting is added, we then need to update changes in one more place (this file) when it's not exactly necessary.

I really don't think any of this is needed, we can just have a flag in our qml options model to not write settings but store their value in memory. When a new setting is added, we then need to update changes in one more place (this file) when it's not exactly necessary.
D33r-Gee (Migrated from github.com) reviewed 2024-03-20 22:00:10 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-20 22:00:10 +00:00

can a flag in qml options model be set without requiring node init?

can a flag in qml options model be set without requiring node init?
D33r-Gee (Migrated from github.com) reviewed 2024-03-20 22:04:23 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-20 22:04:23 +00:00

the logic behind having a separate class came from qt/bitcoin.h and cpp where the class is set to accomodate member variables... Do you think this can be achieve with just the anymous "namespace" within qml/bitcoin.cpp?

the logic behind having a separate class came from qt/bitcoin.h and cpp where the class is set to accomodate member variables... Do you think this can be achieve with just the anymous "namespace" within qml/bitcoin.cpp?
D33r-Gee commented 2024-03-20 23:09:39 +00:00 (Migrated from github.com)

Let's make this draft as it still needs a good bit of work. It's a requirement that changes need to work with all builds (dynamic + static)

Great... I'll make it a draft...

BTW, @johnny9's patches for android to include the FileDialog functionality also work with the x86_64-pc-linux-gnu static build.

> Let's make this draft as it still needs a good bit of work. It's a requirement that changes need to work with all builds (dynamic + static) Great... I'll make it a draft... BTW, @johnny9's patches for android to include the FileDialog functionality also work with the `x86_64-pc-linux-gnu` static build.
pablomartin4btc (Migrated from github.com) reviewed 2024-03-22 02:59:09 +00:00
pablomartin4btc (Migrated from github.com) left a comment

Regarding the commits, please consider the contributing guidelines about the commit titles (~50 chars max).

2nd commit name/ title should be the same as the original from @johnny9, also should not be at the top?

Perhaps would be easier to make this change independent from #284, making it just the control and the component to work (file dialog, libraries, etc) and later making it persistent as a follow up while #284 gets approved? Just thinking loud about it.

Regarding the commits, please consider the [contributing guidelines](https://github.com/bitcoin-core/gui-qml/blob/main/CONTRIBUTING.md#committing-patches) about the commit titles ([~50 chars max](https://cbea.ms/git-commit/)). 2nd commit name/ title should be the same as the original from @johnny9, also should not be at the top? Perhaps would be easier to make this change independent from #284, making it just the control and the component to work (file dialog, libraries, etc) and later making it persistent as a follow up while #284 gets approved? Just thinking loud about it.
MarnixCroes (Migrated from github.com) reviewed 2024-03-25 09:40:32 +00:00
MarnixCroes (Migrated from github.com) left a comment

agree with

As part of this PR, shouldn't we show the custom datadir that has been selected by the user somewhere? Perhaps as a non editable field in the Storage settings page?

https://github.com/bitcoin-core/gui-qml/pull/390#pullrequestreview-1940546706

agree with > As part of this PR, shouldn't we show the custom datadir that has been selected by the user somewhere? Perhaps as a non editable field in the Storage settings page? https://github.com/bitcoin-core/gui-qml/pull/390#pullrequestreview-1940546706
MarnixCroes (Migrated from github.com) commented 2024-03-25 08:00:08 +00:00

duplicate

```suggestion ``` duplicate
MarnixCroes (Migrated from github.com) reviewed 2024-03-25 09:47:54 +00:00
MarnixCroes (Migrated from github.com) left a comment

edit: some github bug, the other one wasn't visible

agree with

As part of this PR, shouldn't we show the custom datadir that has been selected by the user somewhere? Perhaps as a non editable field in the Storage settings page?

https://github.com/bitcoin-core/gui-qml/pull/390#pullrequestreview-1940546706

edit: some github bug, the other one wasn't visible agree with >As part of this PR, shouldn't we show the custom datadir that has been selected by the user somewhere? Perhaps as a non editable field in the Storage settings page? https://github.com/bitcoin-core/gui-qml/pull/390#pullrequestreview-1940546706
MarnixCroes commented 2024-03-25 18:35:52 +00:00 (Migrated from github.com)

it crashed once when clicking Custom at Storage Location. 951387487f0ad187d646f7c4b96f37c1e01d431d

terminal output

Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable)
Bail out! Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable)
Aborted (core dumped)

haven't been able to repro

it crashed once when clicking _Custom_ at _Storage Location_. 951387487f0ad187d646f7c4b96f37c1e01d431d terminal output ``` Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable) Bail out! Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable) Aborted (core dumped) ``` haven't been able to repro
D33r-Gee commented 2024-03-25 21:00:04 +00:00 (Migrated from github.com)

it crashed once when clicking Custom at Storage Location. 9513874

terminal output

Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable)
Bail out! Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable)
Aborted (core dumped)

haven't been able to repro

@MarnixCroes, thanks for testing and reviewing

Does this mean it the crashing is persisting or that it only happened once?

Also are you testing on Ubuntu? if so what version?

> it crashed once when clicking _Custom_ at _Storage Location_. [9513874](https://github.com/bitcoin-core/gui-qml/commit/951387487f0ad187d646f7c4b96f37c1e01d431d) > > terminal output > > ``` > Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable) > Bail out! Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable) > Aborted (core dumped) > ``` > > haven't been able to repro @MarnixCroes, thanks for testing and reviewing Does this mean it the crashing is persisting or that it only happened once? Also are you testing on Ubuntu? if so what version?
johnny9 (Migrated from github.com) requested changes 2024-03-26 04:27:37 +00:00
johnny9 (Migrated from github.com) left a comment

Some minor things still to clean up.

Some minor things still to clean up.
johnny9 (Migrated from github.com) commented 2024-03-25 02:42:14 +00:00

Remove unnecessary comments

Remove unnecessary comments
johnny9 (Migrated from github.com) commented 2024-03-25 02:42:04 +00:00

whitespace

whitespace
johnny9 (Migrated from github.com) commented 2024-03-25 02:42:31 +00:00

whitespace

whitespace
johnny9 (Migrated from github.com) commented 2024-03-24 00:54:43 +00:00

whitespace

whitespace
johnny9 (Migrated from github.com) commented 2024-03-26 04:27:17 +00:00

I think Jarol is right. This seems like too much duplication with the Options model. The Node in the options model can just be allowed to be null and set later. That way it can gather up the values during onboarding and set them only when the node is setup after onboarding is complete.

I think Jarol is right. This seems like too much duplication with the Options model. The Node in the options model can just be allowed to be null and set later. That way it can gather up the values during onboarding and set them only when the node is setup after onboarding is complete.
MarnixCroes commented 2024-03-26 07:35:38 +00:00 (Migrated from github.com)

it crashed once when clicking Custom at Storage Location. 9513874
terminal output

Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable)
Bail out! Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable)
Aborted (core dumped)

haven't been able to repro

@MarnixCroes, thanks for testing and reviewing

Does this mean it the crashing is persisting or that it only happened once?

Also are you testing on Ubuntu? if so what version?

it only happened once. can't reproduce yet
This was indeed on ubuntu, 22.04.4 LTS

> > it crashed once when clicking _Custom_ at _Storage Location_. [9513874](https://github.com/bitcoin-core/gui-qml/commit/951387487f0ad187d646f7c4b96f37c1e01d431d) > > terminal output > > ``` > > Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable) > > Bail out! Gtk:ERROR:../../../../gtk/gtkpathbar.c:1342:set_button_image_get_info_cb: assertion failed: (cancellable == data->button_data->cancellable) > > Aborted (core dumped) > > ``` > > > > > > > > > > > > > > > > > > > > > > > > haven't been able to repro > > @MarnixCroes, thanks for testing and reviewing > > Does this mean it the crashing is persisting or that it only happened once? > > Also are you testing on Ubuntu? if so what version? it only happened once. can't reproduce yet This was indeed on ubuntu, 22.04.4 LTS
D33r-Gee (Migrated from github.com) reviewed 2024-03-26 15:09:34 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-26 15:09:34 +00:00

thanks for finding that!

thanks for finding that!
D33r-Gee (Migrated from github.com) reviewed 2024-03-26 15:15:42 +00:00
D33r-Gee (Migrated from github.com) commented 2024-03-26 15:15:42 +00:00

sounds good

sounds good
D33r-Gee commented 2024-03-27 18:38:41 +00:00 (Migrated from github.com)

Based on @pablomartin4btc and @johnny9 feedback:

Converted to draft for now and will post follow up PR with only the UI elements for more straight forward reviewing and merging.

Based on @pablomartin4btc and @johnny9 feedback: Converted to draft for now and will post follow up PR with only the UI elements for more straight forward reviewing and merging.
D33r-Gee (Migrated from github.com) reviewed 2024-04-04 19:59:17 +00:00
D33r-Gee (Migrated from github.com) commented 2024-04-04 19:59:17 +00:00

makes sense modified the code in a separate branch and will push into new PR once the UI one have been merged.

makes sense modified the code in a separate branch and will push into new PR once the UI one have been merged.
D33r-Gee (Migrated from github.com) reviewed 2024-04-04 20:00:00 +00:00
D33r-Gee (Migrated from github.com) commented 2024-04-04 20:00:00 +00:00

Ok got the custom datadir to work with an anonymous namespace in separate branch... Will update and push the code in a new PR once the UI ones have been merged

Ok got the custom datadir to work with an anonymous namespace in separate branch... Will update and push the code in a new PR once the UI ones have been merged
D33r-Gee (Migrated from github.com) reviewed 2024-04-04 20:00:57 +00:00
D33r-Gee (Migrated from github.com) commented 2024-04-04 20:00:57 +00:00

thx

thx
jarolrod commented 2024-09-25 11:05:07 +00:00 (Migrated from github.com)
replaced by https://github.com/bitcoin-core/gui-qml/pull/408
Sign in to join this conversation.
No description provided.