Skip to content

Commit 03e4412

Browse files
author
Michael Whapples
committed
More explicit handling of quit.
1 parent 5e65591 commit 03e4412

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/convert2ebrl/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ def run_app(args: Sequence[str]):
3737
app.setOrganizationDomain("aph.org")
3838
app.setApplicationName("Convert2EBRL")
3939
app.setApplicationVersion(version(__package__))
40+
app.setQuitOnLastWindowClosed(False)
4041
log_path = QStandardPaths.writableLocation(QStandardPaths.StandardLocation.AppLocalDataLocation)
4142
os.makedirs(log_path, exist_ok=True)
4243
logging.basicConfig(
4344
level=logging.INFO, format="%(levelname)s:%(asctime)s:%(module)s:%(message)s", filename=os.path.join(log_path, "convert2ebrl.log")
4445
)
46+
logging.info(f"sys.argv[0]={sys.argv[0]} and PySide app={app.applicationFilePath()}")
4547
logging.debug(f"Executable hash: {get_file_hash(sys.argv[0])}")
4648
release_build = check_release(sys.argv[0])
4749
logging.info(f"Release build: {release_build}")

src/convert2ebrl/main_window.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from PySide6.QtCore import QUrl
99
from PySide6.QtGui import QAction, QDesktopServices
10-
from PySide6.QtWidgets import QMainWindow, QMessageBox
10+
from PySide6.QtWidgets import QMainWindow, QMessageBox, QApplication
1111

1212
from convert2ebrl.brf_to_ebrf import Brf2EbrfWidget
1313
from convert2ebrl.update_checker import UpdateChecker
@@ -33,3 +33,6 @@ def on_update_available(v):
3333
menu = self.menuBar()
3434
help_menu = menu.addMenu("&Help")
3535
help_menu.addAction(update_check_action)
36+
def closeEvent(self, event, /):
37+
super().closeEvent(event)
38+
QApplication.quit()

0 commit comments

Comments
 (0)