Skip to content

gui: Add Open External Wallet action #15204

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

Closed
wants to merge 3 commits into from

Conversation

promag
Copy link
Contributor

@promag promag commented Jan 18, 2019

This PR adds the ability to open external wallets on the GUI.

Screenshot 2019-09-08 at 18 14 36

Screenshot 2019-09-08 at 18 13 17

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 18, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #16963 (wallet: Fix unique_ptr usage in boost::signals2 by promag)
  • #16432 (qt: Add privacy to the Overview page by hebasto)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@Sjors
Copy link
Member

Sjors commented Jan 19, 2019

Concept ACK, but let's put this in the Open Wallet sub menu. You could put a separator underneath the list of known wallets and then call the menu item "Open file...". I don't like the word "External" because it could get confusing if we add (e.g.) hardware wallet support.

@promag
Copy link
Contributor Author

promag commented Jan 19, 2019

@Sjors yes that was already brought up by @jnewbery and in IRC I suggested "File -> Open Wallet -> Other..." On the end of the menu.

@promag
Copy link
Contributor Author

promag commented Jan 19, 2019

@Sjors how about:
screenshot 2019-01-19 at 17 26 36

@jnewbery
Copy link
Contributor

@Sjors how about:

Yes, this looks ideal to me

@promag promag force-pushed the 2019-01-openexternalwallet branch from 5183216 to a3732f3 Compare January 19, 2019 21:04
@promag
Copy link
Contributor Author

promag commented Jan 19, 2019

Updated.

@promag promag force-pushed the 2019-01-openexternalwallet branch from a3732f3 to b537d29 Compare February 12, 2019 22:59
@promag
Copy link
Contributor Author

promag commented Feb 12, 2019

Updated, still rebased on #15195.

@Sjors
Copy link
Member

Sjors commented Feb 13, 2019

tACK b537d29, but note that you can only open directory based wallets

@promag
Copy link
Contributor Author

promag commented Feb 13, 2019

@Sjors right, and it looks like a pain to try to open both with Qt 😕

@promag
Copy link
Contributor Author

promag commented Feb 14, 2019

Is this for 0.18?

@jonasschnelli jonasschnelli added this to the 0.19.0 milestone Feb 14, 2019
@Sjors
Copy link
Member

Sjors commented Feb 15, 2019

Needs rebase because Open Wallet got merged. That shouldn't impact my earlier tACK, so we might be able to add this to 0.18 today (update: too late).

@promag promag force-pushed the 2019-01-openexternalwallet branch from b537d29 to 6cdf236 Compare February 15, 2019 15:28
@promag promag force-pushed the 2019-01-openexternalwallet branch from 6cdf236 to e9a22ff Compare March 17, 2019 22:47
@promag promag force-pushed the 2019-01-openexternalwallet branch from e9a22ff to d6d0191 Compare March 24, 2019 10:29
@jonasschnelli
Copy link
Contributor

Needs rebase

@fanquake
Copy link
Member

fanquake commented Sep 8, 2019

@promag Given that this is tagged for 0.19.0, can you rebase?

@promag
Copy link
Contributor Author

promag commented Sep 19, 2019

It'd be good if the GUI realised when we opened a wallet that's actually inside our wallet directory via the Other... menu, otherwise you end up with the wallet loaded, but not greyed out:

Yes, different PR I guess.

@jonatack
Copy link
Member

jonatack commented Sep 19, 2019

@promag Thanks for the update. While testing f60f80e, I reproduced the issue mentioned above on Debian 4.19.37-5+deb10u2 (2019-08-08) x86_64 GNU/Linux. Opening a wallet-less folder causes the GUI to display the error (all good) but then a second later the GUI attempts to open the wallet anyway and hangs in this state. Reproduced several times with different locations and directories.

Screenshot from 2019-09-19 13-11-45

Same GUI hang issue when opening a wallet dir moved to ~/ and wallet.dat file inside touched to be empty:

Screenshot from 2019-09-19 12-55-58

In both cases, quitting the GUI unhangs the wallet but the wallet hangs until I quit for at least several minutes.

@jonatack
Copy link
Member

jonatack commented Sep 19, 2019

Copying a wallet dir elsewhere with a different name but same wallet files inside, and attempting to load it in the GUI (EDIT: this is a separate issue that has been reported and a PR has been proposed):

$ qt/bitcoin-qt -testnet
terminate called after throwing an instance of 'std::runtime_error'
  what():  BerkeleyBatch: Can't open database wallet.dat (duplicates fileid c4003e0100fe0000fd9fb0c2a56b000000000000 from wallet.dat)
Aborted

Screenshot of a wallet successfully loaded after I moved it from ~/.bitcoin to ~/ with an ampersand (&) displayed correctly in the title bar and the open wallet list:

Screenshot from 2019-09-19 12-41-10

(FWIW a GUI wallet dark mode would be great).

@promag
Copy link
Contributor Author

promag commented Sep 19, 2019

@jonatack regarding the "duplicates fileid " crash see #16776 (comment)

@promag
Copy link
Contributor Author

promag commented Sep 27, 2019

@jonatack just to be sure, if you repeat the above tests with loadwallet in the console you would get the same problems?

@jonasschnelli
Copy link
Contributor

Tested a bit.
What I think is hard to understand is that one needs to select a folder rather than a wallet.dat file.

I think either we allow to select wallet.dat files or inform the user that only wallet-directories are allowed ("select a wallet folder").

@promag
Copy link
Contributor Author

promag commented Oct 9, 2019

select a wallet folder

I like that.

MarkLTZ added a commit to litecoinz-core/litecoinz that referenced this pull request Nov 17, 2019
@promag promag force-pushed the 2019-01-openexternalwallet branch from f60f80e to fd60c53 Compare December 15, 2019 22:20
@promag promag force-pushed the 2019-01-openexternalwallet branch from fd60c53 to 60b3947 Compare December 15, 2019 23:22
@Sjors
Copy link
Member

Sjors commented Dec 16, 2019

If you make OpenExternalWalletActivity a subclass of OpenWalletActivity it would save duplicate code, which is especially nice in Open[External]WalletActivity::open() with its QTimer::singleShot.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 8, 2020

Needs rebase

@laanwj laanwj modified the milestones: 0.20.0, 0.21.0 Mar 26, 2020
@laanwj laanwj added the Feature label Mar 26, 2020
@jonasschnelli
Copy link
Contributor

Needs addressing comments or should otherwise be closed.

@promag
Copy link
Contributor Author

promag commented Aug 17, 2020

Will rebase and open in gui repo.

@promag promag closed this Aug 17, 2020
@promag promag deleted the 2019-01-openexternalwallet branch August 17, 2020 00:07
@promag
Copy link
Contributor Author

promag commented Aug 30, 2020

Tested a bit.
What I think is hard to understand is that one needs to select a folder rather than a wallet.dat file.

I think either we allow to select wallet.dat files or inform the user that only wallet-directories are allowed ("select a wallet folder").

I've tried to support selecting files and folders but this kind of sucks because in order be intuitive it needs non native file dialog - it allows to set a proxy model.

Anyway, I think the best approach, and considering sqlite wallets, selecting wallet.dat is indeed the best option for the moment.

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.