bugfix for "QObject: Cannot create children for a parent that is in a different thread."
This commit is contained in:
parent
d825578099
commit
9c0bb13366
|
@ -50,10 +50,6 @@ class MiniWindow(QDialog):
|
||||||
expand_button.setObjectName("expand_button")
|
expand_button.setObjectName("expand_button")
|
||||||
|
|
||||||
self.balance_label = BalanceLabel()
|
self.balance_label = BalanceLabel()
|
||||||
# WTF?!
|
|
||||||
# TODO: Fix this!
|
|
||||||
import time
|
|
||||||
time.sleep(0.1)
|
|
||||||
self.balance_label.setObjectName("balance_label")
|
self.balance_label.setObjectName("balance_label")
|
||||||
|
|
||||||
copy_button = QPushButton(_("&Copy Address"))
|
copy_button = QPushButton(_("&Copy Address"))
|
||||||
|
@ -252,7 +248,7 @@ class MiniActuator:
|
||||||
def is_valid(self, address):
|
def is_valid(self, address):
|
||||||
return self.wallet.is_valid(address)
|
return self.wallet.is_valid(address)
|
||||||
|
|
||||||
class MiniDriver:
|
class MiniDriver(QObject):
|
||||||
|
|
||||||
INITIALIZING = 0
|
INITIALIZING = 0
|
||||||
CONNECTING = 1
|
CONNECTING = 1
|
||||||
|
@ -260,13 +256,23 @@ class MiniDriver:
|
||||||
READY = 3
|
READY = 3
|
||||||
|
|
||||||
def __init__(self, wallet, window):
|
def __init__(self, wallet, window):
|
||||||
|
super(QObject, self).__init__()
|
||||||
|
|
||||||
self.wallet = wallet
|
self.wallet = wallet
|
||||||
self.window = window
|
self.window = window
|
||||||
|
|
||||||
self.wallet.gui_callback = self.update
|
self.wallet.gui_callback = self.update_callback
|
||||||
|
|
||||||
self.state = None
|
self.state = None
|
||||||
self.update()
|
|
||||||
|
self.initializing()
|
||||||
|
self.connect(self, SIGNAL("updatesignal"), self.update)
|
||||||
|
|
||||||
|
# This is a hack to workaround that Qt does not like changing the
|
||||||
|
# window properties from this other thread before the runloop has
|
||||||
|
# been called from.
|
||||||
|
def update_callback(self):
|
||||||
|
self.emit(SIGNAL("updatesignal"))
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
if not self.wallet.interface:
|
if not self.wallet.interface:
|
||||||
|
|
Loading…
Reference in New Issue