mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 12:30:07 +00:00
kivy: add delete button for invoices/requests
This commit is contained in:
parent
6c2ef176cc
commit
df5acd1ea5
5 changed files with 23 additions and 3 deletions
BIN
electrum/gui/kivy/theming/light/delete.png
Normal file
BIN
electrum/gui/kivy/theming/light/delete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 453 B |
|
@ -393,6 +393,19 @@ class SendScreen(CScreen):
|
|||
else:
|
||||
self.app.tx_dialog(tx)
|
||||
|
||||
def clear_invoices_dialog(self):
|
||||
invoices = self.app.wallet.get_invoices()
|
||||
if not invoices:
|
||||
return
|
||||
def callback(c):
|
||||
if c:
|
||||
for req in invoices:
|
||||
key = req['key']
|
||||
self.app.wallet.delete_invoice(key)
|
||||
self.update()
|
||||
n = len(invoices)
|
||||
d = Question(_(f'Delete {n} invoices?'), callback)
|
||||
d.open()
|
||||
|
||||
|
||||
class ReceiveScreen(CScreen):
|
||||
|
@ -508,7 +521,8 @@ class ReceiveScreen(CScreen):
|
|||
key = req.get('rhash') or req['address']
|
||||
self.app.wallet.delete_request(key)
|
||||
self.update()
|
||||
d = Question(_('Delete all requests?'), callback)
|
||||
n = len(requests)
|
||||
d = Question(_(f'Delete {n} requests?'), callback)
|
||||
d.open()
|
||||
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@
|
|||
size_hint: 1, None
|
||||
height: '48dp'
|
||||
IconButton:
|
||||
icon: 'atlas://electrum/gui/kivy/theming/light/list'
|
||||
icon: 'atlas://electrum/gui/kivy/theming/light/delete'
|
||||
size_hint: 0.5, None
|
||||
height: '48dp'
|
||||
on_release: Clock.schedule_once(lambda dt: s.clear_requests_dialog())
|
||||
|
|
|
@ -148,6 +148,10 @@
|
|||
BoxLayout:
|
||||
size_hint: 1, None
|
||||
height: '48dp'
|
||||
IconButton:
|
||||
icon: 'atlas://electrum/gui/kivy/theming/light/delete'
|
||||
size_hint: 0.5, 1
|
||||
on_release: Clock.schedule_once(lambda dt: s.clear_invoices_dialog())
|
||||
IconButton:
|
||||
size_hint: 0.5, 1
|
||||
on_release: s.do_save()
|
||||
|
@ -158,7 +162,7 @@
|
|||
on_release: s.do_paste()
|
||||
IconButton:
|
||||
id: qr
|
||||
size_hint: 1, 1
|
||||
size_hint: 0.5, 1
|
||||
on_release: Clock.schedule_once(lambda dt: app.scan_qr(on_complete=app.on_qr))
|
||||
icon: 'atlas://electrum/gui/kivy/theming/light/camera'
|
||||
Button:
|
||||
|
|
|
@ -681,6 +681,8 @@ class Abstract_Wallet(AddressSynchronizer, ABC):
|
|||
item['status'] = self.lnworker.get_invoice_status(key)
|
||||
else:
|
||||
return
|
||||
# unique handle
|
||||
item['key'] = key
|
||||
return item
|
||||
|
||||
def _get_relevant_invoice_keys_for_tx(self, tx: Transaction) -> Set[str]:
|
||||
|
|
Loading…
Add table
Reference in a new issue