1
0

Do slow price discovery in another thread to speed up startup time and responsiveness.

This commit is contained in:
Amir Taaki
2012-07-02 22:39:45 +02:00
parent 9fd9f27408
commit bd489e998f
2 changed files with 30 additions and 15 deletions

View File

@@ -105,9 +105,10 @@ class MiniWindow(QDialog):
self.btc_balance = 0
self.quote_currencies = ("EUR", "USD", "GBP")
self.exchanger = exchange_rate.Exchanger(self.quote_currencies,
self.refresh_balance)
QTimer.singleShot(1000, self.exchanger.discovery)
self.exchanger = exchange_rate.Exchanger(self)
# Needed because price discovery is done in a different thread
# which needs to be sent back to this main one to update the GUI
self.connect(self, SIGNAL("refresh_balance()"), self.refresh_balance)
self.balance_label = BalanceLabel(self.change_quote_currency)
self.balance_label.setObjectName("balance_label")