1
0
Commit Graph

16061 Commits

Author SHA1 Message Date
Sander van Grieken
ec2f903573 qml: force Pin dialog above other dialogs 2023-03-31 15:38:53 +02:00
Sander van Grieken
244ead2624 qml: auto-pay if entering InvoiceDialog from a lnurl-pay dialog 2023-03-31 15:05:05 +02:00
Sander van Grieken
cf2ba2a5bd qml: replace assert by exception 2023-03-31 15:05:05 +02:00
SomberNight
0f541be6f1 log a warning if asserts are disabled
Maybe we should refuse to start, if launched with the main script.
But note that __debug__ is False on Android atm, as python is launched with -OO.
2023-03-31 13:03:26 +00:00
ThomasV
56e685feaa invoices: Use the same base method to export invoices and requests.
This fixes an inconsistency where the 'expiration' field was
relative for invoices, and absolute timestamp for requests.

This in turn fixes QML the timer refreshing the request list.

In order to prevent any API using that field from being silently
broken, the 'expiration' field is renamed as 'expiry'.
2023-03-31 14:55:08 +02:00
ThomasV
2cda5a1a7b Merge pull request #8287 from SomberNight/202303_qt_netdlg_icon_selected
qt network dialog: use icon for selected server, instead of "*"
2023-03-31 14:43:17 +02:00
Sander van Grieken
168efa6cb4 qml: handle scenario for non-lightning wallet scanning lightning invoice with fallback address 2023-03-31 14:42:03 +02:00
Sander van Grieken
b1b71002e6 qml: followup b8aa87ded8 2023-03-31 14:06:12 +02:00
SomberNight
771ffa371c qml: mempool histogram color bar: show tooltips
to teach meanings of colours and positions in the bar
2023-03-31 11:55:33 +00:00
SomberNight
f7e7b4c9db qml: mempool histogram color bar: flip sign in feerate label
I think this is more intuitive as a "greater than" relation sign
than to use a signal that the label is for the leftmost point in the coloured bar.
As in, "feerates not displayed towards that direction are even higher than this value".
2023-03-31 11:55:30 +00:00
Sander van Grieken
b8aa87ded8 qml: handle phase-2 lnurl errors from within WalletMainView, add sanity check on
the bolt11 invoice we get from the service
2023-03-31 13:21:11 +02:00
Sander van Grieken
e476e60247 qml: add note regarding validity of qetxdetails instance and reset tx/txid members 2023-03-31 12:47:43 +02:00
Sander van Grieken
d99a220c66 qml: add new 'removed_transaction' callback in wallet.py, hook up callback in qewallet and
emit balanceChanged events for add_transaction and remove_transaction
2023-03-31 12:32:02 +02:00
Sander van Grieken
a1da0c0150 qml: virtual keyboard ~20% bigger 2023-03-31 11:01:47 +02:00
Sander van Grieken
df44a5c361 qml: port over 'show_qr to warn if QR code is missing data' 2023-03-31 10:50:11 +02:00
ThomasV
ea46d3c318 qml create request: if no address is available, show how to access
the list of pending requests.
2023-03-31 10:22:16 +02:00
ThomasV
1babc96913 qml: rename Invoices -> Saved Invoices, Receive Requests -> Pending Requests 2023-03-31 10:14:49 +02:00
ThomasV
83dbf36d99 follow-up 4647fda04f 2023-03-31 10:07:05 +02:00
SomberNight
4a626a113d qt receive_tab: fix "show_address_on_hw" functionality
follow-up b07fe970bf

I don't like this being hidden in the toolbar menu.
The other items in the toolbar menu are ~settings or generic actions
independent of the current request. This one is dependent on the
current request, and even the active "tab"... does not make sense
to show this when the lightning tab is active.
It is more difficult to discover it in the first place than previously,
and it being less visible goes against encouraging hw device users of
using it, which is what we should be doing.

