Commit Graph

3845 Commits

Author SHA1 Message Date
Sander van Grieken
b4ffd3eeeb qt: contacts: stretch address, not name 2025-08-15 10:44:31 +02:00
ghost43
5a9f54fba0 Merge pull request #10133 from f321x/qml_timestamp_precision
qml: reduce tx history timestamp precision
2025-08-14 17:26:08 +00:00
ghost43
5bfd5a858f Merge pull request #10123 from accumulator/keystorewizard_scriptandderivation
wizard: add script and derivation to keystorewizard flow. fixes #10063
2025-08-14 16:10:47 +00:00
ghost43
33dd45a2d9 Merge pull request #10096 from SomberNight/202508_lower_minrelayfee
change minrelayfee clamps from `[1, 50]` to `[0.1, 50]` sat/vbyte
2025-08-14 14:53:28 +00:00
f321x
0c7d8646d4 qml: stop showing seconds in tx history timestamps
Reduces the precision of the date field in the qml transaction history
list to minutes. Seconds don't seem very useful in practice and add
clutter to the UI. This adapts the behaviour to the Qt GUI.
2025-08-14 09:57:48 +02:00
Sander van Grieken
66c0fec1ea qt: wizard: pass wallet_type to Keystore wizard via initial viewstate 2025-08-13 11:40:08 +02:00
Sander van Grieken
4eccfdaa99 wizard: add script and derivation to keystorewizard flow. fixes #10063 2025-08-13 11:37:57 +02:00
Sander van Grieken
9a7ca74992 qml: qetxdetails: update mempool depth on fee histogram 2025-08-12 12:35:16 +02: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
f1c6798710 qt: wizard: xpub can be None, fixes #10109 2025-08-07 09:19:54 +02:00
Sander van Grieken
f79172c04f qml: sweep: handle network errors gracefully
fixes #10108
2025-08-06 11:02:58 +02:00
Sander van Grieken
9b1566705d qml: swap: disable choose provider button during active swap. 2025-08-04 12:56:46 +02:00
f321x
050b5b8076 qt: handle shutil.copyfail exc in add_plugin_dialog
Handles exceptions thrown by `shutil.copyfile()` in the
`add_plugin_dialog`.
In issue #10101 an user tried to access an onedrive vault directory which
made shutil fail to copy the file with:
```
OSError: [Errno 22] Invalid argument: 'odopen://unlockvault/?accounttype=personal'
```
2025-08-04 09:50:15 +02:00
SomberNight
db52ec7798 gui: cpfp: use wallet.relayfee() instead of hardcoded 1 sat/byte 2025-08-01 18:28:44 +00:00
SomberNight
5432228d17 fee calculation should round up satoshis
so that with a feerate of 0.1 sat/vbyte, for a tx of size 141 vbytes, the fee is 15 sat (instead of 14 sat)
(assuming a min relay fee of 0.1 s/b, the tx needs to pay a minimum of 15 sats to propagate)
2025-08-01 18:28:41 +00:00
accumulator
8e5f29e890 Merge pull request #10078 from accumulator/android_qml_qrscan_signals
simplify QR scanner QML interface, remove properties, add results to signals
2025-08-01 13:16:26 +02:00
ghost43
a9b47f7abd Merge pull request #10062 from f321x/handle_qe_swap_task_exceptions
qml: catch exceptions in QESwapHelper transport_task
2025-07-31 15:41:09 +00:00
f321x
30b146033d gui: detect if reserve inputs have been removed from tx
Adapts the gui(s) to detect if an existing reserve input has not been
used as input for the transaction even though the user tried to spend
max. This allows to show the lightning reserve warning not only for
reserve change outputs but also for existing reserve inputs that have
been ignored for this max spend transaction.
Still keeps the `is_utxo_reserve` flag on `PartialTxOutput` as it is
used in the qml gui.
2025-07-29 15:40:51 +02:00
Sander van Grieken
146a5438ff qml: guard against wallet.network is None, QEWallet timer can trigger this func
while wallet is closing (when app is closing)
2025-07-25 09:13:26 +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
f321x
c7e3fec69e fix: remove .desktop from setDesktopFileName argument
Removes the '.desktop' suffix from the
`QGuiApplication.setDesktopFileName` argument to prevent the following
warning on startup of Electrum:
```
QGuiApplication::setDesktopFileName: the specified desktop file name ends with .desktop.
For compatibility reasons, the .desktop suffix will be removed.
Please specify a desktop file name without .desktop suffix
```

