Browse Source

kivy: remove loading_image in qrcodewidget (too slow)

283
ThomasV 9 years ago
parent
commit
e2237de739
  1. 4
      gui/kivy/uix/qrcodewidget.py
  2. 17
      gui/kivy/uix/screens.py

4
gui/kivy/uix/qrcodewidget.py

@ -18,7 +18,7 @@ from kivy.clock import Clock
Builder.load_string('''
<QRCodeWidget>
on_parent: if args[1]: qrimage.source = self.loading_image
#on_parent: if args[1]: qrimage.source = self.loading_image
canvas.before:
# Draw white Rectangle
Color:
@ -61,7 +61,7 @@ class QRCodeWidget(FloatLayout):
defaulting to `(1, 1, 1, 1)`.
'''
loading_image = StringProperty('gui/kivy/theming/loading.gif')
#loading_image = StringProperty('gui/kivy/theming/loading.gif')
def __init__(self, **kwargs):
super(QRCodeWidget, self).__init__(**kwargs)

17
gui/kivy/uix/screens.py

@ -216,29 +216,27 @@ class SendScreen(CScreen):
app.show_error(_('Invalid Fee'))
return
message = 'sending {} {} to {}'.format(app.base_unit, scrn.amount_e.text, r)
message = 'sending {} {} to {}'.format(self.app.base_unit, scrn.amount_e.text, r)
# assume no password and fee is None
password = None
fee = None
#self.send_tx([('address', to_address, amount)], fee, label, password)
self.send_tx([('address', to_address, amount)], fee, label, password)
def send_tx(self, outputs, fee, label, password):
app = App.get_running_app()
# make unsigned transaction
coins = self.wallet.get_spendable_coins()
coins = self.app.wallet.get_spendable_coins()
try:
tx = self.wallet.make_unsigned_transaction(coins, outputs, self.electrum_config, fee)
tx = self.app.wallet.make_unsigned_transaction(coins, outputs, self.electrum_config, fee)
except Exception as e:
traceback.print_exc(file=sys.stdout)
app.show_error(str(e))
self.app.show_error(str(e))
return
# sign transaction
try:
self.wallet.sign_transaction(tx, password)
self.app.wallet.sign_transaction(tx, password)
except Exception as e:
traceback.print_exc(file=sys.stdout)
app.show_error(str(e))
self.app.show_error(str(e))
return
# broadcast
self.wallet.sendtx(tx)
@ -247,6 +245,7 @@ class SendScreen(CScreen):
class ReceiveScreen(CScreen):
kvname = 'receive'
@profiler
def update(self):
addr = self.app.wallet.get_unused_address(None)
qr = self.screen.ids.get('qr')

Loading…
Cancel
Save