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(''' Builder.load_string('''
<QRCodeWidget> <QRCodeWidget>
on_parent: if args[1]: qrimage.source = self.loading_image #on_parent: if args[1]: qrimage.source = self.loading_image
canvas.before: canvas.before:
# Draw white Rectangle # Draw white Rectangle
Color: Color:
@ -61,7 +61,7 @@ class QRCodeWidget(FloatLayout):
defaulting to `(1, 1, 1, 1)`. 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): def __init__(self, **kwargs):
super(QRCodeWidget, self).__init__(**kwargs) super(QRCodeWidget, self).__init__(**kwargs)

17
gui/kivy/uix/screens.py

@ -216,29 +216,27 @@ class SendScreen(CScreen):
app.show_error(_('Invalid Fee')) app.show_error(_('Invalid Fee'))
return 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 # assume no password and fee is None
password = None password = None
fee = 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): def send_tx(self, outputs, fee, label, password):
app = App.get_running_app()
# make unsigned transaction # make unsigned transaction
coins = self.wallet.get_spendable_coins() coins = self.app.wallet.get_spendable_coins()
try: 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: except Exception as e:
traceback.print_exc(file=sys.stdout) traceback.print_exc(file=sys.stdout)
app.show_error(str(e)) self.app.show_error(str(e))
return return
# sign transaction # sign transaction
try: try:
self.wallet.sign_transaction(tx, password) self.app.wallet.sign_transaction(tx, password)
except Exception as e: except Exception as e:
traceback.print_exc(file=sys.stdout) traceback.print_exc(file=sys.stdout)
app.show_error(str(e)) self.app.show_error(str(e))
return return
# broadcast # broadcast
self.wallet.sendtx(tx) self.wallet.sendtx(tx)
@ -247,6 +245,7 @@ class SendScreen(CScreen):
class ReceiveScreen(CScreen): class ReceiveScreen(CScreen):
kvname = 'receive' kvname = 'receive'
@profiler
def update(self): def update(self):
addr = self.app.wallet.get_unused_address(None) addr = self.app.wallet.get_unused_address(None)
qr = self.screen.ids.get('qr') qr = self.screen.ids.get('qr')

Loading…
Cancel
Save