|
@ -90,15 +90,17 @@ class ElectrumWindow(App): |
|
|
Logger.info('language: {}'.format(language)) |
|
|
Logger.info('language: {}'.format(language)) |
|
|
_.switch_lang(language) |
|
|
_.switch_lang(language) |
|
|
|
|
|
|
|
|
|
|
|
def update_history(self, *dt): |
|
|
|
|
|
if self.history_screen: |
|
|
|
|
|
self.history_screen.update() |
|
|
|
|
|
|
|
|
def on_quotes(self, d): |
|
|
def on_quotes(self, d): |
|
|
Logger.info("on_quotes") |
|
|
Logger.info("on_quotes") |
|
|
if self.history_screen: |
|
|
self._trigger_update_history() |
|
|
Clock.schedule_once(lambda dt: self.history_screen.update()) |
|
|
|
|
|
|
|
|
|
|
|
def on_history(self, d): |
|
|
def on_history(self, d): |
|
|
Logger.info("on_history") |
|
|
Logger.info("on_history") |
|
|
if self.history_screen: |
|
|
self._trigger_update_history() |
|
|
Clock.schedule_once(lambda dt: self.history_screen.update()) |
|
|
|
|
|
|
|
|
|
|
|
def _get_bu(self): |
|
|
def _get_bu(self): |
|
|
return self.electrum_config.get('base_unit', 'mBTC') |
|
|
return self.electrum_config.get('base_unit', 'mBTC') |
|
@ -106,17 +108,15 @@ class ElectrumWindow(App): |
|
|
def _set_bu(self, value): |
|
|
def _set_bu(self, value): |
|
|
assert value in base_units.keys() |
|
|
assert value in base_units.keys() |
|
|
self.electrum_config.set_key('base_unit', value, True) |
|
|
self.electrum_config.set_key('base_unit', value, True) |
|
|
self.update_status() |
|
|
self._trigger_update_status() |
|
|
if self.history_screen: |
|
|
self._trigger_update_history() |
|
|
self.history_screen.update() |
|
|
|
|
|
|
|
|
|
|
|
base_unit = AliasProperty(_get_bu, _set_bu) |
|
|
base_unit = AliasProperty(_get_bu, _set_bu) |
|
|
status = StringProperty('') |
|
|
status = StringProperty('') |
|
|
fiat_unit = StringProperty('') |
|
|
fiat_unit = StringProperty('') |
|
|
|
|
|
|
|
|
def on_fiat_unit(self, a, b): |
|
|
def on_fiat_unit(self, a, b): |
|
|
if self.history_screen: |
|
|
self._trigger_update_history() |
|
|
self.history_screen.update() |
|
|
|
|
|
|
|
|
|
|
|
def decimal_point(self): |
|
|
def decimal_point(self): |
|
|
return base_units[self.base_unit] |
|
|
return base_units[self.base_unit] |
|
@ -201,10 +201,9 @@ class ElectrumWindow(App): |
|
|
self.fx = self.daemon.fx |
|
|
self.fx = self.daemon.fx |
|
|
|
|
|
|
|
|
# create triggers so as to minimize updation a max of 2 times a sec |
|
|
# create triggers so as to minimize updation a max of 2 times a sec |
|
|
self._trigger_update_wallet =\ |
|
|
self._trigger_update_wallet = Clock.create_trigger(self.update_wallet, .5) |
|
|
Clock.create_trigger(self.update_wallet, .5) |
|
|
self._trigger_update_status = Clock.create_trigger(self.update_status, .5) |
|
|
self._trigger_update_status =\ |
|
|
self._trigger_update_history = Clock.create_trigger(self.update_history, .5) |
|
|
Clock.create_trigger(self.update_status, .5) |
|
|
|
|
|
# cached dialogs |
|
|
# cached dialogs |
|
|
self._settings_dialog = None |
|
|
self._settings_dialog = None |
|
|
self._password_dialog = None |
|
|
self._password_dialog = None |
|
@ -254,9 +253,6 @@ class ElectrumWindow(App): |
|
|
# show error |
|
|
# show error |
|
|
self.show_error("Unable to decode QR data") |
|
|
self.show_error("Unable to decode QR data") |
|
|
|
|
|
|
|
|
def update_history_tab(self): |
|
|
|
|
|
Clock.schedule_once(lambda dt: self.update_tab('history')) |
|
|
|
|
|
|
|
|
|
|
|
def update_tab(self, name): |
|
|
def update_tab(self, name): |
|
|
s = getattr(self, name + '_screen', None) |
|
|
s = getattr(self, name + '_screen', None) |
|
|
if s: |
|
|
if s: |
|
|