kivy: small fixes
This commit is contained in:
@@ -3,6 +3,7 @@ from kivy.factory import Factory
|
|||||||
from kivy.properties import ObjectProperty
|
from kivy.properties import ObjectProperty
|
||||||
from kivy.lang import Builder
|
from kivy.lang import Builder
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
from kivy.clock import Clock
|
||||||
|
|
||||||
Builder.load_string('''
|
Builder.load_string('''
|
||||||
|
|
||||||
@@ -92,4 +93,4 @@ class PasswordDialog(Factory.Popup):
|
|||||||
def on_password(self, pw):
|
def on_password(self, pw):
|
||||||
if len(pw) == 6:
|
if len(pw) == 6:
|
||||||
self.dismiss()
|
self.dismiss()
|
||||||
self.callback(pw)
|
Clock.schedule_once(lambda dt: self.callback(pw), 0.1)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ from kivy.app import App
|
|||||||
from kivy.factory import Factory
|
from kivy.factory import Factory
|
||||||
from kivy.properties import ObjectProperty
|
from kivy.properties import ObjectProperty
|
||||||
from kivy.lang import Builder
|
from kivy.lang import Builder
|
||||||
|
from kivy.clock import Clock
|
||||||
|
|
||||||
from electrum_gui.kivy.i18n import _
|
from electrum_gui.kivy.i18n import _
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@@ -68,7 +69,7 @@ Builder.load_string('''
|
|||||||
Button:
|
Button:
|
||||||
size_hint: 0.5, None
|
size_hint: 0.5, None
|
||||||
height: '48dp'
|
height: '48dp'
|
||||||
text: _('OK')
|
text: _('Close')
|
||||||
on_release: popup.dismiss()
|
on_release: popup.dismiss()
|
||||||
''')
|
''')
|
||||||
|
|
||||||
@@ -117,12 +118,14 @@ class TxDialog(Factory.Popup):
|
|||||||
self.can_sign = self.wallet.can_sign(self.tx)
|
self.can_sign = self.wallet.can_sign(self.tx)
|
||||||
|
|
||||||
def do_sign(self):
|
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):
|
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.wallet.sign_transaction(self.tx, password)
|
||||||
self.app.show_info('')
|
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
def do_broadcast(self):
|
def do_broadcast(self):
|
||||||
|
|||||||
@@ -275,7 +275,8 @@ class SendScreen(CScreen):
|
|||||||
|
|
||||||
def send_tx_thread(self, tx, password):
|
def send_tx_thread(self, tx, password):
|
||||||
# sign transaction
|
# sign transaction
|
||||||
self.app.show_info("Signing...")
|
if self.app.wallet.can_sign(tx):
|
||||||
|
self.app.show_info("Signing...")
|
||||||
try:
|
try:
|
||||||
self.app.wallet.sign_transaction(tx, password)
|
self.app.wallet.sign_transaction(tx, password)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user