summaryrefslogtreecommitdiff
path: root/src/frontend/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/gui')
-rw-r--r--src/frontend/gui/sisyphus-qt5.py5
-rw-r--r--src/frontend/gui/sisyphus-qt6.py5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/frontend/gui/sisyphus-qt5.py b/src/frontend/gui/sisyphus-qt5.py
index 16c473c..939feae 100644
--- a/src/frontend/gui/sisyphus-qt5.py
+++ b/src/frontend/gui/sisyphus-qt5.py
@@ -2,6 +2,7 @@
import sys
import sqlite3
+import signal
import sisyphus
from collections import OrderedDict
from PyQt5 import QtCore, QtGui, QtWidgets, uic
@@ -11,6 +12,7 @@ class Sisyphus(QtWidgets.QMainWindow):
def __init__(self):
super(Sisyphus, self).__init__()
uic.loadUi('/usr/share/sisyphus/ui/sisyphus.ui', self)
+ signal.signal(signal.SIGTERM, self.handleSigterm)
self.centerOnScreen()
self.show()
@@ -285,6 +287,9 @@ class Sisyphus(QtWidgets.QMainWindow):
def sisyphusExit(self):
self.close()
+ def handleSigterm(self, signum, frame):
+ self.close()
+
def __del__(self):
sys.stdout = sys.__stdout__ # restore stdout
diff --git a/src/frontend/gui/sisyphus-qt6.py b/src/frontend/gui/sisyphus-qt6.py
index 181fa64..ace6c8b 100644
--- a/src/frontend/gui/sisyphus-qt6.py
+++ b/src/frontend/gui/sisyphus-qt6.py
@@ -2,6 +2,7 @@
import sys
import sqlite3
+import signal
import sisyphus
from collections import OrderedDict
from PyQt6 import QtCore, QtGui, QtWidgets, uic
@@ -11,6 +12,7 @@ class Sisyphus(QtWidgets.QMainWindow):
def __init__(self):
super(Sisyphus, self).__init__()
uic.loadUi('/usr/share/sisyphus/ui/sisyphus.ui', self)
+ signal.signal(signal.SIGTERM, self.handleSigterm)
self.centerOnScreen()
self.show()
@@ -285,6 +287,9 @@ class Sisyphus(QtWidgets.QMainWindow):
def sisyphusExit(self):
self.close()
+ def handleSigterm(self, signum, frame):
+ self.close()
+
def __del__(self):
sys.stdout = sys.__stdout__ # restore stdout