1
0
Commit Graph

127 Commits

Author SHA1 Message Date
Sander van Grieken
3ff84f08a6 plugins: psbt_nostr: implement for qml 2025-04-15 14:06:29 +02:00
Sander van Grieken
f76218ea83 qml: introduce InfoBanner allowing a clickable sticky message to stay below header and
implement ln utxo reserve check with warning. Clicking shows a suggestion to swap.
2025-04-03 14:39:05 +02:00
Sander van Grieken
1559129016 qml: properly destroy ExceptionDialog after close, improve encapsulation 2025-03-28 14:51:12 +01:00
Sander van Grieken
993a575b7f submarine_swaps: implement swaps-over-nostr for qml 2025-02-14 09:54:09 +01:00
Sander van Grieken
19a4b149d3 qml: show proper Payment failed message when reason is empty (e.g. from previous session)
also capitalisation consistency.
2025-01-17 13:02:28 +01:00
SomberNight
11614f035d qml: "wallet_else_pin" auth should only use the wallet pw if is unified
related https://github.com/spesmilo/electrum/pull/9074
2024-05-30 16:17:21 +00:00
ghost43
183bdd1464 Merge pull request #9073 from accumulator/android_qr_scanner_fix
qml: don't unbind/unregister the ActivityResultListener from within the ActivityResultListener handler func
2024-05-30 15:51:26 +00:00
Sander van Grieken
8085c41cfb qml: don't rely on wallet when deactivating PIN and no wallet loaded (fixes #8366) 2024-05-30 15:23:25 +02:00
Sander van Grieken
450b9a03ce qml: don't unbind/unregister the ActivityResultListener from within the ActivityResultListener handler func.
instead, schedule a queued finished signal to unregister the listener after the handler has finished.
See PythonActivity.java in P4A for why this probably causes the most often occurring crash we see on the Play Store:

```
Exception java.lang.RuntimeException:
  at android.app.ActivityThread.deliverResults (ActivityThread.java:5164)
  at android.app.ActivityThread.handleSendResult (ActivityThread.java:5205)
  at android.app.servertransaction.ActivityResultItem.execute (ActivityResultItem.java:51)
  at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2136)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:236)
  at android.app.ActivityThread.main (ActivityThread.java:8061)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:656)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:967)
Caused by java.util.ConcurrentModificationException:
  at java.util.ArrayList$Itr.next (ArrayList.java:860)
  at org.kivy.android.PythonActivity.onActivityResult (PythonActivity.java:218)
  at android.app.Activity.dispatchActivityResult (Activity.java:8501)
  at android.app.ActivityThread.deliverResults (ActivityThread.java:5157)
```
2024-05-30 14:53:33 +02:00
Sander van Grieken
b0227c7e03 qml: add HelpDialog and HelpButton for showing additional info 2024-02-23 10:28:11 +01:00
accumulator
d8bd55bf4e Merge pull request #8758 from accumulator/qml_error_dialogs
qml: use warning icon and error title for failure messagedialogs
2023-12-22 16:55:01 +01:00
Sander van Grieken
6e576f2a08 qml: fix cancelling network wizard not closing app 2023-12-19 18:37:53 +01:00
Sander van Grieken
524adaf747 qml: use warning icon and error title for failure messagedialogs 2023-12-19 15:58:39 +01:00
Sander van Grieken
f8eb2e8cf8 qml: resize menus according to content 2023-11-15 17:35:08 +01:00
Sander van Grieken
11d39cd942 qml: fix keyboard exclusion zone
turns out that Qt.inputMethod.keyboardRectangle.height is not suitable for calculating the exact keyboard
dimensions in Qt coordinates. Instead, use Qt.inputMethod.keyboardRectangle.y transformed to Qt coordinates
using Screen.devicePixelRatio

