kivy: simplify UI, remove 'Save' button
This commit is contained in:
parent
3704b9c398
commit
151ac099a9
|
@ -320,18 +320,28 @@ class ReceiveScreen(CScreen):
|
||||||
amount = str(self.screen.amount)
|
amount = str(self.screen.amount)
|
||||||
message = str(self.screen.message) #.ids.message_input.text)
|
message = str(self.screen.message) #.ids.message_input.text)
|
||||||
if not message and not amount:
|
if not message and not amount:
|
||||||
self.app.show_error(_('No message or amount'))
|
return False
|
||||||
return
|
|
||||||
if amount:
|
if amount:
|
||||||
amount = self.app.get_amount(amount)
|
amount = self.app.get_amount(amount)
|
||||||
else:
|
else:
|
||||||
amount = 0
|
amount = 0
|
||||||
req = self.app.wallet.make_payment_request(addr, amount, message, None)
|
req = self.app.wallet.make_payment_request(addr, amount, message, None)
|
||||||
self.app.wallet.add_payment_request(req, self.app.electrum_config)
|
self.app.wallet.add_payment_request(req, self.app.electrum_config)
|
||||||
self.app.show_info(_('Request saved'))
|
|
||||||
self.app.update_tab('requests')
|
self.app.update_tab('requests')
|
||||||
|
return True
|
||||||
|
|
||||||
|
def on_amount(self):
|
||||||
|
self.do_save()
|
||||||
|
self.update_qr()
|
||||||
|
|
||||||
|
def on_message(self):
|
||||||
|
self.do_save()
|
||||||
|
self.update_qr()
|
||||||
|
|
||||||
def do_new(self):
|
def do_new(self):
|
||||||
|
if self.do_save():
|
||||||
|
self.app.show_info(_('Request saved'))
|
||||||
|
|
||||||
self.app.receive_address = None
|
self.app.receive_address = None
|
||||||
self.screen.amount = ''
|
self.screen.amount = ''
|
||||||
self.screen.message = ''
|
self.screen.message = ''
|
||||||
|
@ -369,11 +379,13 @@ class ContactsScreen(CScreen):
|
||||||
|
|
||||||
pr_text = {
|
pr_text = {
|
||||||
PR_UNPAID:_('Pending'),
|
PR_UNPAID:_('Pending'),
|
||||||
|
PR_UNKNOWN:_('Unknown'),
|
||||||
PR_PAID:_('Paid'),
|
PR_PAID:_('Paid'),
|
||||||
PR_EXPIRED:_('Expired')
|
PR_EXPIRED:_('Expired')
|
||||||
}
|
}
|
||||||
pr_icon = {
|
pr_icon = {
|
||||||
PR_UNPAID: 'atlas://gui/kivy/theming/light/important',
|
PR_UNPAID: 'atlas://gui/kivy/theming/light/important',
|
||||||
|
PR_UNKNOWN: 'atlas://gui/kivy/theming/light/important',
|
||||||
PR_PAID: 'atlas://gui/kivy/theming/light/confirmed',
|
PR_PAID: 'atlas://gui/kivy/theming/light/confirmed',
|
||||||
PR_EXPIRED: 'atlas://gui/kivy/theming/light/close'
|
PR_EXPIRED: 'atlas://gui/kivy/theming/light/close'
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,9 @@ ReceiveScreen:
|
||||||
on_address:
|
on_address:
|
||||||
self.parent.update_qr()
|
self.parent.update_qr()
|
||||||
on_amount:
|
on_amount:
|
||||||
self.parent.update_qr()
|
self.parent.on_amount()
|
||||||
on_message:
|
on_message:
|
||||||
self.parent.update_qr()
|
self.parent.on_message()
|
||||||
|
|
||||||
BoxLayout
|
BoxLayout
|
||||||
padding: '12dp', '12dp', '12dp', '12dp'
|
padding: '12dp', '12dp', '12dp', '12dp'
|
||||||
|
@ -103,16 +103,6 @@ ReceiveScreen:
|
||||||
size_hint: 1, None
|
size_hint: 1, None
|
||||||
height: '48dp'
|
height: '48dp'
|
||||||
on_release: s.parent.do_share()
|
on_release: s.parent.do_share()
|
||||||
Button:
|
|
||||||
text: _('Save')
|
|
||||||
size_hint: 1, None
|
|
||||||
height: '48dp'
|
|
||||||
on_release: s.parent.do_save()
|
|
||||||
BoxLayout:
|
|
||||||
size_hint: 1, None
|
|
||||||
height: '48dp'
|
|
||||||
Widget:
|
|
||||||
size_hint: 1, 1
|
|
||||||
Button:
|
Button:
|
||||||
text: _('New')
|
text: _('New')
|
||||||
size_hint: 1, None
|
size_hint: 1, None
|
||||||
|
|
Loading…
Reference in New Issue