Commit Graph

546 Commits

Author SHA1 Message Date
ThomasV
9a5496cfd8 Qt: remove redundant history_list update 2023-02-20 10:06:26 +01:00
SomberNight
373db76ac9 util: kill bh2u
no longer useful, and the name is so confusing...
2023-02-17 11:43:11 +00:00
ThomasV
1da65451c0 Qt: schedule tooltip in do_copy 2023-02-13 11:11:26 +01:00
ThomasV
bc3946d2f4 Qt: new onchain tx creation flow:
- transaction_dialog is read-only
 - ConfirmTxDialog and RBF dialogs inherit from TxEditor
 - TxEditors are configurable
2023-02-07 16:42:20 +01:00
SomberNight
c2c02391a2 qt tx dialog: add context menus to IO fields
based on:
46df4190c8
2023-02-03 14:49:04 +00:00
SomberNight
7d42676785 qt tx dialog: make scid and addr texts clickable in IO fields
based on:
7eea0b6dae
52d845017c
2023-02-03 14:49:01 +00:00
SomberNight
53ca75d878 qt AddressDialog: separate parent and window 2023-02-03 14:48:57 +00:00
SomberNight
2a9909c252 locale amounts: consistently use "." as dec point, and " " as thou sep
Always use "." as decimal point, and " " as thousands separator.

Previously,
- for decimal point, we were using
  - "." in some places (e.g. AmountEdit, most fiat amounts), and
  - `locale.localeconv()['decimal_point']` in others.
- for thousands separator, we were using
  - "," in some places (most fiat amounts), and
  - " " in others (format_satoshis)

I think it is better to be consistent even if whatever we pick differs from the locale.
Using whitespace for thousands separator (vs comma) is probably less confusing for people
whose locale would user "." for ts and "," for dp (as in e.g. German).

The alternative option would be to always use the locale. Even if we decide to do that later,
this refactoring should be useful.