Anyway, this commit just makes it functional as-is.
2023-03-31 01:14:08 +00:00
SomberNight
bcd2ec3d70 (trivial) qt/util: add some leftover type-hints 2023-03-31 01:04:54 +00:00
SomberNight
8a394c3e3f update locale 2023-03-30 16:38:19 +00:00
SomberNight
84d19457a6 lnpeer: handle NoDynamicFeeEstimates in co-op close
note that the existing fallback was insufficient as config.fee_per_kb() can still return None
2023-03-30 15:40:45 +00:00
SomberNight
8291018c0e interface: workaround electrs erroring on 'blockchain.estimatefee'
15.00 | E | i/interface.[electrum.blockstream.info:50002] | Exception in run: ProtocolError(-32600, 'ill-formed response error object: cannot estimate fee for 25 blocks')
Traceback (most recent call last):
  File "...\electrum\electrum\util.py", line 1261, in wrapper
    return await func(*args, **kwargs)
  File "...\electrum\electrum\interface.py", line 516, in wrapper_func
    return await func(self, *args, **kwargs)
  File "...\electrum\electrum\interface.py", line 539, in run
    await self.open_session(ssl_context)
  File "...\electrum\electrum\interface.py", line 689, in open_session
    async with self.taskgroup as group:
  File "...\aiorpcX\aiorpcx\curio.py", line 304, in __aexit__
    await self.join()
  File "...\electrum\electrum\util.py", line 1423, in join
    task.result()
  File "...\electrum\electrum\interface.py", line 726, in request_fee_estimates
    async with OldTaskGroup() as group:
  File "...\aiorpcX\aiorpcx\curio.py", line 304, in __aexit__
    await self.join()
  File "...\electrum\electrum\util.py", line 1423, in join
    task.result()
  File "...\electrum\electrum\interface.py", line 1128, in get_estimatefee
    res = await self.session.send_request('blockchain.estimatefee', [num_blocks])
  File "...\electrum\electrum\interface.py", line 171, in send_request
    response = await asyncio.wait_for(
  File "...\Python310\lib\asyncio\tasks.py", line 408, in wait_for
    return await fut
  File "...\aiorpcX\aiorpcx\session.py", line 540, in send_request
    return await self._send_concurrent(message, future, 1)
  File "...\aiorpcX\aiorpcx\session.py", line 512, in _send_concurrent
    return await future
  File "...\aiorpcX\aiorpcx\jsonrpc.py", line 721, in receive_message
    item, request_id = self._protocol.message_to_item(message)
  File "...\aiorpcX\aiorpcx\jsonrpc.py", line 273, in message_to_item
    return cls._process_response(payload)
  File "...\aiorpcX\aiorpcx\jsonrpc.py", line 220, in _process_response
    raise cls._error(code, message, False, request_id)
aiorpcx.jsonrpc.ProtocolError: (-32600, 'ill-formed response error object: cannot estimate fee for 25 blocks')
2023-03-30 15:34:27 +00:00
SomberNight
31fde2484f qt network dialog: use icon for selected server, instead of "*"
Previously we added a " *" suffix to distinguish the selected/main server
in the list. However in case of an .onion address, anything we put as a
suffix inline is elided/truncated - as the address itself does not fit.
Hence we could instead use a prefix - and then why not use an icon.
2023-03-30 14:56:33 +00:00
SomberNight
0a3e286f1d qt tx dialog: show_qr to warn if QR code is missing data
When exporting a tx as qr code, the prev txs are omitted to save space.
This causes problems with offline signers: software electrum signers will
just warn and then proceed, but hw devices will typically error.
2023-03-30 14:32:31 +00:00
ThomasV
4647fda04f qml: show invoices/requests lists through long press
I think we can re-enable the requests list, because requests
are now created explicitly by pressing the create request button.

Since this is an advanced feature, it should not be in the way of
people who do not want to see it. Here is a solution that might
work.
2023-03-30 16:09:59 +02:00
Sander van Grieken
8a2372a133 followup 4517b3c2bb 2023-03-30 16:05:10 +02:00
Sander van Grieken
4517b3c2bb qml: handle DataOverflow in qeqr.py and QRImage 2023-03-30 16:00:36 +02:00
Sander van Grieken
d064b38f1c qml: split updating userinfo from determine_can_pay, check determine_can_pay also in event handlers 2023-03-30 13:23:14 +02:00
Sander van Grieken
c08ca94591 qml: support create & save transaction on watch-only wallet, refactor showExport and supply
relevant help text when sharing a transaction
2023-03-30 12:28:09 +02:00
ThomasV
6bec498560 qml: use the same button for copy and paste 2023-03-30 12:26:35 +02:00
ThomasV
5ef7fabc73 qml InvoiceDialog: merge status and userinfo 2023-03-30 11:24:50 +02:00
Sander van Grieken
2cbb16ae4b qml: move save_tx to qewallet 2023-03-30 10:41:01 +02:00
Sander van Grieken
e40ab26bd3 qml: qenetwork log server_status only when changing, log network_status updates 2023-03-30 09:29:02 +02:00
SomberNight
bd725b50d1 update block header checkpoints 2023-03-30 01:28:56 +00:00
SomberNight
81761c2ef1 qml: BalanceSummary to treat server_status=="connecting" same as DC-ed 2023-03-30 00:59:20 +00:00
SomberNight
3149ccf729 qml: update server in network dialog on more events
"defaultServerChanged" was not the right event to listen to. It is only sent
*after* the interface is ready.
"network_updated" is a bit overkill as it is triggered every time any of the
interfaces goes down or a new one is created, still, better to trigger a
few more times than to be stale.
In particular, if there is no internet connection, the server string is now
updated as expected, instead of showing stale values and ignoring trying
to change servers.
Also, a further state that did not exist before: just like it worked in
the kivy GUI, if the main server was changed but it is not yet connected,
instead of showing the old server still, we now show f"{new_server} (connecting...)".
2023-03-30 00:59:16 +00:00
SomberNight
04df286519 interface: fix ServerAddr.from_str_with_inference() for raw IPv6 addr
and add tests
2023-03-30 00:59:13 +00:00
SomberNight
101958e022 qt network_dialog: fix right-click "Use as server" for raw IPv6 servers
`server.net_addr_str()` cuts off the trailing protocol marker, while `str(server)` has it.
`parent.set_server` then called `ServerAddr.from_str_with_inference` trying to guess the just cut off protocol,
but fails if given an IPv6 address.
2023-03-30 00:59:10 +00:00
SomberNight
44f91ab88f qml: add TODO about --offline missing 2023-03-30 00:59:06 +00: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
SomberNight
9ef6d6a56f qml: rm QEConfig.serverString. Network.server is sufficient
If there is no network object, it's ok not to be able to customise it.
2023-03-30 00:58:58 +00:00
SomberNight
d46d23b103 network: add method init_parameters_from_config 2023-03-30 00:58:54 +00:00
SomberNight
d189fdce69 qml: crash reporter: fix "show never" option
102.82 | E | gui.qml.qeapp.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/qml/qeapp.py", line 271, in showNever
    self.config.set_key(BaseCrashReporter.config_key, False)
AttributeError: 'QEAppController' object has no attribute 'config'
2023-03-30 00:58:51 +00:00
Sander van Grieken
cc60ab0b20 qml: move payment progress info text updates fully into qeinvoice, qeinvoice now updates itself
directly from backend wallet callbacks
2023-03-29 19:08:11 +02:00
Sander van Grieken
7efd6fe1e2 qml: don't show ln payment dialog, update info text instead 2023-03-29 19:08:11 +02:00
SomberNight
57786049e9 qml: network dialog to update "status" more often 2023-03-29 16:41:20 +00:00
SomberNight
faa53c71da qml: (trivial) fix warning in NetworkOverview.qml
10.95 | W | gui.qml.qeapp | file:///home/user/wspace/electrum/electrum/gui/qml/components/NetworkOverview.qml:220:25: Unable to assign [undefined] to QString
2023-03-29 16:41:17 +00:00
SomberNight
37d0a67e5b qml: proxy config: fix socks4/socks5 dropdown 2023-03-29 16:41:13 +00:00
SomberNight
512b63c424 exchange_rate: FxThread does not need network 2023-03-29 16:41:09 +00:00