|
|
|
@ -307,7 +307,7 @@ class SettingsDialog(QDialog, QtEventListener): |
|
|
|
def update_currencies(): |
|
|
|
def update_currencies(): |
|
|
|
if not self.fx: |
|
|
|
if not self.fx: |
|
|
|
return |
|
|
|
return |
|
|
|
h = self.config.get('history_rates', False) |
|
|
|
h = bool(self.config.get('history_rates', False)) |
|
|
|
currencies = sorted(self.fx.get_currencies(h)) |
|
|
|
currencies = sorted(self.fx.get_currencies(h)) |
|
|
|
ccy_combo.clear() |
|
|
|
ccy_combo.clear() |
|
|
|
ccy_combo.addItems([_('None')] + currencies) |
|
|
|
ccy_combo.addItems([_('None')] + currencies) |
|
|
|
@ -319,7 +319,7 @@ class SettingsDialog(QDialog, QtEventListener): |
|
|
|
b = self.fx.is_enabled() |
|
|
|
b = self.fx.is_enabled() |
|
|
|
ex_combo.setEnabled(b) |
|
|
|
ex_combo.setEnabled(b) |
|
|
|
if b: |
|
|
|
if b: |
|
|
|
h = self.config.get('history_rates', False) |
|
|
|
h = bool(self.config.get('history_rates', False)) |
|
|
|
c = self.fx.get_currency() |
|
|
|
c = self.fx.get_currency() |
|
|
|
exchanges = self.fx.get_exchanges_by_ccy(c, h) |
|
|
|
exchanges = self.fx.get_exchanges_by_ccy(c, h) |
|
|
|
else: |
|
|
|
else: |
|
|
|
@ -356,7 +356,7 @@ class SettingsDialog(QDialog, QtEventListener): |
|
|
|
update_currencies() |
|
|
|
update_currencies() |
|
|
|
update_exchanges() |
|
|
|
update_exchanges() |
|
|
|
ccy_combo.currentIndexChanged.connect(on_currency) |
|
|
|
ccy_combo.currentIndexChanged.connect(on_currency) |
|
|
|
self.history_rates_cb.setChecked(self.config.get('history_rates', False)) |
|
|
|
self.history_rates_cb.setChecked(bool(self.config.get('history_rates', False))) |
|
|
|
self.history_rates_cb.stateChanged.connect(on_history_rates) |
|
|
|
self.history_rates_cb.stateChanged.connect(on_history_rates) |
|
|
|
ex_combo.currentIndexChanged.connect(on_exchange) |
|
|
|
ex_combo.currentIndexChanged.connect(on_exchange) |
|
|
|
|
|
|
|
|
|
|
|
|