diff --git a/gui/qt/__init__.py b/gui/qt/__init__.py index bc73162f..7a0df082 100644 --- a/gui/qt/__init__.py +++ b/gui/qt/__init__.py @@ -228,7 +228,11 @@ class ElectrumGui: self.config.set_key('gui_last_wallet', path) # add to recently visited w.update_recently_visited(path) - w.show() + # initial configuration + if self.config.get('hide_gui') is True and self.tray.isVisible(): + w.hide() + else: + w.show() self.windows.append(w) self.build_tray_menu() self.plugins.on_new_window(w) @@ -251,20 +255,10 @@ class ElectrumGui: if os.path.exists(last_wallet): self.config.cmdline_options['default_wallet_path'] = last_wallet - # main window - self.main_window = self.start_new_window(self.config.get_wallet_path(), - self.config.get('url')) - if not self.main_window: + if not self.start_new_window(self.config.get_wallet_path(), + self.config.get('url')): return - # plugins interact with main window - run_hook('init_qt', self) - - # initial configuration - if self.config.get('hide_gui') is True and self.tray.isVisible(): - self.main_window.hide() - - signal.signal(signal.SIGINT, lambda *args: self.app.quit()) # main loop @@ -274,5 +268,4 @@ class ElectrumGui: event = QtCore.QEvent(QtCore.QEvent.Clipboard) self.app.sendEvent(self.app.clipboard(), event) - if self.tray: - self.tray.hide() + self.tray.hide() diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index b1f8ea49..e06d7e6a 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -2802,7 +2802,6 @@ class ElectrumWindow(QMainWindow): if self.qr_window: self.qr_window.close() self.close_wallet() - run_hook('close_main_window') self.gui_object.close_window(self) event.accept() diff --git a/lib/plugins.py b/lib/plugins.py index ee26b351..96857e76 100644 --- a/lib/plugins.py +++ b/lib/plugins.py @@ -149,9 +149,6 @@ def _run_hook(name, always, *args): for p, f in f_list: if name == 'load_wallet': p.wallet = args[0] - if name == 'init_qt': - gui = args[0] - p.window = gui.main_window if always or p.is_enabled(): try: r = f(*args)