astrodatagui: close all database connections properly before exiting
This commit is contained in:
@@ -11,6 +11,9 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
|||||||
classFileDir = os.path.dirname(os.path.abspath(__file__))
|
classFileDir = os.path.dirname(os.path.abspath(__file__))
|
||||||
absUiFilePath = os.path.join(classFileDir, "astrodatagui.ui")
|
absUiFilePath = os.path.join(classFileDir, "astrodatagui.ui")
|
||||||
uic.loadUi(absUiFilePath, self)
|
uic.loadUi(absUiFilePath, self)
|
||||||
|
|
||||||
|
self.actionExit.triggered.connect(self.actionExitTriggered)
|
||||||
|
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
self.loadDB()
|
self.loadDB()
|
||||||
@@ -26,3 +29,9 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
|||||||
def showErrorMessage(self, title: str, msg: str):
|
def showErrorMessage(self, title: str, msg: str):
|
||||||
print(title)
|
print(title)
|
||||||
print(msg)
|
print(msg)
|
||||||
|
|
||||||
|
def actionExitTriggered(self):
|
||||||
|
for starDB in StarDB.getAllInstances():
|
||||||
|
starDB.close()
|
||||||
|
|
||||||
|
exit()
|
||||||
Reference in New Issue
Block a user