Browse Source

kivy: revert to using zxing

283
ThomasV 9 years ago
parent
commit
1f1dbaf523
  1. 13
      gui/kivy/main_window.py
  2. 2
      gui/kivy/uix/dialogs/create_restore.py

13
gui/kivy/main_window.py

@ -241,7 +241,7 @@ class ElectrumWindow(App):
self.show_error("invoice error:" + pr.error) self.show_error("invoice error:" + pr.error)
self.send_screen.do_clear() self.send_screen.do_clear()
def on_qr(self, d, data): def on_qr(self, data):
from electrum.bitcoin import base_decode, is_address from electrum.bitcoin import base_decode, is_address
if is_address(data): if is_address(data):
self.set_URI(data) self.set_URI(data)
@ -310,17 +310,6 @@ class ElectrumWindow(App):
popup.open() popup.open()
def scan_qr(self, on_complete): def scan_qr(self, on_complete):
self.scan_qr_android(on_complete)
def scan_qr_android(self, on_complete):
dlg = Cache.get('electrum_widgets', 'QrScannerDialog')
if not dlg:
dlg = Factory.QrScannerDialog()
Cache.append('electrum_widgets', 'QrScannerDialog', dlg)
dlg.bind(on_complete=on_complete)
dlg.open()
def scan_qr_zxing(self, on_complete):
if platform != 'android': if platform != 'android':
return return
from jnius import autoclass from jnius import autoclass

2
gui/kivy/uix/dialogs/create_restore.py

@ -562,7 +562,7 @@ class RestoreXpubDialog(WizardDialog):
self.ids.next.disabled = not bool(self._test(self.get_text())) self.ids.next.disabled = not bool(self._test(self.get_text()))
def scan_xpub(self): def scan_xpub(self):
def on_complete(d, text): def on_complete(text):
self.ids.text_input_seed.text = text self.ids.text_input_seed.text = text
self.app.scan_qr(on_complete) self.app.scan_qr(on_complete)

Loading…
Cancel
Save