kivy: small fixes

This commit is contained in:
ThomasV 2016-02-13 10:33:49 +01:00
parent 5f5e9b0a17
commit a0e5633d0b
3 changed files with 11 additions and 6 deletions

View File

@ -3,6 +3,7 @@ from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from decimal import Decimal
from kivy.clock import Clock
Builder.load_string('''
@ -92,4 +93,4 @@ class PasswordDialog(Factory.Popup):
def on_password(self, pw):
if len(pw) == 6:
self.dismiss()
self.callback(pw)
Clock.schedule_once(lambda dt: self.callback(pw), 0.1)

View File

@ -2,6 +2,7 @@ from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.clock import Clock
from electrum_gui.kivy.i18n import _
from datetime import datetime
@ -68,7 +69,7 @@ Builder.load_string('''
Button:
size_hint: 0.5, None
height: '48dp'
text: _('OK')
text: _('Close')
on_release: popup.dismiss()
''')
@ -117,12 +118,14 @@ class TxDialog(Factory.Popup):
self.can_sign = self.wallet.can_sign(self.tx)
def do_sign(self):
self.app.protected(self._do_sign, ())
self.app.protected(_("Enter your PIN code in order to sign this transaction"), self._do_sign, ())
def _do_sign(self, password):
self.app.show_info(_('Signing'))
self.txid_str = _('Signing') + '...'
Clock.schedule_once(lambda dt: self.__do_sign(password), 0.1)
def __do_sign(self, password):
self.app.wallet.sign_transaction(self.tx, password)
self.app.show_info('')
self.update()
def do_broadcast(self):

View File

@ -275,7 +275,8 @@ class SendScreen(CScreen):
def send_tx_thread(self, tx, password):
# sign transaction
self.app.show_info("Signing...")
if self.app.wallet.can_sign(tx):
self.app.show_info("Signing...")
try:
self.app.wallet.sign_transaction(tx, password)
except Exception as e: