Browse Source

kivy: workaround locale issue and fix set_qr_data

283
ThomasV 10 years ago
parent
commit
7cf276c10b
  1. 6
      gui/kivy/main_window.py
  2. 8
      gui/kivy/uix/dialogs/qr_scanner.py
  3. 8
      gui/kivy/uix/screens.py

6
gui/kivy/main_window.py

@ -584,11 +584,11 @@ class ElectrumWindow(App):
icon = "atlas://gui/kivy/theming/light/confirmed"
if value is not None:
v_str = self.format_amount(value, True, whitespaces=True)
v_str = self.format_amount(value, True).replace(',','.')
else:
v_str = '--'
balance_str = self.format_amount(balance, whitespaces=True)
balance_str = self.format_amount(balance).replace(',','.')
if tx_hash:
label, is_default_label = self.wallet.get_label(tx_hash)
@ -630,7 +630,7 @@ class ElectrumWindow(App):
ri.date = date_time
mintimestr = date_time.split()[0]
ri.address = address
ri.amount = amount.strip()
ri.amount = amount
ri.quote_text = get_history_rate(ref(ri),
Decimal(amount),
mintimestr)

8
gui/kivy/uix/dialogs/qr_scanner.py

@ -12,16 +12,12 @@ class QrScannerDialog(Factory.AnimatedPopup):
instance.stop()
self.dismiss()
uri = App.get_running_app().decode_uri(value[0].data)
#address = uri.get('address', 'empty')
#label = uri.get('label', '')
#amount = uri.get('amount', 0.0)
#message = uir.get('message', '')
self.dispatch('on_complete', uri)
def on_complete(self):
def on_complete(self, x):
''' Default Handler for on_complete event.
'''
pass
print x
Builder.load_string('''

8
gui/kivy/uix/screens.py

@ -101,10 +101,10 @@ class MainScreen(Factory.Screen):
class ScreenSend(CScreen):
def set_qr_data(self, uri):
self.ids.payto_e.text = uri.get('address')
self.ids.message_e.text = uri.get('message')
self.ids.amount_e.text = uri.get('amount')
def set_qr_data(self, dialog, uri):
self.ids.payto_e.text = uri.get('address', '')
self.ids.message_e.text = uri.get('message', '')
self.ids.amount_e.text = uri.get('amount', '')
#label = uri.get('label')
#if label:
# TODO: update label, add to contacts

Loading…
Cancel
Save