commit 4d3ce06b6d29f746470d1f82c45372024ce3c5e1
parent a1ef7c4bb68aabca9834d9ee4fe32c287ce49854
Author: ThomasV <thomasv@electrum.org>
Date: Mon, 15 Feb 2016 08:34:31 +0100
kivy: always save new request; cleanup code.
Diffstat:
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py
@@ -323,11 +323,6 @@ class ReceiveScreen(CScreen):
self.screen.status = pr_receive_text[status]
Clock.schedule_once(lambda dt: self.update_qr())
- def amount_callback(self, popup):
- amount_label = self.screen.ids.get('amount')
- amount_label.text = popup.ids.amount_label.text
- self.update_qr()
-
def get_URI(self):
from electrum.util import create_URI
amount = self.screen.amount
@@ -364,20 +359,26 @@ class ReceiveScreen(CScreen):
self.app._clipboard.copy(uri)
self.app.show_info(_('Request copied to clipboard'))
- def on_amount_or_message(self):
+ def save_request(self):
addr = str(self.screen.address)
amount = str(self.screen.amount)
- message = str(self.screen.message) #.ids.message_input.text)
+ message = str(self.screen.message)
amount = self.app.get_amount(amount) if amount else 0
req = self.app.wallet.make_payment_request(addr, amount, message, None)
self.app.wallet.add_payment_request(req, self.app.electrum_config)
self.app.update_tab('requests')
+
+ def on_amount_or_message(self):
+ self.save_request()
Clock.schedule_once(lambda dt: self.update_qr())
def do_new(self):
- if not self.get_new_address():
+ addr = self.get_new_address()
+ if not addr:
self.app.show_info(_('Please use the existing requests first.'))
-
+ else:
+ self.save_request()
+ self.app.show_info(_('New request saved.'))
pr_text = {