The [qt
docs](https://doc.qt.io/qtforpython-6/PySide6/QtGui/QGuiApplication.html#PySide6.QtGui.QGuiApplication.desktopFileName)
say that `desktopFileName` is "... is the file name, without the full
path or the trailing “.desktop” extension of the desktop entry that
represents this application according to the freedesktop desktop entry
specification."
2025-07-24 10:26:42 +02:00
Sander van Grieken
3947733d9f android: don't keep adding BarcodeScannerView instances to contentFrame when starting camera
When putting app to background with qr scanner active, then moved to foreground again,
SimpleScannerActivity instance is not destroyed, but the local mScannerView was re-initialized
with a new instance (through startCamera()) regardless of pre-existing instance, and added to
the contentFrame. This leaves the previous mScannerView instance in limbo, potentially getting
garbage collected at unpredictable times.
2025-07-22 10:16:02 +02:00
ghost43
43ae7e6df8 Merge pull request #10052 from SomberNight/202507_qt_crash_felix_2
crash reporter: rm `Never`, add confirm to `Send`, and only show window once per exc group
2025-07-21 13:50:35 +00:00
SomberNight
729003e557 wizard: move hw_unlock to base cls, and add test_wizard unlock_hw test 2025-07-21 03:33:43 +00:00
SomberNight
358728b316 qt wizard: don't log xpub of hw cosigner 2025-07-21 02:21:40 +00:00
SomberNight
bfd3c0e48c Merge branch spesmilo/pr/10016' into 202507_pr10016_qml_wizard_passphrase 2025-07-20 22:02:01 +00:00
f321x
4a1ac4784a qml: catch exceptions in QESwapHelper transport_task
Adds an on_done_callback to the QESwapHelper.transport_task future
to prevent the task from swallowing exceptions by retrieving exceptions
and calling `util.send_exception_to_crash_reporter` with them.
2025-07-20 17:43:42 +02:00
f321x
225ff4aba6 qt: NewChannelDialog: do some pre-validation for Ok button
Do some validation if the user input in `NewChannelDialog` before
allowing to click the `Ok` button. This is done to make the UI a bit
more intuitive and prevent issues like #10053 in which the user was able
to click `Ok` with a empty trampoline node list which raised an
`IndexError` (probably on testnet4).
2025-07-20 15:09:38 +02:00
SomberNight
c85272b546 crash reporter: only show reporter once per exception groupid
- don't show crash reporter multiple times for the "same" exception
  - at least until the user restart the program (there is no persistence)
- this is a ~replacement for the removed "Never show crash reporter" option
- in case there e.g. a thread with timer spamming an exception erroneously,
  this ensures we only offer to send the crash report once (per process lifecycle)
2025-07-18 16:44:15 +00:00
SomberNight
0e0e47c3c5 base_crash_reporter: change get_traceback_info to classmethod 2025-07-18 16:44:12 +00:00
SomberNight
970f84151d crash reporter: remove "Never" btn and config.SHOW_CRASH_REPORTER opt
- always hook into sys.excepthook and show the crash reporter
- if we don't hook into sys.excepthook and an exception propagates out on a Qt thread,
  that kills the Qt GUI
  - ref https://github.com/spesmilo/electrum/pull/10049#issuecomment-3089278083
2025-07-18 16:44:08 +00:00
SomberNight
2ed691b8f0 crash reporter: add popup asking to confirm to send_report 2025-07-18 16:44:05 +00:00
SomberNight
627f5a88b3 qml: ExceptionDialog: feedback from sendReport needs even higher z
follow-up 1559129016
2025-07-18 15:26:08 +00:00
SomberNight
eef562389c qml: qenetwork: fix type confusion for "server"
exc triggered when switching from same server to same server:
```
  9.43 | D | gui.qml.qenetwork | server_status updated: Connecting
  9.43 | E | network | Exception in _run_new_interface: Exception('diagnostic name not yet available?')
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/logging.py", line 241, in __get_logger_for_obj
    diag_name = self.diagnostic_name()
  File "/home/user/wspace/electrum/electrum/interface.py", line 555, in diagnostic_name
    return self.server.net_addr_str()
AttributeError: 'str' object has no attribute 'net_addr_str'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/util.py", line 1218, in wrapper
    return await func(*args, **kwargs)
  File "/home/user/wspace/electrum/electrum/network.py", line 986, in _run_new_interface
    interface = Interface(network=self, server=server)
  File "/home/user/wspace/electrum/electrum/interface.py", line 502, in __init__
    Logger.__init__(self)
  File "/home/user/wspace/electrum/electrum/logging.py", line 232, in __init__
    self.logger = self.__get_logger_for_obj()
  File "/home/user/wspace/electrum/electrum/logging.py", line 243, in __get_logger_for_obj
    raise Exception("diagnostic name not yet available?") from e
Exception: diagnostic name not yet available?
```
2025-07-18 14:16:30 +00:00
ghost43
159d83905b Merge pull request #10049 from f321x/fix_show_transaction_user_cancelled
fix: handle UserCancelled in show_transaction
2025-07-18 12:06:02 +00:00
f321x
39bcdec584 fix: handle UserCancelled in show_transaction
`TxDialog` may has to fetch tx information from the network on
construction (`self.set_tx()`) and is showing a `RunCoroutineDialog`.
If the user cancels this dialog the `UserCancelled` exception is not
caught in `show_transaction()` and can even lead to Electrum crashing.
Fixes #10041
2025-07-18 13:14:27 +02:00
f321x
1b325394ba fix: exception when clicking "New Channel"
Fixes exception occuring when `wallet.lnworker` is `None` and the user
clicks on `New Channel` in the channels list tab. The `New Channel`
button is enabled when the wallet *can* have lightning, not the wallet
actually having lightning enabled.
With this patch the `init_lightning_dialog` will show up if the user
clicks on `New Channel` but lightning is not yet enabled.
I noticed this by restoring from a funded vpub and then
loading the keystore from seed afterwards.
2025-07-18 11:12:25 +02:00
SomberNight
23adf13070 qml: fix doNotify for Windows. lol
```
319.55 | E | gui.qml.qeapp.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "...\electrum\electrum\util.py", line 1130, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "...\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "...\plyer\platforms\win\libs\balloontip.py", line 206, in balloon_tip
    WindowsBalloonTip(**kwargs)
  File "...\plyer\platforms\win\libs\balloontip.py", line 130, in __init__
    raise Exception('Could not load icon {}'.format(app_icon))
Exception: Could not load icon ...\electrum\electrum\gui\icons\electrum.png
```
2025-07-18 01:37:07 +00:00
SomberNight
e658fa4e04 qml: QETxFinalizer: handle txid being None
fixes https://github.com/spesmilo/electrum/issues/10042
2025-07-18 01:11:19 +00:00
ghost43
c3b9ef0c89 Merge pull request #10034 from f321x/fix_confirm_tx_dialog_timer_exc
fix: qt: handle main_window.gui_object.timer being None
2025-07-16 12:17:24 +00:00
Sander van Grieken
0e055f8127 qt: don't share ElectrumGui.QTimer, use self-contained QTimer so its lifecycle is synced in
`ElectrumWindow`, `TxEditor`, `SwapDialog`

Also use `QTimer` classmethod for `.singleShot()` occurrences.
2025-07-16 13:13:26 +02:00
Sander van Grieken
b9ea17674d qml: fix passphrase/seed extension wordwrap 2025-07-16 13:05:44 +02:00
f321x
121b7b767e fix: qt: handle main_window.gui_object.timer being None
When closing Electrum with open `ConfirmTxDialog` the following
exception is raised:

```
1319.20 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/code/electrum-fork/electrum/gui/qt/send_tab.py", line 575, in do_pay_or_get_invoice
    self.do_pay_invoice(self.pending_invoice)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/electrum-fork/electrum/gui/qt/send_tab.py", line 602, in do_pay_invoice
    self.pay_onchain_dialog(invoice.outputs, invoice=invoice)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/electrum-fork/electrum/gui/qt/send_tab.py", line 328, in pay_onchain_dialog
    tx, is_preview = self.window.confirm_tx_dialog(make_tx, output_value, batching_candidates=candidates)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 1502, in confirm_tx_dialog
    return d.run(), d.is_preview
           ~~~~~^^
  File "/home/user/code/electrum-fork/electrum/gui/qt/confirm_tx_dialog.py", line 477, in run
    self.stop_editor_updates()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/user/code/electrum-fork/electrum/gui/qt/confirm_tx_dialog.py", line 133, in stop_editor_updates
    self.main_window.gui_object.timer.timeout.disconnect(self.timer_actions)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'timeout'
```

This can be prevented by checking if `main_window.gui_object.timer` is
None before trying to disconnect it.
2025-07-16 09:47:32 +02:00
SomberNight
76005372a6 qt ConfirmTxDialog: only show fee_target text if slider is active 2025-07-15 16:52:11 +00:00
SomberNight
02b0073ca5 qt ConfirmTxDialog: also save custom fixed feerate fee_policies
- save custom fixed feerate fee_policies, not just slider-restricted ones
- dynamically update fee_target text, to follow feerate_e
  - otherwise when the slider is set to "feerate", users would be shown two conflicting values
2025-07-15 16:45:29 +00:00
SomberNight
68a203336e qt ConfirmTxDialog: fix feerate_e 2025-07-15 16:43:53 +00:00
ThomasV
6d22c24deb Merge pull request #10028 from SomberNight/202507_issue10021
qt: only allow wallet unlock if wallet has ks-enc
2025-07-15 15:30:33 +02:00
SomberNight
482d573f55 stdio gui: use daemon.load_wallet(), similar to text gui 2025-07-15 13:23:50 +00:00
f321x
290da21187 qml: change wizard passphrase flow 2025-07-15 00:19:25 +02:00
SomberNight
f2f1dddcc8 swaps: factor out pubkey_to_rgb_color into core lib 2025-07-14 21:09:18 +00:00