electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit a0e5633d0bce147b5678f9a9b4013287f4a2df47
parent 5f5e9b0a171c71e0ccd2d04d34ae307b68ef6ec3
Author: ThomasV <thomasv@electrum.org>
Date:   Sat, 13 Feb 2016 10:33:49 +0100

kivy: small fixes

Diffstat:
Mgui/kivy/uix/dialogs/password_dialog.py | 3++-
Mgui/kivy/uix/dialogs/tx_dialog.py | 11+++++++----
Mgui/kivy/uix/screens.py | 3++-
3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/gui/kivy/uix/dialogs/password_dialog.py b/gui/kivy/uix/dialogs/password_dialog.py @@ -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) diff --git a/gui/kivy/uix/dialogs/tx_dialog.py b/gui/kivy/uix/dialogs/tx_dialog.py @@ -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): diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py @@ -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: