tcreated expand stub. doesn't work trying to spawn electrum gui (segfault) - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit 7fae935ca806fa0f88cfc7179cc2bbafccefabcf (DIR) parent 6c626ad12392d5839d1e807bafccb1d964b4dfb3 (HTM) Author: Amir Taaki <genjix@riseup.net> Date: Fri, 29 Jun 2012 07:06:42 +0200 created expand stub. doesn't work trying to spawn electrum gui (segfault) Diffstat: M lib/gui_lite.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) --- (DIR) diff --git a/lib/gui_lite.py b/lib/gui_lite.py t@@ -6,6 +6,11 @@ import random import re import sys +try: + import lib.gui_qt as gui_qt +except ImportError: + import electrum.gui_qt as gui_qt + def IconButton(filename, parent=None): pixmap = QPixmap(filename) icon = QIcon(pixmap) t@@ -20,14 +25,22 @@ class ElectrumGui: self.app.setStyleSheet(style_file.read()) def main(self, url): - actuator = MiniActuator(self.wallet) - mini = MiniWindow(actuator) - driver = MiniDriver(self.wallet, mini) + self.actuator = MiniActuator(self.wallet) + self.mini = MiniWindow(self.actuator, self.expand) + self.driver = MiniDriver(self.wallet, self.mini) sys.exit(self.app.exec_()) + def expand(self): + self.wallet.gui_callback = None + self.actuator = None + self.mini.close() + self.mini = None + self.driver = None + #self.gui = gui_qt.ElectrumGui(self.wallet) + class MiniWindow(QDialog): - def __init__(self, actuator): + def __init__(self, actuator, expand_callback): super(MiniWindow, self).__init__() self.actuator = actuator t@@ -55,6 +68,7 @@ class MiniWindow(QDialog): expand_button = IconButton("data/icons/expand.png") expand_button.setObjectName("expand_button") + self.connect(expand_button, SIGNAL("clicked()"), expand_callback) self.balance_label = BalanceLabel() self.balance_label.setObjectName("balance_label")