Commit Graph

104 Commits

Author SHA1 Message Date
SomberNight 23f2412da7 qt: follow-up "rm thousand sep when copying numbers to clipboard"
follow-up https://github.com/spesmilo/electrum/pull/8479
2023-06-13 15:59:18 +00:00
ThomasV 0d007b5739 follow-up aa3697d 2023-03-22 10:21:09 +01:00
ThomasV aa3697de74 Qr request_list: maybe fix elusive segfault 2023-03-19 06:36:36 +01:00
ThomasV 8cc610298b QML: auto-delete expired requests. Add action to Qt menu 2023-03-18 09:59:18 +01:00
ThomasV 206bacbcb3 move MyTreeView and related classes to own submodule 2023-03-15 14:25:42 +01:00
SomberNight 9d64fe7046 qt: MyTreeView: disambiguate "parent" and "main_window" 2023-03-13 17:29:29 +00:00
SomberNight d3c241db4c qt: MyTreeView: use enum.auto() in Columns enum 2023-03-13 16:12:50 +00:00
ThomasV 5ad4023e7d restore invoices_label and requests_label. move paytomany and toggle_qr_window from main menu to toolbar 2023-03-11 18:08:00 +01:00
ThomasV 1a0a52f9b6 invoices and requests lists: move import/export menus into local toolbars 2023-03-11 15:15:16 +01:00
ThomasV 719b468eee Refresh bolt11 routing hints when channel liquidity changes:
- wallet_db update: separate Invoices and Requests.
 - do not store bolt11 invoice in Request
2023-02-28 15:33:17 +01:00
ThomasV cb8cc76e1f requests list: remove hidden column LN_INVOICE 2023-02-27 21:40:43 +01:00
ThomasV d766f2fd9e Qt: make copy menus more consistent 2023-02-12 11:13:03 +01:00
SomberNight d19d82be64 follow-up prev 2022-11-18 16:53:50 +00:00
SomberNight c38022b5fc Qt request list: Ctrl+F filter to work for addr, LN invoice, LN rhash
add new hidden columns, mainly for ability to find a request that corresponds to an address
2022-11-18 16:49:36 +00:00
ThomasV 14e96f4d53 Index request by ID instead of receiving address.
Replace get_key_for_outgoing_invoice, get_key_for_incoming_request
with Invoice.get_id()

