Commit Graph

118 Commits

Author SHA1 Message Date
f321x d34129ef5c qml: deduplicate wallet name validation
Deduplicates the wallet name validation between wizard and daemon.
2026-04-23 16:11:36 +02:00
SomberNight cf25990973 locale: don't translate string "Electrum", "BIP39" 2026-02-19 16:13:44 +00:00
f321x 5952d8c614 qml: validate server address in ServerConfig
Same as Qt, validate the server address the user enters and prevent the
user from continuing in the wizard or clicking 'Ok' in the ServerConfig
if the entered address is clearly invalid.
2026-01-26 14:40:02 +01:00
f321x 3b028b06a0 qml: enforce use of existing password for wallet creation
When creating a new wallet in a Electrum instance with existing wallets
this change forces the user to reuse a password of any existing wallet
if `SimpleConfig.WALLET_USE_SINGLE_PASSWORD` is True.
This prevents the amount of different passwords from increasing and
guides the user towards a single wallet password (the intended default).
2025-12-17 14:01:41 +01:00
f321x e6f73522cb fix: wizard: qml: call checkIfLast in WCHaveSeed
When the user has already loaded a wallet in QML and tries to restore a
new wallet `WCHaveSeed.qml` incorrectly shows a `Finish` button instead
of a `Next` button and raises a KeyError if the user clicks on Finish
instead of resolving the passphrase input view (regression from
https://github.com/spesmilo/electrum/pull/10016).

This happens because `last` of `have_seed` depends on
`NewWalletWizard.is_single_password()` and NewWalletWizard.wants_ext(wizard_data).
`is_single_password()` is true if a wallet is already loaded,
while `wants_ext(wizard_data)` is false as `wants_ext()` depends on `seed_extend: True` in
`wizard_data` which only gets set after `apply()` of `WCHaveSeed` gets
called, however the evaluation of `WCHaveSeed` being the last view
happens before the view is shown.
By calling `checkIsLast()` in the validation timer of `WCHaveSeed` the
`last` property gets set again after `apply()` has been called, so
the view is guaranteed to correctly show either the `Finish` or `Next` button
after a seed has been entered.
2025-08-11 15:05:17 +02:00
Sander van Grieken aaed64c45a android: pass on QR binary scan result data as well
qml: add signals for QEQRScanner and fallbacks, add QEBytes container type
so we can pass along byte arrays between QML and python, port qr scan
occurrences to new signals.
2025-07-24 13:58:45 +02:00
SomberNight bfd3c0e48c Merge branch spesmilo/pr/10016' into 202507_pr10016_qml_wizard_passphrase 2025-07-20 22:02:01 +00:00
f321x 290da21187 qml: change wizard passphrase flow 2025-07-15 00:19:25 +02:00
f321x aefb180007 fix: qml: wizard: delete seed_type if not set
deletes the `seed_type` key from `wizard_data` in `WCWalletType` if it
is not explicitly set to prevent a stale value from a previous wizard
flow if the user goes back in the wizard and selects a different wallet
type instead of completing the wizard with the previously selected
wallet type.
This happens as the `apply()` function gets called with the
previously set radio button (e.g. 2fa) if the user goes back, if he then
selects multisig the `2fa_segwit` `seed_type` won't get cleared and
cause the exception later.
Example exception when first selecting 2fa, then going back and creating
a multisig wallet:
```
32.77 | E | gui.qml.qeapp.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/vagrant/electrum/electrum/gui/qml/qewizard.py", line 40, in submit
    view = self.resolve_next(self._current.view, wdata)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vagrant/electrum/electrum/wizard.py", line 78, in resolve_next
    view_accept(wizard_data)
  File "/home/vagrant/electrum/electrum/wizard.py", line 501, in maybe_master_pubkey
    wizard_data['multisig_master_pubkey'] = self.keystore_from_data(wizard_data['wallet_type'], wizard_data).get_master_public_key()
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vagrant/electrum/electrum/wizard.py", line 339, in keystore_from_data
    return keystore.from_seed(data['seed'], passphrase=seed_extension, for_multisig=for_multisig)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vagrant/electrum/electrum/keystore.py", line 1197, in from_seed
    raise BitcoinException('Unexpected seed type {}'.format(repr(t)))
electrum.util.BitcoinException: Unexpected seed type '2fa_segwit'
```

Triggered by the following wizard stack:
```
 30.94 | D | wizard | view=create_seed
 30.94 | D | wizard | resolve_next view is confirm_seed
 30.94 | D | wizard | wizard stack:
0: 0x7fdc6804ae80 - {}

1: 0x7fdc6ac61400 - {'wallet_name': 'wallet_1'}

2: 0x7fdc680d8a80 - {'seed_type': '2fa_segwit', 'wallet_name': 'wallet_1', 'wallet_type': 'multisig'}

3: 0x7fdc6804ab00 - {'multisig_cosigner_data': {}, 'multisig_participants': 2, 'multisig_signatures': 2, 'seed_type': '2fa_segwit', 'wallet_name': 'wallet_1', 'wallet_type': 'multisig'}

4: 0x7fdc6807f0c0 - {'keystore_type': 'createseed', 'multisig_cosigner_data': {}, 'multisig_participants': 2, 'multisig_signatures': 2, 'seed_type': '2fa_segwit', 'wallet_name': 'wallet_1', 'wallet_type': 'multisig'}

c: 0x7fdc6807c380 - {'keystore_type': 'createseed', 'multisig_cosigner_data': {}, 'multisig_participants': 2, 'multisig_signatures': 2, 'seed': '<redacted>', 'seed_extend': False, 'seed_extra_words': '<redacted>', 'seed_type': '2fa_segwit', 'seed_variant': 'electrum', 'wallet_name': 'wallet_1', 'wallet_type': 'multisig'}
 30.94 | W | gui.qml.qeapp | next view: confirm_seed
```
2025-07-09 16:29:20 +02:00
Sander van Grieken b5170a3fa6 qml: oneserver, auto-connect combobox 2025-06-02 13:31:05 +02:00
Sander van Grieken 1dfe2ccec0 qml: show option for single server in ServerConfig 2025-05-19 18:07:29 +02:00
f321x adaafeaae1 disable proxy checkbox in ProxyConfig by default
disable the checkbox by default, so that if a user selects Enable Proxy
in the advanced network settings, and then just clicks next with the proxy
checkbox set, doesn't end up with a invalid proxy configuration which
doesn't connect to the server and has to be fixed manually.
2025-05-13 14:28:22 +02:00
f321x 38f51a3b13 qml: add terms of use to setup wizard 2025-05-13 14:28:13 +02:00
Sander van Grieken 7ee863f225 wizard: hint for primary signer xpub instead of xprv 2024-11-13 14:51:14 +01:00
Sander van Grieken 624de1d43c qml: show invalid derivation path message to user in WCScriptAndDerivation 2024-10-24 16:40:02 +02:00
Sander van Grieken 6bc15e21ba qml: fix display validation error in WCHaveSeed 2024-10-24 16:18:00 +02:00
Sander van Grieken 831aa80661 qml: remove pageindicator from wizard 2024-10-09 16:38:28 +02:00
Sander van Grieken 70ebe4fc2f qml: wallet name size in wizard 2024-10-07 14:52:48 +02:00
Sander van Grieken 8ce1e6453b wizard: skip/hide passphrase option for 'old' and '2fa' seeds (see #4326) 2024-02-21 17:15:10 +01:00
Sander van Grieken 0a6b2d521b qml: move final wizard submit() to WizardComponent.finish handler 2024-02-05 11:13:58 +01:00
accumulator 019baa5a71 Merge pull request #8862 from SomberNight/202401_qml_wizard_final_accept
qml wizard: run navmap[view]['accept'] handler a final time on finish
2024-02-05 10:46:22 +01:00
SomberNight 07dc80dd9a qml wizard: stricter validation for new wallet name
user on bitcointalk [0] tried to create wallet with name "w/o 2FA".
Before this, one would only get an error after the last page of the wizard.
With this, the "Next" button does not even get enabled if the name does not look ok.
(and as in comment, maybe we should be even stricter re what is allowed)

[0]: https://bitcointalk.org/index.php?topic=5483514.msg63584789#msg63584789
2024-02-04 08:54:40 +00:00
SomberNight 48a96f6776 qml wizard: run navmap[view]['accept'] handler a final time on finish
For example, see
https://github.com/spesmilo/electrum/blob/061c8211281d6c0b50166e4075656ce0fb2c89f5/electrum/plugins/trustedcoin/trustedcoin.py#L624
Even if navmap[view]['last'] is True, we still want the navmap[view]['accept'] handler to run.

fixes https://github.com/spesmilo/electrum/issues/8861

---

Note that an analogous issue does not exist for the desktop qt gui,
see https://github.com/spesmilo/electrum/blob/061c8211281d6c0b50166e4075656ce0fb2c89f5/electrum/gui/qt/wizard/wizard.py#L206
There, wizard.resolve_next is called regardless of is_last.
2024-01-31 12:59:47 +00:00
SomberNight cb55c65677 qml wizard: WCWalletPassword: show warning if pw is too short 2024-01-31 10:28:10 +00:00
SomberNight 67b57da402 qml: WCHaveMasterKey: (fix) re-verify text in onTextChanged
fixes https://github.com/spesmilo/electrum/issues/8853

This is a bit ugly, but activeFocus is declared as final and cannot be overridden directly...
```
  1.42 | W | gui.qml.qeapp | file:///home/user/wspace/electrum/electrum/gui/qml/components/controls/ElTextArea.qml:23:5: Cannot override FINAL property
```
2024-01-30 02:11:01 +00:00
Sander van Grieken 92bff08ba5 qml: don't use predictive text for fields where it makes no sense 2023-12-29 16:18:03 +01:00
Sander van Grieken ebcecdccce qt,qml: add checkboxes for advanced network config on welcome page, remove separate proxy-ask and autoconnect pages 2023-12-21 11:17:48 +01:00
Sander van Grieken 5e39ff49bc add missing accept handler for welcome page 2023-12-19 18:49:16 +01:00
Sander van Grieken a03b2d7bae qt,qml: add a welcome page as initial page for server connect wizard
This is much less intimidating than asking if the user wants to use a proxy
out of the gate.
2023-12-19 18:49:16 +01:00
SomberNight 3b5b75325e qml: WCServerConfig.qml: only disable autoconnect if given server
if the user entered the server select screen and immediately clicked next,
a random server would get set but with auto_connect disabled.
2023-12-19 16:43:59 +00:00
Sander van Grieken 4c8287358a qt, qml: remove email entry from 2FA wallet ToS pages 2023-12-08 12:07:03 +01:00
Sander van Grieken b87d091a6d qt, qml: allow BIP39 seeds which fail checksum or wordlist (fixes #8720)
removes verifySeed from qebitcoin as this code was 99% duplicate of wizard.validate_seed
2023-12-06 16:12:57 +01:00
SomberNight b18f9570fc qml wizard: fix creating imported wallet from camera: concat with space
The parser expects the list of keys/addrs to be whitespace-separated (no commas).
Same as line 61.
2023-11-24 20:48:04 +00:00
Sander van Grieken a57a0d001b qml: make TextAreas more visible 2023-11-15 18:42:11 +01:00
Sander van Grieken 98264f64ad qml: introduce PasswordStrengthIndicator control, and add to PasswordDialog and WCWalletPassword 2023-11-10 09:30:31 +01:00
Sander van Grieken 8b567ae447 qml: remove all QML imports version numbers 2023-11-07 10:17:08 +01:00
Sander van Grieken eb676b3dc1 qml: don't show error when textfield is empty, don't log error when optional propert is undefined 2023-10-23 15:30:56 +02:00
Sander van Grieken 9ed5f7bf43 qml: don't show "select server automatically" checkbox in network setup wizard 2023-10-05 11:01:29 +02:00
Sander van Grieken 05a34fbe24 qml: tap-on-background now removes focus, allowing convenient way to hide keyboard 2023-09-25 16:58:27 +02:00
Sander van Grieken 2caa8f13cf wizard: make wizard.keystore_from_data more robust;
- always store 'keystore_type' in cosigner data and use same types as main
- dont share 'hardware_device' in root of dict, but store for each cosigner
- properly return hardware keystore for hardware cosigners
2023-09-20 14:34:31 +02:00
Sander van Grieken a6aff1ec07 qml: check passphrase not empty when checked 2023-09-20 14:34:30 +02:00
Sander van Grieken 58dbe6690d qml: create ElCombBox and ElRadioButton that automatically word wrap their text element. Fixes #8611 2023-09-12 17:56:35 +02:00
Sander van Grieken f4f88f4294 qml: fix wizard text for keystore, wrap text 2023-07-31 11:43:15 +02:00
Sander van Grieken 8cd95f1f7f qml: limit BIP39 cosigners script type to initial choice (bip39) or initial seed (electrum) 2023-06-02 09:46:53 +02:00
SomberNight e9475345e4 qml wizard: "confirm seed" screen to normalize whitespaces
fixes https://github.com/spesmilo/electrum/issues/8442
2023-05-17 15:19:41 +00:00
Sander van Grieken 4f252a438c qml: validate duplicate master key in WCBIP39Refine for BIP39 cosigner seeds (fixes #8432) 2023-05-15 14:45:21 +02:00
SomberNight d2cf21fc2b qml wizard: enforce homogeneous master keys in multisig
- {xpub, Ypub, Zpub} categories cannot be mixed
- old mpk must not be used in multisig
2023-05-11 10:13:51 +00:00
Sander van Grieken f40d603e64 qml: styling bip39 refine and recovery 2023-05-10 17:16:35 +02:00
Sander van Grieken 0e0c7980dd qml: implement bip39 account detection 2023-05-09 11:40:05 +02:00
Sander van Grieken 1a889d19b5 Merge branch 'seed_keyboard' 2023-05-03 11:47:52 +02:00