astrodatagui: ask before closing in all occasions
This commit is contained in:
@@ -30,8 +30,16 @@ class AstrodataGUI(QtWidgets.QMainWindow):
|
|||||||
print(title)
|
print(title)
|
||||||
print(msg)
|
print(msg)
|
||||||
|
|
||||||
|
def closeEvent(self, event):
|
||||||
|
confirmation = QtWidgets.QMessageBox.question(self, "Confirmation", "Are you sure you want to close the application?",
|
||||||
|
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
||||||
|
if confirmation == QtWidgets.QMessageBox.Yes:
|
||||||
|
event.accept() # Close the app
|
||||||
|
else:
|
||||||
|
event.ignore() # Don't close the app
|
||||||
|
|
||||||
def actionExitTriggered(self):
|
def actionExitTriggered(self):
|
||||||
for starDB in StarDB.getAllInstances():
|
for starDB in StarDB.getAllInstances():
|
||||||
starDB.close()
|
starDB.close()
|
||||||
|
|
||||||
exit()
|
self.close()
|
||||||
Reference in New Issue
Block a user