Note: Qt.inputMethod.keyboardRectangle stop being updated after exiting FLAG_SECURE state
(e.g. in seed or master key entry pages)
2023-11-07 10:32:00 +01:00
Sander van Grieken
32c1915de4 qml: restore Send/ScanDialog for desktop/dev, keeping qr scan Activity for android only.
Also use stable R package, regardless of APP_PACKAGE_DOMAIN used in build.
2023-11-07 10:17:10 +01:00
SomberNight
5c3e14d8de qml: replace Send/ScanDialog with java bases zxing qr scan activity. 2023-11-07 10:17:10 +01:00
Sander van Grieken
a77ff9943a qml: refactor qr scan to qt6
As the method of capturing frames is totally different, the animation when
a QR is found has been removed.
2023-11-07 10:17:10 +01:00
Sander van Grieken
65d41ccc49 qml: qualify all signal handler parameters 2023-11-07 10:17:10 +01:00
Sander van Grieken
ae446377f8 qml: work around toolbar layout not right-aligning indicators when indicators toggle visibility 2023-11-07 10:17:10 +01:00
Sander van Grieken
6270eae5c9 qml: port PyQt5 to PyQt6 2023-11-07 10:16:18 +01:00
Sander van Grieken
8dbb2e0c33 qml: remove eye icon for watch-only wallets from toolbar 2023-10-12 15:17:16 +02:00
Sander van Grieken
7ca9b735d5 daemon: refactor load_wallet to not just return None, but raise specific exceptions.
The following exceptions should be expected:
FileNotFoundError: given wallet path does not exist
StorageReadWriteError: given file is not readable/writable or containing folder is not writable
InvalidPassword: wallet requires a password but no password or an invalid password was given
WalletFileException: any internal wallet data issue. specific subclasses can be caught separately:
-  WalletRequiresSplit: wallet needs splitting (split_data passed in Exception)
-  WalletRequiresUpgrade: wallet needs upgrade, and no upgrade=True was passed to load_wallet
-  WalletUnfinished: wallet file contains an action and needs additional information to finalize. (WalletDB passed in exception)

Removed qml/qewalletdb.py

This patch also fixes load_wallet calls in electrum/scripts and adds a qml workaround for dialogs opening and closing so
fast that the dialog opened==true property change is missed (which we need to manage the dialog/page stack)
2023-10-10 17:42:07 +02:00
Sander van Grieken
cbcafe8960 qml: remove redundant WalletDB, closes #8628 2023-10-06 12:06:00 +02:00
Sander van Grieken
e5e1e46b7b qml: add message sign/verify 2023-09-26 11:28:55 +02:00
Sander van Grieken
6b52aad3c8 qml: silence some null deref errors at shutdown 2023-07-14 10:28:50 +02:00
SomberNight
68fb996d20 wallet_db version 52: break non-homogeneous multisig wallets
- case 1: in version 4.4.1, 4.4.2, the qml GUI wizard allowed creating multisig wallets with an old_mpk as cosigner.
- case 2: in version 4.4.0, 4.4.1, 4.4.2, the qml GUI wizard allowed creating multisig wallets with mixed xpub/Ypub/Zpub.

The corresponding missing input validation was a bug in the wizard, it was unintended behaviour. Validation was added in d2cf21fc2b. Note however that there might be users who created such wallet files.

Re case 1 wallet files: there is no version of Electrum that allows spending from such a wallet. Coins received at addresses are not burned, however it is technically challenging to spend them. (unless the multisig can spend without needing the old_mpk cosigner in the quorum).

Re case 2 wallet files: it is possible to create a corresponding spending wallet for such a multisig, however it is a bit tricky. The script type for the addresses in such a heterogeneous xpub wallet is based on the xpub_type of the first keystore. So e.g. given a wallet file [Yprv1, Zpub2] it will have sh(wsh()) scripts, and the cosigner should create a wallet file [Ypub1, Zprv2] (same order).

Technically case 2 wallet files could be "fixed" automatically by converting the xpub types as part of a wallet_db upgrade. However if the wallet files also contain seeds, those cannot be converted ("standard" vs "segwit" electrum seed).
Case 1 wallet files are not possible to "fix" automatically as the cosigner using the old_mpk is not bip32 based.

It is unclear if there are *any* users out there affected by this. I suspect for case 1 it is very likely there are none (not many people have pre-2.0 electrum seeds which were never supported as part of a multisig who would also now try to create a multisig using them); for case 2 however there might be.

