tkivy: button to show seed, and show error if trying to spend from watching only wallet - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit a03301c55fa9ad713a788a93f3ee83a82681f826 DIR parent 535956149a8a6b2801b434d2d00ecb3ba2e9bde1 HTML Author: ThomasV <thomasv@electrum.org> Date: Thu, 11 Feb 2016 12:54:04 +0100 kivy: button to show seed, and show error if trying to spend from watching only wallet Diffstat: M gui/kivy/main_window.py | 12 ++++++++++++ M gui/kivy/uix/screens.py | 3 +++ M gui/kivy/uix/ui_screens/status.kv | 19 +++++++++++++++++++ 3 files changed, 34 insertions(+), 0 deletions(-) --- DIR diff --git a/gui/kivy/main_window.py b/gui/kivy/main_window.py t@@ -706,6 +706,18 @@ class ElectrumWindow(App): else: apply(f, args + (None,)) + def show_seed(self, label): + self.protected(self._show_seed, (label,)) + + def _show_seed(self, label, password): + print label, password + try: + seed = self.wallet.get_seed(password) + except: + self.show_error("Invalid PIN") + return + label.text = _('Seed') + ':\n' + seed + def change_password(self): self.protected(self._change_password, ()) DIR diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py t@@ -272,6 +272,9 @@ class SendScreen(CScreen): traceback.print_exc(file=sys.stdout) self.app.show_error(str(e)) return + if not tx.is_complete(): + self.app.show_info("Transaction is not complete") + return # broadcast ok, txid = self.app.wallet.sendtx(tx) self.app.show_info(txid) DIR diff --git a/gui/kivy/uix/ui_screens/status.kv b/gui/kivy/uix/ui_screens/status.kv t@@ -67,5 +67,24 @@ Popup: opacity: 1 if root.unmatured else 0 text_size: self.size halign: 'left' + Label: + text: '' + id: seed_label + text_size: self.width, None + size: self.texture_size Widget: size_hint: None, 1 + BoxLayout: + size_hint: 1, None + height: '48dp' + Button: + size_hint: 0.5, None + height: '48dp' + text: _('Hide seed') if seed_label.text else _('Show seed') + on_release: + setattr(seed_label, 'text', '') if seed_label.text else app.show_seed(seed_label) + Button: + size_hint: 0.5, None + height: '48dp' + text: _('Close') + on_release: root.dismiss()