Browse Source

kivy: do not open invoices, requests dialogs if list is empty

3.2.x
ThomasV 7 years ago
parent
commit
971a6979ee
  1. 10
      gui/kivy/main_window.py
  2. 1
      gui/kivy/uix/screens.py

10
gui/kivy/main_window.py

@ -837,12 +837,22 @@ class ElectrumWindow(App):
def invoices_dialog(self, screen):
from .uix.dialogs.invoices import InvoicesDialog
if len(self.wallet.invoices.sorted_list()) == 0:
self.show_info(' '.join([
_('No saved invoices.'),
_('Signed invoices are saved automatically when you scan them.'),
_('You may also save unsigned requests or contact addresses using the save button.')
]))
return
popup = InvoicesDialog(self, screen, None)
popup.update()
popup.open()
def requests_dialog(self, screen):
from .uix.dialogs.requests import RequestsDialog
if len(self.wallet.get_sorted_requests(self.electrum_config)) == 0:
self.show_info(_('No saved requests.'))
return
popup = RequestsDialog(self, screen, None)
popup.update()
popup.open()

1
gui/kivy/uix/screens.py

@ -217,7 +217,6 @@ class SendScreen(CScreen):
pr = make_unsigned_request(req).SerializeToString()
pr = PaymentRequest(pr)
self.app.wallet.invoices.add(pr)
self.app.update_tab('invoices')
self.app.show_info(_("Invoice saved"))
if pr.is_pr():
self.screen.is_pr = True

Loading…
Cancel
Save