Browse Source

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.
patch-4
SomberNight 4 years ago
parent
commit
1cd5235426
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 10
      electrum/gui/qt/__init__.py

10
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_()

Loading…
Cancel
Save