1
0

close wallet when window is closed

This commit is contained in:
ThomasV
2015-09-01 09:35:32 +02:00
parent f84d873f62
commit bbe64621ca
2 changed files with 9 additions and 7 deletions

View File

@@ -69,7 +69,7 @@ class ElectrumGui:
set_language(config.get('language'))
self.network = network
self.config = config
self.windows = {}
self.windows = []
self.efilter = OpenFileEventFilter(self.windows)
self.app = QApplication(sys.argv)
self.app.installEventFilter(self.efilter)
@@ -111,14 +111,16 @@ class ElectrumGui:
def start_new_window(self, config):
path = config.get_wallet_path()
if path not in self.windows:
for w in self.windows:
if w.config.get_wallet_path() == path:
break
else:
w = ElectrumWindow(config, self.network, self)
w.connect_slots(self.timer)
w.load_wallet_file(path)
w.show()
self.windows[path] = w
self.windows.append(w)
w = self.windows[path]
url = config.get('url')
if url:
w.pay_to_URI(url)
@@ -162,8 +164,5 @@ class ElectrumGui:
event = QtCore.QEvent(QtCore.QEvent.Clipboard)
self.app.sendEvent(self.app.clipboard(), event)
for window in self.windows.values():
window.close_wallet()
if self.tray:
self.tray.hide()