closes https://github.com/spesmilo/electrum/issues/2629
2023-01-10 14:45:35 +00:00
myxmaster
4a0e337c6d use placeholder for better translation 2023-01-09 17:28:19 +01:00
ThomasV
975cdca474 Qt coin control: allow to add/remove coins one by one.
Not many users know how to select multiple coins at once.
2023-01-06 11:45:14 +01:00
SomberNight
e3485de496 qt gui: handle swap server unreachable
note: testnet swap server is offline atm
closes https://github.com/spesmilo/electrum/issues/8107
2023-01-01 23:43:25 +00:00
accumulator
6e536d2d91 add invoice status to invoice_status callback (#8020)
* add invoice status to invoice_status callback

* debug statement fails tests

* removed commented lines, added progress/attempt counter comment in lnworker.pay_to_node,
and update the invoice_status event handler in qeinvoicelistmodel.py
2022-10-21 16:45:12 +00:00
SomberNight
d94c934e47 qt main_window: _coroutines_scheduled needs locking
window.run_coroutine_from_thread starts a coroutine on the asyncio loop,
which, when finishing, pops from the dict.
The for loop in clean_up is running on the Qt thread.

fixes https://github.com/spesmilo/electrum/issues/7983
2022-09-26 20:10:44 +00:00
SomberNight
abef454237 qt: better handle unparseable URIs
fixes https://github.com/spesmilo/electrum/issues/7941
2022-08-16 15:27:13 +00:00
SomberNight
388811296e qt: replace some hardcoded pixel sizes for better high-dpi support 2022-08-10 20:23:56 +02:00
avirgovi
b5d2b3c512 create chmod aware of XDG_RUNTIME_DIR
closes https://github.com/spesmilo/electrum/pull/7681
related https://github.com/spesmilo/electrum/issues/6334

Co-authored-by: avirgovi <avirgovi@cisco.com>
Co-authored-by: SomberNight <somber.night@protonmail.com>
2022-08-09 19:04:17 +02:00
SomberNight
7b095158bf wallet: add get_label_for_address, and make get_label private
fixes https://github.com/spesmilo/electrum/issues/7919

In the past, when creating payment requests, we keyed them by on-chain address,
and set/saved the msg of the request as label for the address.
Many places in the code were calling wallet.get_label(addr) with the expectation that
relevant payment requests are found and their message/description (if any) is considered.

wallet.get_label(key) is now made private, and instead the explicit non-polymorphic
wallet.get_label_for_{address,rhash,txid} alternatives should be used.
2022-08-09 17:21:14 +02:00
ThomasV
f5b1f7d2d9 Generalize ChannelDetailsDialog to channel backups.
Access funding_tx and closing_tx from the dialog,
instead of from the channels_list context menu.
2022-07-21 11:41:49 +02:00
ThomasV
6a74ffe80e Qt: improve channel details dialog. Add util.ShowQRLineEdit class. 2022-07-19 14:57:33 +02:00
ThomasV
4ff1ed5de5 show_lightning_invoice: minor improvements 2022-07-19 10:32:22 +02:00
ThomasV
85d354bf24 Qt show_lightning_invoice: show features 2022-07-19 10:15:55 +02:00
SomberNight
056de017f0 wallet: use get_request(addr) instead of receive_requests[addr]
since "invoice unification", requests are often keyed by rhash
2022-07-12 15:38:54 +02:00
ThomasV
ce552713a8 rename label: Confirmed -> On-chain 2022-07-05 10:17:59 +02:00
SomberNight
aea16f1322 qt main_window: (trivial) clean-up weird types passed to qt calls 2022-07-01 16:23:06 +02:00
SomberNight
133c0f71c4 qt ReceiveTab: (trivial) rename clear_receive_tab to do_clear 2022-07-01 16:21:56 +02:00
SomberNight
5b29e6d4f5 qt: (refactor) split "receive tab" out from main_window.py 2022-07-01 16:03:28 +02:00
SomberNight
2d68350900 qt: (refactor) split "send tab" out from main_window.py 2022-06-30 20:29:08 +02:00
ghost43
05226437bf Merge pull request #7839 from SomberNight/202202_lnurl_2
add lnurl-pay (`LUD-06`) support
2022-06-30 16:30:21 +00:00
SomberNight
0509109d61 qt.util.MyTreeView: handle find_row_by_key returning None
fixes https://github.com/spesmilo/electrum/issues/7780
fixes https://github.com/spesmilo/electrum/issues/7815

Re FIXME in main_window.py, in particular, adb might call `add_transaction` on the same tx multiple times.
In `wallet.on_event_adb_added_tx`, maybe we should propagate `notify_GUI` to `wallet._update_request_statuses_touched_by_tx`.

The issue being fixed here (above TARS reports) can be triggered in multiple ways, e.g.:
- have an already paid receive request, and receive a payment to the same address again
- have an already paid receive request, and *spend from* that address (in which case the history of the address will change, and address_synchronizer will call add_transaction again on the old tx that satisfied the old receive request)
2022-06-29 19:11:05 +02:00
SomberNight
ed1567e841 lnurl: make requests async, don't block Qt GUI, rm LUD-16 support
- in lnurl.py, make request methods async
- in Qt GUI, lnurl network requests no longer block the GUI thread
  - but they still do in the kivy GUI
- "lightning address" (LUD-16) support is removed for now as the
  email addresses are indistinguishable from openalias email addresses
  (both protocols should have added and enforced a prefix, or similar,
   to remove this kind of ambiguity -- now we would need to make a
   network request just to identify what kind of ID we were given)
2022-06-29 16:56:04 +02:00
SomberNight
df974c2384 qt paytoedit: evaluate text on textChanged(), but no network requests
- add param to _check_text to toggle if network requests are allowed ("full check")
- every 0.5 sec, if the textedit has no focus, do full check
- on textChanged()
  - detect if user copy-pasted by comparing current text against clipboard contents,
    if so, do full check
  - otherwise, do partial check
- on clicking ButtonsWidget btns (scan qr, paste, read file), do full check
2022-06-29 16:18:30 +02:00
SomberNight
649cad0122 lnurl: clean-up 2022-06-29 16:18:23 +02:00
bitromortac
fe2fbbd9b1 add lnurl-pay and lightning address support
* bundles all payment identifiers into handle_payment_identifier
* adds lnurl decoding
* adds lightning address decoding
2022-06-29 16:18:15 +02:00
ThomasV
dbf055de9a EventListener class to handle callbacks
and QtEventListener for Qt
2022-06-22 02:07:46 +02:00
ThomasV
1915330039 Qt receive widgets: do not show request that have expired
They may still be retrieved from the menu
2022-06-14 20:26:54 +02:00
ThomasV
c7418d4dc7 Qt: payment received notification, show label and amount instead of key
The key may be a bitcoin address, even for a lightning payment.
2022-06-14 20:10:24 +02:00
ThomasV
121d8732f1 Persist LNWatcher transactions in wallet file:
- separate AddressSynchronizer from Wallet and LNWatcher
 - the AddressSynchronizer class is referred to as 'adb' (address database)
 - Use callbacks to replace overloaded methods
2022-06-10 13:07:53 +02:00
SomberNight
f7573dbce6 qt main_window: (trivial) rm dead code, and fix copy-paste error 2022-06-07 19:57:53 +02:00
SomberNight
780408285c qt "Wallet Info" dialog: show bip32 root fingerprint
and also show it in DeviceMgr.select_device

follow-up 998cd0d356
2022-06-03 18:02:58 +02:00
SomberNight
998cd0d356 hww: make DeviceMgr.select_device dlg msg more explicit (add details)
related https://github.com/spesmilo/electrum/issues/4199#issuecomment-1145063552
2022-06-03 17:14:47 +02:00
Axel Gembe
798dbca880 qt ButtonsWidget: Don't pass app instance to addCopyButton
Doesn't make sense to pass the application when we can just use
QApplication.instance() instead.

from 54ccf640c5
2022-06-01 17:01:21 +02:00
ThomasV
8750936679 Rebalance dialog:
- move dialog code to own submodule and class
 - disable ok button if amount is out of bounds
 - add max button
 - add Rebalance button to channels tab
2022-05-29 18:40:45 +02:00
ThomasV
38b155c631 Qt receive widgets: factorize code 2022-05-29 13:54:38 +02:00
ThomasV
00183b5412 Qt: move current_request logic from main_window to requests_list 2022-05-28 17:52:07 +02:00
ThomasV
adbabacc12 Stabilize size of receive_tabs widgets
- use SetMinimumSize instead of sizeHint
   (partially reverts 28f794b63b)
 - to deal with small window sizes, set MinimumHeight of the
   parent TabWidget (with a few extra pixels for margins)
 - add an extra layout around address_help_text, so that it has
   margins (margins were removed in 28f794b63b)
2022-05-25 10:17:39 +02:00
ThomasV
7abc7c720f receive_tabs: add tooltip to inner widgets 2022-05-24 19:30:51 +02:00
SomberNight
28f794b63b Qt receive tab: better receive_tabs widget size for small windows
Previously the receive_tabs widget was allowed to be much smaller
than its inner main widget (e.g. truncating visible QR code).
A bit hackish to overwrite/monkeypatch sizeHint,
but I've tried a few approaches and this seems to work best.
2022-05-24 18:15:12 +02:00
ThomasV
2e120d74b8 Qt: add name to coroutines_scheduled 2022-05-24 13:39:06 +02:00
ThomasV
f14c420c30 Qt: display number of tasks (window._coroutines_scheduled) in toolbar.
Disable rebalance/swap suggestions attached to requests/invoices if there is an ongoing task.
Note: This assumes that all tasks are lightning payments, which is true for the moment.
2022-05-24 12:18:32 +02:00
ThomasV
0431cd825e Allow the QR code in the receive tab to be variable size 2022-05-23 13:17:25 +02:00