From 1cd5235426dc5640c825a8b5cffa3188498eedab Mon Sep 17 00:00:00 2001 From: SomberNight Date: Sun, 4 Apr 2021 01:05:23 +0200 Subject: [PATCH] qt init: rm gui.close() method There is gui.stop() already, which does the same thing (which is shared API with kivy). Also, the _cleanup_before_exit() call was redundant in close(), aboutToQuit handles that. --- electrum/gui/qt/__init__.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/electrum/gui/qt/__init__.py b/electrum/gui/qt/__init__.py index 695dd22d2..f3907270e 100644 --- a/electrum/gui/qt/__init__.py +++ b/electrum/gui/qt/__init__.py @@ -180,7 +180,7 @@ class ElectrumGui(Logger): submenu.addAction(_("Close"), window.close) m.addAction(_("Dark/Light"), self.toggle_tray_icon) m.addSeparator() - m.addAction(_("Exit Electrum"), self.close) + m.addAction(_("Exit Electrum"), self.app.quit) def tray_icon(self): if self.dark_icon: @@ -236,10 +236,6 @@ class ElectrumGui(Logger): self.tray.deleteLater() self.tray = None - def close(self): - self._cleanup_before_exit() - self.app.quit() - def _maybe_quit_if_no_windows_open(self) -> None: """Check if there are any open windows and decide whether we should quit.""" # keep daemon running after close @@ -416,9 +412,7 @@ class ElectrumGui(Logger): self.app.setQuitOnLastWindowClosed(False) # so _we_ can decide whether to quit self.app.lastWindowClosed.connect(self._maybe_quit_if_no_windows_open) - def clean_up(): - self._cleanup_before_exit() - self.app.aboutToQuit.connect(clean_up) + self.app.aboutToQuit.connect(self._cleanup_before_exit) # main loop self.app.exec_()