Commit Graph

3202 Commits

Author SHA1 Message Date
SomberNight
d660c57808 qt BalanceToolButton: rm hardcoded min size
"18 pixels" is too large when using qdarkstyle on "low" DPI screens, on Windows
(if there is also a high DPI screen connected as another monitor... eh)
2024-01-15 15:08:59 +00:00
SomberNight
66b24411e0 qt BalanceToolButton: better sizing on high DPI screens
specifically, on Windows, with display scaling > 100%, the pie btn was too small (not scaled)
2024-01-15 14:41:00 +00:00
Sander van Grieken
10be631039 qml: tx.txid() can be None in qetxfinalizer. fixes (#8807) 2024-01-13 01:36:45 +01:00
ThomasV
14ec36dba1 Merge pull request #8741 from accumulator/labels_update
add labels_received callback and update labels even when set for item
2024-01-11 16:05:04 +01:00
SomberNight
d89f9846b9 qt/qrreader(zbar): don't call callback if user closes camera window
- without this, in send tab paytoedit, try_payment_identifier will get called and it will error
df1b9a223c/electrum/gui/qt/paytoedit.py (L153)
- also, in all text fields this used to result in clearing the current text (but now it is kept instead)
2024-01-10 20:39:58 +00:00
Sander van Grieken
65210d03ac qml: log txid when assertion fails in qetxdetails.py 2024-01-09 12:57:26 +01:00
SomberNight
f7ea2e0d3c trustedcoin: fix qt wizard two-part-wallet-creation, online phase
```
 25.30 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/qt/__init__.py", line 439, in _start_wizard_to_select_or_create_wallet
    wallet = self.daemon.load_wallet(wallet_file, d['password'], upgrade=True)
  File "/home/user/wspace/electrum/electrum/daemon.py", line 481, in func_wrapper
    return func(self, *args, **kwargs)
  File "/home/user/wspace/electrum/electrum/daemon.py", line 491, in load_wallet
    wallet = self._load_wallet(path, password, upgrade=upgrade, config=self.config)
  File "/home/user/wspace/electrum/electrum/util.py", line 481, in do_profile
    o = func(*args, **kw_args)
  File "/home/user/wspace/electrum/electrum/daemon.py", line 516, in _load_wallet
    raise WalletUnfinished(db)
electrum.wallet_db.WalletUnfinished: <electrum.wallet_db.WalletDB object at 0x7f11db3a7ca0>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/qt/wizard/wizard.py", line 203, in on_next_button_clicked
    if self.is_finalized(wd):
  File "/home/user/wspace/electrum/electrum/gui/qt/wizard/wallet.py", line 178, in is_finalized
    if not wizard_data['wallet_exists'] or wizard_data['wallet_is_open']:
KeyError: 'wallet_exists'
```
2024-01-05 15:34:20 +00:00
SomberNight
77c55d78b7 qt wizard: show warning when trying to restore 2fa seed as std wallet
With wallet_type=="standard", if the user enters a 2fa electrum seed, the "next" btn is disabled.
This is a regression in the new wizard, the old one used to "redirect" seamlessly.
This commit does not fix this, but at least shows a user-friendly warning message.

Note: would be nice if the wizard redirected automatically, in both directions (2fa->std, std->2fa).
The old wizard implemented std->2fa (probably the more common case hit by users), and had this
warning message shown for the 2fa->std case. Now I am repurposing the warning also for std->2fa.
2024-01-05 15:00:45 +00:00
SomberNight
dab768b932 qt/wizard/wallet: improve typing: introduce WalletWizardComponent cls 2024-01-05 13:34:57 +00:00
SomberNight
37173845c2 qt wizard: WizardComponent: (fix) also inherit ABC
for `@abstractmethod` decorator to work
(except, turns out, it's not so simple because of pyqt's own magic for QWidget)
2024-01-05 13:26:33 +00:00
SomberNight
201c0ab71b qt wizard: fix restoring from 2fa seed
follow-up 7df057aaf9
2024-01-05 12:51:54 +00:00
accumulator
35d4cf4d09 Merge pull request #8788 from accumulator/qml_non_historic_fiat
qml: don't show fiat amount when timestamp more than a day old and historic rates are disabled
2024-01-04 17:31:16 +01:00
accumulator
a51b3bdbfb qml: show fiat price when historic rates are enabled and no timestamp available
Co-authored-by: ghost43 <somber.night@protonmail.com>
2024-01-04 17:31:00 +01:00
Sander van Grieken
313b79cfaf qml: add txid not empty assert to removeLocalTx. ref #8775 2024-01-04 13:08:17 +01:00
Sander van Grieken
5077e013f3 qml: don't show fiat amount when timestamp more than a day old and historic rates are disabled 2024-01-04 12:25:40 +01:00
accumulator
88058df409 Merge pull request #8772 from accumulator/qml_tx_inputs
qml: add transaction inputs in TxDetails and …
2023-12-29 16:21:22 +01: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
e8852918a7 qml: fix newline in TxDetails 2023-12-29 12:13:49 +01:00
Sander van Grieken
7164392b1c qml: add transaction inputs in TxDetails and ConfirmTxDialog, RbfBumpFeeDialog, RbfCancelDialog, CpfpBumpFeeDialog
and allow collapse/expand of input/output lists by clicking on label.
2023-12-29 11:55:36 +01:00
SomberNight
eee61a98cb gui: cpfp: calc parent fee for cpfp using wallet.get_tx_info
I am only making this change as it makes it simpler to do manual testing of CPFP-ing *local* txs.
That is, by changing a few easy-to-find lines of code, I can make the GUI allow CPFP-ing a local tx, but
without this change it errors out with "unknown fee for parent transaction".

If one has an incoming local tx saved in the wallet, adb.get_tx_fee(txid) returns None
(if the tx gets into the mempool, it will use the server-reported value instead).
In contrast, wallet.get_tx_info(tx).fee calls both wallet.get_wallet_delta(tx) and adb.get_tx_fee(txid),
making it more expensive but more complete.
2023-12-29 02:55:11 +00:00
Sander van Grieken
ceb42c2a1b qml: show frozen lightning balance in BalanceDetails only when non-zero 2023-12-28 12:30:37 +01:00
SomberNight
0dae17339d qml: add config setting to allow screenshots
On Android, we disallow screenshots on screens where the seed is visible.
(The seed is extremely sensitive data that should not be stored digitally without
significant precautions but it's also cumbersome to write down or memorise, so
some people instinctively just try to take a screenshot of it when creating a wallet.)
We do this by using the built-in OS mechanism of setting FLAG_SECURE on the window.
However, on some devices with custom ROMs (one report from LineageOS, one from /e/OS),
unsetting FLAG_SECURE crashes the application for some reason.

As a workaround, this commit adds a config setting into the Preferences,
to disable this mechanism and just always allow screenshots.
(note that you can get into the qml Preferences before creating/opening any wallet)

ref https://github.com/spesmilo/electrum/issues/8522
2023-12-27 07:28:39 +00:00
accumulator
9ea15a1c3c Merge pull request #8737 from accumulator/welcome_page
qt,qml: add a welcome page as initial page for server connect wizard
2023-12-24 14:20:52 +01:00
SomberNight
25c50f15c0 qt TxEditor: fix extraneous "not able to RBF later" warning
Imported wallets, and HD wallets with "use change" disabled, would always
get the warning before.
2023-12-22 23:50:04 +00:00
Sander van Grieken
4908c8c389 qml: RbfCancelDialog: warning text in frame 2023-12-22 17:35:25 +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
cb34bbee7e qml: don't enable save button for already saved invoices 2023-12-21 13:29:37 +01:00
Sander van Grieken
adcc9eb2d1 qml: qewallet code style 2023-12-21 12:36:20 +01:00
Sander van Grieken
c7e055bdb9 qml: remove unused components 2023-12-21 12:36:20 +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
Sander van Grieken
6e576f2a08 qml: fix cancelling network wizard not closing app 2023-12-19 18:37:53 +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
524adaf747 qml: use warning icon and error title for failure messagedialogs 2023-12-19 15:58:39 +01:00
ThomasV
856163f096 Merge pull request #8743 from SomberNight/202312_sighash_warnings
wallet: refactor check_sighash/risk_of_burning_coins_as_fees
2023-12-13 13:12:56 +01:00
ThomasV
d691aa0736 qt: add 'notes' tab 2023-12-13 12:31:22 +01:00
SomberNight
2bc056ed33 wallet: refactor check_sighash/risk_of_burning_coins_as_fees
- risk_of_burning_coins_as_fees is turned into a private (helper) method, only called by check_sighash.
  UIs should only care about check_sighash.
- check_sighash returns instance of new class "TxSighashDanger" instead of tuple
- made warning levels more fine-grained (FEE_WARNING_SKIPCONFIRM vs FEE_WARNING_NEEDCONFIRM)
- this became more complicated than I had hoped for but I think it is worth it to ~merge
  check_sighash and risk_of_burning_coins_as_fees into one.

related https://github.com/spesmilo/electrum/pull/8699
2023-12-13 04:52:01 +00:00
Sander van Grieken
321f6255fa qt: do not proceed to wallet setup when cancelling network wizard 2023-12-12 17:16:56 +01:00
Sander van Grieken
8ba7a00097 qml: update new labels in history and addresscoinlist 2023-12-12 16:36:12 +01:00
Sander van Grieken
3a22cb9c48 labels: emit callback when labels received.
write labels regardless if there's already a label set for an ID.
2023-12-12 16:24:13 +01:00
Sander van Grieken
a6ceeec09d qml: add frozen lightning to BalanceDetails, indent frozen on-chain and lightning amounts 2023-12-12 13:17:57 +01:00
Sander van Grieken
297f971fae qml: improve info text for incomplete transactions and transactions in mempool on transaction details page. 2023-12-12 12:11:37 +01:00
SomberNight
dd3fc041f9 qt main window: statusbar: swap Tor and Network buttons
I think it's nicer for the network status to be rightmost, which was the case for a long time.

(Though plugins are still added after (via multiple different mechanisms, see 2fa, hww, revealer).
We could perhaps add a VLine separator, or add them to the left instead.)

follow-up 90d1d587e8
2023-12-12 10:56:41 +00:00
SomberNight
c52853341c qt util: add VLine class, for vertical line separators 2023-12-12 10:50:47 +00:00
SomberNight
da775954c0 qt wizard: fix wallets directory relative paths on Windows
follow-up https://github.com/spesmilo/electrum/pull/8651

We cannot do direct comparison of path-like strings without normalisation.
E.g.
```
relative_path() cp1. path='c:\\users\\user\\appdata\\roaming\\electrum\\wallets\\9dk', wallets=C:\Users\User\AppData\Roaming\Electrum\wallets
relative_path() cp2. commonpath='c:\\users\\user\\appdata\\roaming\\electrum\\wallets'
relative_path() cp3. new_path='9dk'
```
2023-12-12 01:34:46 +00:00
SomberNight
58f041fd38 qt: fix window.donate_to_server to switch to send tab
probably regression from payment_identifier refactor
2023-12-12 01:14:13 +00:00
ghost43
e814fa0b25 Merge pull request #8719 from SomberNight/202312_db_seedtype
wallet db: deduplicate "seed_type" field
2023-12-12 01:01:30 +00:00
Sander van Grieken
82ee4c22b8 qml: fix old ref to network.tor_proxy 2023-12-11 16:47:56 +01:00
ThomasV
ee10b0bf3e qt: move plugins dialog to own module 2023-12-11 10:19:36 +01:00