Commit Graph

1255 Commits

Author SHA1 Message Date
SomberNight
7d481935e2 qt ReceiveTab: handle case with URI=="" 2022-08-11 13:11:54 +00:00
SomberNight
0e15d7a973 qt RequestList: allow copying URI even if there is no bitcoin addr
(when there is LN part but no on-chain part)
2022-08-11 13:09:51 +00:00
SomberNight
659d6890d9 wallet.get_request_URI: rm code duplication 2022-08-11 13:07:56 +00:00
SomberNight
7daeccdf85 qt ReceiveTab: ensure TabWidget has frame in more cases 2022-08-11 12:43:17 +00:00
SomberNight
396a68cb58 wallet: delete_{invoice,request}: add "write_to_disk=True" param
to support faster batch-deletion
2022-08-10 22:50:23 +02:00
SomberNight
388811296e qt: replace some hardcoded pixel sizes for better high-dpi support 2022-08-10 20:23:56 +02:00
Axel Gembe
07ee204c9c Qt Console: Fix font reset when moving between screens
When the console was moved between screen boundaries with different scaling
settings, the font was reset. This is because QPlainTextEdit sets the
documents default font back to its own font property when Qt has a font
change event. This patch sets the font property of the editor instead of
the document.

this ports 60d63b3272

related: https://github.com/Electron-Cash/Electron-Cash/issues/1314
2022-08-10 16:18:32 +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
48bb4867a4 fix #7920 2022-08-08 12:50:43 +02:00
ThomasV
e8a8c8c3f1 fix #7921 2022-08-08 12:40:44 +02:00
SomberNight
d4f76143b0 qt ReceiveTabWidget: revert prev, and add frame in a different way
This reverts commit b97d080617.
2022-08-03 22:16:24 +02:00
SomberNight
b97d080617 qt ReceiveTabWidget: add frame to "help label", and rm some nesting 2022-08-03 19:39:28 +02:00
ThomasV
58b56b3039 receive_tab: use QStackedWidget instead of QTabWidget 2022-08-03 18:15:56 +02:00
ThomasV
0c8a828704 follow-up 7dcd8d8dc8
- set minimumHeight of VTabWidget (needed for small window size)
  - keep self.tabBar visible, otherwise the widget border is rendered with a gap on linux
  - apply stylesheet to both tabTar and surrounding widget
  - buttons style: align text left, NoFocus
  - on button click: setChecked always True, draw qr code at the end because it is slow
2022-07-31 11:33:26 +02:00
ThomasV
98e6bd6f80 Merge pull request #7909 from SomberNight/202207_qt_receive_tab_macos
Qt receive_tab: fix receive_tabs widget on macOS
2022-07-31 11:32:01 +02:00
ThomasV
a2e059ce7a receive_tab: workaround qdarkstyle bug 2022-07-31 09:55:07 +02:00
SomberNight
7dcd8d8dc8 Qt receive_tab: fix receive_tabs widget on macOS
QTabWidget with "West" tab pos and horizontal text looks completely broken on macOS
(despite looking good on e.g. Ubuntu GNOME and Windows).

The alternative here looks ok on all three OSes.

fixes https://github.com/spesmilo/electrum/issues/7908
2022-07-30 02:16:38 +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
b5617ec0fd lnworker: get_channel_objects method to be used by GUI 2022-07-20 21:07:13 +02:00
ThomasV
5faef83874 rm dead code 2022-07-20 09:56:53 +02:00
ThomasV
30609cdc63 Qt: simplify lightning_tx_dialog using ShowQRLineEdit 2022-07-20 09:51:26 +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
ThomasV
1568c10ca0 fix 'view log' menu (follow-up 2d68350900) 2022-07-18 14:09:50 +02:00
SomberNight
d5b5f82b01 LN invoice: better handle unknown required featured bits in bolt11 invs
A user provided an invoice that requires feature bit 30. (That bit is not in the spec)
To test:
```
lnbc1p324a66pp5tundykxx3q5kztsr8x00eknpn2uwe3394cnky3j9a0fswm568wnsdp9facx2mj5d9kk2um5v9khqueqv3hkuct5d9hkucqzpgxq9z0rgqsp5l73jgfgctzc92juer5rk2mqcrkj8teng53dr9vfxj4n8lulu4jmq9q8pqqqssq4gacn859tpzz99hkusnh7m93d5ncpx3t4zns8ynca7akmljpl5vh504qjz7dqwewqjh4md7xagaz5wg85knvxywrhp0sp2t09yta7lcq3qs6fy

lntb1p324a66pp5tundykxx3q5kztsr8x00eknpn2uwe3394cnky3j9a0fswm568wnssp5l73jgfgctzc92juer5rk2mqcrkj8teng53dr9vfxj4n8lulu4jmqdp9facx2mj5d9kk2um5v9khqueqv3hkuct5d9hkuxq9z0rgq9q8pqqqssqdte0z9dy7ur7fagsk7r3mtfj6upq88xfylhufys87zqpamklcfgn2f3xeq3nlhvn3qy9tdgg42vq9eq99qz6rz6tzqezfhzuv6zsr5qp7cgel4
```
2022-07-15 18:00:33 +02:00
SomberNight
1e97491124 qt QRDialog: make dialog usefully resizeable
In commit 9bba65199e,
the QRCodeWidget was put inside a BoxLayout as a workaround to avoid the "copy to clipboard" and
"save as file" functionality grabbing extra whitespace/stretch/padding and putting it into the
exported image.

However, in turn that commit introduced a bug, where making the dialog larger does not make the
QRCodeWidget larger (which worked prior).

This commit tries to fix the regression and also the original bug.
2022-07-12 19:26:01 +02:00
SomberNight
430a61eb42 qt QRDialog: try to fix layout-sizing issues
related https://github.com/spesmilo/electrum/pull/7218
closes https://github.com/spesmilo/electrum/pull/7223
2022-07-12 16:50:49 +02:00
SomberNight
d067e0e314 wallet: make "invoices" and "receive_requests" private
Other modules should use getters such as "get_request(key)" or "get_unpaid_requests()",
direct access is error-prone.
2022-07-12 15:46:47 +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
SomberNight
44655bcca2 qt qrtextedit: also show icon in ShowQRTextEdit.contextMenu
follow-up 955986d024
2022-07-12 15:33:28 +02:00
SomberNight
955986d024 qt: PayToEdit and OverlayControlMixin: move around input buttons 2022-07-11 19:08:53 +02:00
ThomasV
9ae0e5bffc remove lightning parameter from wallet.create_request 2022-07-11 13:52:13 +02:00
ThomasV
957174a039 all GUIs: show local and remote force-close options in a homogeneous way 2022-07-11 13:08:04 +02:00
ThomasV
8c991ef656 channels_list: refactor menu. Add request_force_close option for channels too, guard it with a confirmation dialog. 2022-07-11 12:16:17 +02:00
ThomasV
1d343657f1 Qt: require left-click to toggle receive qr-code 2022-07-05 15:31:53 +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
9f1da8422b qt LightningTxDialog: (fix regression) show fee for ln payments
follow-up e1d34300e5
2022-06-29 18:02:55 +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
SomberNight
4a791f9285 qt.completion_text_edit: fix logic bug re shift/ctrl 2022-06-28 19:51:26 +02:00