1
0

Cleaned up Exchange Rate plugin: more efficient code and more intuitive names for the get fiat balance/price procedures. Created new procedure used for updating the fiat balance & price on the status panel. Enhancement: status panel on bottom left now shows the current BTC price (eg, 1 BTC~573.45 USD).

This commit is contained in:
Darrin Daigle
2014-03-27 15:30:24 -05:00
parent f1cc259b75
commit 9fb7fd5803
3 changed files with 37 additions and 19 deletions

View File

@@ -437,7 +437,7 @@ class MiniWindow(QDialog):
user has in bitcoins."""
from electrum.plugins import run_hook
r = {}
run_hook('set_quote_text', btc_balance, r)
run_hook('get_fiat_balance_text', btc_balance, r)
return r.get(0,'')
def send(self):

View File

@@ -490,11 +490,12 @@ class ElectrumWindow(QMainWindow):
text = _( "Balance" ) + ": %s "%( self.format_amount(c) ) + self.base_unit()
if u: text += " [%s unconfirmed]"%( self.format_amount(u,True).strip() )
# append fiat balance and price from exchange rate plugin
r = {}
run_hook('set_quote_text', c+u, r)
run_hook('get_fiat_status_text', c+u, r)
quote = r.get(0)
if quote:
text += " (%s)"%quote
text += "%s"%quote
self.tray.setToolTip(text)
icon = QIcon(":icons/status_connected.png")