When a new request is created, reuse addresses of expired requests (fixes #7927)

The API is changed for the following commands:
 get_request, get_invoice,
 list_requests, list_invoices,
 delete_request, delete_invoice
2022-09-02 10:58:11 +02:00
ThomasV d9f77a50e8 wallet API: remove get_request_status, it is redundant with get_invoice_status 2022-08-29 09:48:08 +02: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 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 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 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
ThomasV 00183b5412 Qt: move current_request logic from main_window to requests_list 2022-05-28 17:52:07 +02:00
ThomasV e43983e854 Qt: update current request when update_tabs is called 2022-05-22 13:32:24 +02:00
SomberNight 37ba7277ae qt main_window: fix visual artifact when opening (re invoice lists)
InvoiceList.update() calls hide_if_empty(), which calls setVisible().
setVisible(True) should not be called before the widget is properly parented and put into a layout,
as that results in a blank window flashing up (appearing and disappearing) briefly.
2022-05-06 20:02:53 +02:00
ThomasV b9139a2472 minor fix: update_receive_address_styling 2022-04-23 09:28:41 +02:00
ThomasV 9ba5a34800 Qt receive tab:
- show payment options in tabs: URI, Address or Lightning
 - use vertical tabs to save space
 - switch between QR and text views
 - open standalone QR window through menu, instead of clicking on QR code
2022-04-20 12:48:22 +02:00
ThomasV e392197ab9 wallet_db upgrade:
- unify lightning and onchain invoices, with optional fields for bip70 and lightning
 - add receive_address fields to submarine swaps
2022-04-20 12:48:22 +02:00
ThomasV 92c6d91157 Qt: on status changes, refresh item in invoice_list and request_list,
instead of calling update(), which repopulates the model.
2022-03-23 19:52:28 +01:00
SomberNight 3b77340671 Qt MyTreeView: rm usages of Qt.UserRole, use explicit roles instead
This is a bit more verbose but it explicitly shows what data is being
used where.

Also rm implicitly setting editable_columns based on stretch_column.
2021-04-22 20:37:14 +02:00
Benoit Verret f731c38293 Minor style changes 2021-03-21 00:36:23 -04:00
SomberNight 897f90d6e8 wallet: factor out "what key to use for invoice"
fix: qt request list was not using the correct key
2021-03-12 17:29:54 +01:00
ThomasV a2122a8c19 auto-remove paid invoices from GUI
- delay 3 seconds in GUI
 - kivy remove 'delete' buttons from send/receive screens
2021-01-12 10:59:41 +01:00
SomberNight 096d853482 qt: rm some usages of get_parent_main_window
instead, pass around the main window or config (whichever is actually needed)

fixes #6342
2020-12-20 15:25:31 +01:00
SomberNight c66c54a254 android: handle on-chain/lightning URI on app open
fixes #6352
2020-07-08 04:16:30 +02:00
SomberNight d5f368c584 LN invoices: support msat precision
fixes #6250
2020-06-22 22:48:13 +02:00
ThomasV 6058829870 Use attr.s classes for invoices and requests:
- storage upgrade
 - fixes #6192
 - add can_pay_invoice, can_receive_invoice to lnworker
2020-06-01 21:02:45 +02:00
SomberNight 93c90a30f0 qt MyTreeView: impl custom sort order framework, and use for invoices
sort invoices and payreqs (for Date column) based on timestamps
(timestamps have second resolution while the displayed date has minute resolution)
2020-05-15 15:32:18 +02:00
SomberNight 2a4b516f16 qt receive tab: fix refresh bug on macOS
related: #4777
2020-05-14 20:24:21 +02:00
ThomasV f67011d477 Qt: do not filter out paid invoices/requests. let user delete multiple items 2020-03-03 12:56:44 +01:00
ThomasV 94443ebe5e Qt: list requests and invoices in descending order 2020-03-03 11:25:54 +01:00
ThomasV abb0760616 Simplify receive tab:
- display receiving address in receiving tabs
 - display lightning invoice as 'address'
 - save last active tab in preferences
2020-03-03 11:10:48 +01:00
SomberNight 84797f90d0 qt request_list: clear receive addr/req when hiding list 2020-02-23 21:23:56 +01:00
SomberNight 4c2e1970f2 qt receive tab: better "Clear" behaviour
Previously, the selection would not get cleared, and if the user clicked
again on the already selected item, the click would get ignored
(request would not get populated).
2020-02-23 21:18:46 +01:00
SomberNight 5fd790dec9 follow-up prev
These lists are only visible when non-empty. This interacts badly with
the internals of maybe_defer_update().
2020-01-21 11:51:02 +01:00
SomberNight 1d0fc6665b qt: defer refreshing tabs until they are visible
very loosely based on Electron-Cash/Electron-Cash@522e7ca59e
2020-01-19 07:31:50 +01:00
SomberNight 356a0a2865 qt: clean-up in some MyTreeView children (mv code from update to init) 2020-01-19 07:02:48 +01:00
SomberNight 7b49832a3f payment requests: fix explicit "None" expiration
Traceback (most recent call last):
  File "...\electrum\electrum\gui\qt\main_window.py", line 994, in <lambda>
    self.create_invoice_button.clicked.connect(lambda: self.create_invoice(False))
  File "...\electrum\electrum\gui\qt\main_window.py", line 1123, in create_invoice
    key = self.create_bitcoin_request(amount, message, expiry)
  File "...\electrum\electrum\gui\qt\main_window.py", line 1132, in create_bitcoin_request
    addr = self.wallet.get_unused_address()
  File "...\electrum\electrum\wallet.py", line 1452, in wrapper
    addr = func(self, *args, **kwargs)
  File "...\electrum\electrum\wallet.py", line 1465, in get_unused_address
    addrs = self.get_unused_addresses()
  File "...\electrum\electrum\wallet.py", line 1459, in get_unused_addresses
    in_use_by_request = [k for k in self.receive_requests.keys() if self.get_request_status(k)[0] != PR_EXPIRED]
  File "...\electrum\electrum\wallet.py", line 1459, in <listcomp>
    in_use_by_request = [k for k in self.receive_requests.keys() if self.get_request_status(k)[0] != PR_EXPIRED]
  File "...\electrum\electrum\wallet.py", line 1535, in get_request_status
    if exp > 0 and time.time() > timestamp + exp:
TypeError: '>' not supported between instances of 'NoneType' and 'int'
2019-12-16 21:03:34 +01:00
ThomasV f08796fe68 Allow requests that never expire 2019-12-10 14:45:29 +01:00
SomberNight d2a8028cde qt receive tab: show plain bitcoin address 2019-12-07 06:06:36 +01:00
SomberNight d81110014e qt requests/invoices: use TreeView.sortByColumn instead of model.sort
sort the view, not the model
This way, qt will display the icon indicating the sort order on the relevant column header.
2019-12-07 04:28:08 +01:00