kivy: fix fx history rates
This commit is contained in:
@@ -89,12 +89,9 @@ class FxDialog(Factory.Popup):
|
|||||||
self.config = config
|
self.config = config
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
self.fx = self.app.fx
|
self.fx = self.app.fx
|
||||||
if self.fx.get_history_config(allow_none=True) is None:
|
if not self.fx.config.cv.FX_HISTORY_RATES.is_set():
|
||||||
# If nothing is set, force-enable it. (Note that as fiat rates itself
|
self.fx.config.FX_HISTORY_RATES = True # override default
|
||||||
# are disabled by default, it is enough to set this here. If they
|
self.has_history_rates = self.fx.config.FX_HISTORY_RATES
|
||||||
# were enabled by default, this would be too late.)
|
|
||||||
self.fx.set_history_config(True)
|
|
||||||
self.has_history_rates = self.fx.get_history_config()
|
|
||||||
|
|
||||||
Factory.Popup.__init__(self)
|
Factory.Popup.__init__(self)
|
||||||
self.add_currencies()
|
self.add_currencies()
|
||||||
@@ -128,7 +125,7 @@ class FxDialog(Factory.Popup):
|
|||||||
self.ids.ccy.text = my_ccy
|
self.ids.ccy.text = my_ccy
|
||||||
|
|
||||||
def on_checkbox_history(self, checked):
|
def on_checkbox_history(self, checked):
|
||||||
self.fx.set_history_config(checked)
|
self.fx.config.FX_HISTORY_RATES = bool(checked)
|
||||||
self.has_history_rates = checked
|
self.has_history_rates = checked
|
||||||
self.add_currencies()
|
self.add_currencies()
|
||||||
self.on_currency(self.ids.ccy.text)
|
self.on_currency(self.ids.ccy.text)
|
||||||
|
|||||||
Reference in New Issue
Block a user