|
|
@ -2846,6 +2846,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): |
|
|
|
|
|
|
|
# Fiat Currency |
|
|
|
hist_checkbox = QCheckBox() |
|
|
|
hist_capgains_checkbox = QCheckBox() |
|
|
|
fiat_address_checkbox = QCheckBox() |
|
|
|
ccy_combo = QComboBox() |
|
|
|
ex_combo = QComboBox() |
|
|
@ -2867,6 +2868,11 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): |
|
|
|
if not self.fx: return |
|
|
|
fiat_address_checkbox.setChecked(self.fx.get_fiat_address_config()) |
|
|
|
|
|
|
|
def update_history_capgains_cb(): |
|
|
|
if not self.fx: return |
|
|
|
hist_capgains_checkbox.setChecked(self.fx.get_history_capital_gains_config()) |
|
|
|
hist_capgains_checkbox.setEnabled(hist_checkbox.isChecked()) |
|
|
|
|
|
|
|
def update_exchanges(): |
|
|
|
if not self.fx: return |
|
|
|
b = self.fx.is_enabled() |
|
|
@ -2905,6 +2911,12 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): |
|
|
|
if self.fx.is_enabled() and checked: |
|
|
|
# reset timeout to get historical rates |
|
|
|
self.fx.timeout = 0 |
|
|
|
update_history_capgains_cb() |
|
|
|
|
|
|
|
def on_history_capgains(checked): |
|
|
|
if not self.fx: return |
|
|
|
self.fx.set_history_capital_gains_config(checked) |
|
|
|
self.history_list.refresh_headers() |
|
|
|
|
|
|
|
def on_fiat_address(checked): |
|
|
|
if not self.fx: return |
|
|
@ -2914,16 +2926,19 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): |
|
|
|
|
|
|
|
update_currencies() |
|
|
|
update_history_cb() |
|
|
|
update_history_capgains_cb() |
|
|
|
update_fiat_address_cb() |
|
|
|
update_exchanges() |
|
|
|
ccy_combo.currentIndexChanged.connect(on_currency) |
|
|
|
hist_checkbox.stateChanged.connect(on_history) |
|
|
|
hist_capgains_checkbox.stateChanged.connect(on_history_capgains) |
|
|
|
fiat_address_checkbox.stateChanged.connect(on_fiat_address) |
|
|
|
ex_combo.currentIndexChanged.connect(on_exchange) |
|
|
|
|
|
|
|
fiat_widgets = [] |
|
|
|
fiat_widgets.append((QLabel(_('Fiat currency')), ccy_combo)) |
|
|
|
fiat_widgets.append((QLabel(_('Show history rates')), hist_checkbox)) |
|
|
|
fiat_widgets.append((QLabel(_('Show capital gains in history')), hist_capgains_checkbox)) |
|
|
|
fiat_widgets.append((QLabel(_('Show Fiat balance for addresses')), fiat_address_checkbox)) |
|
|
|
fiat_widgets.append((QLabel(_('Source')), ex_combo)) |
|
|
|
|
|
|
|