This commit breaks both case 1 and case 2 wallets: these wallet files can no longer be opened in new Electrum, an error message is shown and the crash reporter opens. If any potential users opt to send crash reports, at least we will know they exist and can help them recover.
2023-05-11 14:26:11 +00:00
Sander van Grieken
cb9ba819ec qml: remove Qt Vkbd leftovers 2023-05-09 15:43:52 +02:00
Sander van Grieken
6394cdcd3b qml: disable Qt Virtual Keyboard and refactor keyboardFreeZone item to take
android system keyboard into account
2023-05-01 18:39:16 +02:00
Sander van Grieken
1b362f64f2 qml: properly delete wizard components after use. fixes #8357 2023-04-29 13:57:16 +02:00
Sander van Grieken
264540e12b qml: consistency camelcase public slots qedaemon, qeinvoice, qewizard 2023-04-25 13:40:16 +02:00
Sander van Grieken
61179ede8c qml: consistency camelcase qewallet 2023-04-25 13:33:15 +02:00
Sander van Grieken
959d481e93 qml: create ScanDialog 2023-04-24 13:19:01 +02:00
Sander van Grieken
323aa84279 qml: only allow wallet menu if on wallet specific page 2023-04-20 10:37:49 +02:00
Sander van Grieken
1649f9993e qml: limit wallet name label widths so they get wrapped/elided. fixes #8317 2023-04-20 10:27:30 +02:00
ThomasV
5e29b94561 qml MessageDialog: split messages into title and header message. hide header if it is empty. 2023-04-18 14:07:41 +02:00
ThomasV
a03f4769ca auth_protect: pass authMessage in the auth_protect decorator,
instead of relying on side-effects

This is probably safer, and also more self-contained.
2023-04-17 18:17:29 +02:00
Sander van Grieken
5b6a16e097 qml: add auth_message to AuthMixin, which is displayed above the Pin entry textfield, or
shown in a messageDialog for confirmation.
2023-04-17 16:32:20 +02:00
Sander van Grieken
62af3265cb qml: disable menu option associated with current page 2023-04-17 15:36:13 +02:00
Sander van Grieken
3cab3b86b4 qml: remove SwapProgressDialog, introduce qeswaphelper.state and enable dialog elements
depending on qeswaphelper.state

TODO: we can now retrieve the pairs from the service asynchronously, which should eliminate
the startup delay when showing the SwapDialog
2023-04-14 14:32:56 +02:00
Sander van Grieken
21d1a6239f qml: always pass wallet password to init_lightning.
emit also dataChanged so UI updates node pubkey
2023-04-14 12:21:38 +02:00
Sander van Grieken
f43cd7b278 followup prev 2023-04-12 16:21:31 +02:00
Sander van Grieken
7a8e980712 qml: since qeswaphelper is tied to SwapDialog anyway, let's make it a direct child 2023-04-12 16:19:17 +02:00
Sander van Grieken
d5ce9c0994 qml: destroy qeswaphelper with SwapDialog and catch RuntimeErrors if qeswalhelper members are accessed after 2023-04-12 16:09:37 +02:00
Sander van Grieken
27cd7fe8a8 qml: deduplicate swap initiation, move to main.qml 2023-04-12 12:32:25 +02:00
Sander van Grieken
75f63a4666 qml: remove yesClicked signal, use accept()/accepted signal in MessageDialog. 2023-04-11 10:22:48 +02:00
SomberNight
1530668960 qt/qml: delay starting network until after first-start-network-setup
The qt, qml, and kivy GUIs have a first-start network-setup screen
that allows the user customising the network settings before creating a wallet.
Previously the daemon used to create the network and start it, before this screen,
before the GUI even starts. If the user changed network settings, those would
be set on the already running network, potentially including restarting the network.

Now it becomes the responsibility of the GUI to start the network, allowing this
first-start customisation to take place before starting the network at all.
The qt and the qml GUIs are adapted to make use of this. Kivy, and the other
prototype GUIs are not adapted and just start the network right away, as before.
2023-03-30 00:59:02 +00:00
Sander van Grieken
4bdd521a4b qml: abstract ElDialog resize behavior to property 2023-03-23 10:30:40 +01:00
Sander van Grieken
17bb1ad5c5 qml: enable Qt virtual keyboard and add Electrum keyboard style, modified from Qt 'default' style 2023-03-23 10:30:40 +01:00
Sander van Grieken
e7cc2c5a63 Revert "qml: pressing "Esc" on desktop to ~simulate "back" button"
This reverts commit 7f7ee8d82f.

This commit caused a regression with the android back button not closing a dialog.

reproduce:
1. from the main window, press receive.
2. in the request details window, press Create request.
3. in the receive payment dialog, press Copy
4. observe dialog cannot be closed by back button
2023-03-23 10:12:10 +01:00