From 05367dc1de0ad099897df359f3f5b75e2a239f71 Mon Sep 17 00:00:00 2001 From: SGCMarkus Date: Mon, 4 Mar 2024 12:44:31 +0100 Subject: [PATCH] astrodatagui: close all database connections properly before exiting --- astrodatagui/AstrodataGUI.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/astrodatagui/AstrodataGUI.py b/astrodatagui/AstrodataGUI.py index a490d34..6d9fac0 100644 --- a/astrodatagui/AstrodataGUI.py +++ b/astrodatagui/AstrodataGUI.py @@ -11,6 +11,9 @@ class AstrodataGUI(QtWidgets.QMainWindow): classFileDir = os.path.dirname(os.path.abspath(__file__)) absUiFilePath = os.path.join(classFileDir, "astrodatagui.ui") uic.loadUi(absUiFilePath, self) + + self.actionExit.triggered.connect(self.actionExitTriggered) + self.show() self.loadDB() @@ -25,4 +28,10 @@ class AstrodataGUI(QtWidgets.QMainWindow): def showErrorMessage(self, title: str, msg: str): print(title) - print(msg) \ No newline at end of file + print(msg) + + def actionExitTriggered(self): + for starDB in StarDB.getAllInstances(): + starDB.close() + + exit() \ No newline at end of file