Merge pull request #2621 from KoffeinFlummi/fiat-balance-addresses
Add optional Fiat balance column to addresses view
This commit is contained in:
@@ -200,6 +200,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||
def on_fx_history(self):
|
||||
self.history_list.refresh_headers()
|
||||
self.history_list.update()
|
||||
self.address_list.update()
|
||||
|
||||
def on_quotes(self, b):
|
||||
self.emit(SIGNAL('new_fx_quotes'))
|
||||
@@ -2350,6 +2351,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||
self.fiat_receive_e.setVisible(b)
|
||||
self.history_list.refresh_headers()
|
||||
self.history_list.update()
|
||||
self.address_list.update()
|
||||
self.update_status()
|
||||
|
||||
def settings_dialog(self):
|
||||
@@ -2615,6 +2617,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||
|
||||
# Fiat Currency
|
||||
hist_checkbox = QCheckBox()
|
||||
fiat_address_checkbox = QCheckBox()
|
||||
ccy_combo = QComboBox()
|
||||
ex_combo = QComboBox()
|
||||
|
||||
@@ -2631,6 +2634,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||
hist_checkbox.setChecked(self.fx.get_history_config())
|
||||
hist_checkbox.setEnabled(self.fx.is_enabled())
|
||||
|
||||
def update_fiat_address_cb():
|
||||
if not self.fx: return
|
||||
fiat_address_checkbox.setChecked(self.fx.get_fiat_address_config())
|
||||
|
||||
def update_exchanges():
|
||||
if not self.fx: return
|
||||
b = self.fx.is_enabled()
|
||||
@@ -2670,16 +2677,25 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||
# reset timeout to get historical rates
|
||||
self.fx.timeout = 0
|
||||
|
||||
def on_fiat_address(checked):
|
||||
if not self.fx: return
|
||||
self.fx.set_fiat_address_config(checked)
|
||||
self.address_list.refresh_headers()
|
||||
self.address_list.update()
|
||||
|
||||
update_currencies()
|
||||
update_history_cb()
|
||||
update_fiat_address_cb()
|
||||
update_exchanges()
|
||||
ccy_combo.currentIndexChanged.connect(on_currency)
|
||||
hist_checkbox.stateChanged.connect(on_history)
|
||||
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 Fiat balance for addresses')), fiat_address_checkbox))
|
||||
fiat_widgets.append((QLabel(_('Source')), ex_combo))
|
||||
|
||||
tabs_info = [
|
||||
|
||||
Reference in New Issue
Block a user