From d2a80f15a189f0de605814a5a39f6cec7ef62681 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 13 May 2019 20:05:01 +0200 Subject: [PATCH] kivy fx dialog: fix #5329 --- electrum/gui/kivy/uix/dialogs/fx_dialog.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/electrum/gui/kivy/uix/dialogs/fx_dialog.py b/electrum/gui/kivy/uix/dialogs/fx_dialog.py index 502a60dff..4d4a99d5d 100644 --- a/electrum/gui/kivy/uix/dialogs/fx_dialog.py +++ b/electrum/gui/kivy/uix/dialogs/fx_dialog.py @@ -95,15 +95,20 @@ class FxDialog(Factory.Popup): self.add_currencies() def add_exchanges(self): + ex = self.ids.exchanges if self.fx.is_enabled(): exchanges = sorted(self.fx.get_exchanges_by_ccy(self.fx.get_currency(), self.has_history_rates)) mx = self.fx.exchange.name() + if mx in exchanges: + ex.text = mx + elif exchanges: + ex.text = exchanges[0] + else: + ex.text = '' else: exchanges = [] - mx = '' - ex = self.ids.exchanges + ex.text = '' ex.values = exchanges - ex.text = (mx if mx in exchanges else exchanges[0]) if self.fx.is_enabled() else '' def on_exchange(self, text): if not text: