1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Handle OS termination signals. (#425)

* Handle OS termination signals.

* Added comment about why a timer is required to handle OS signals.
This commit is contained in:
Jocelyn Le Sage
2017-06-20 12:04:38 -04:00
committed by Virgil Dupras
parent 8861f6296e
commit 84011fb46d
2 changed files with 33 additions and 0 deletions

View File

@@ -68,6 +68,8 @@ class DupeGuru(QObject):
self.directories_dialog.show()
self.model.load()
self.SIGTERM.connect(self.handleSIGTERM)
# The timer scheme is because if the nag is not shown before the application is
# completely initialized, the nag will be shown before the app shows up in the task bar
# In some circumstances, the nag is hidden by other window, which may make the user think
@@ -166,6 +168,7 @@ class DupeGuru(QObject):
#--- Signals
willSavePrefs = pyqtSignal()
SIGTERM = pyqtSignal()
#--- Events
def finishedLaunching(self):
@@ -216,6 +219,9 @@ class DupeGuru(QObject):
url = QUrl('https://www.hardcoded.net/dupeguru/help/en/')
QDesktopServices.openUrl(url)
def handleSIGTERM(self):
self.shutdown()
#--- model --> view
def get_default(self, key):
return self.prefs.get_value(key)