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:
@@ -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):
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user