From 3e43414d9cbb418cde17107e590668c0c5fcec59 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sat, 5 Jun 2021 14:21:31 -0700 Subject: [PATCH] Make the new package dialog modal. In the *new* package dialog, a package has been created and may have aircraft assigned to it, but it is not a part of the ATO until the user saves it. Other actions (modifying settings, closing some other dialogs like the base menu) can cause a Game update which will forcibly close this window without either accepting or rejecting it, so we neither save the package nor release any allocated units. While it would be preferable to be able to update this dialog as needed in the event of game updates, the quick fix is to just not allow interaction with other UI elements until the new package has either been finalized or canceled. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1027 --- qt_ui/windows/mission/QPackageDialog.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/qt_ui/windows/mission/QPackageDialog.py b/qt_ui/windows/mission/QPackageDialog.py index 32204745..19634847 100644 --- a/qt_ui/windows/mission/QPackageDialog.py +++ b/qt_ui/windows/mission/QPackageDialog.py @@ -221,6 +221,19 @@ class QNewPackageDialog(QPackageDialog): ) self.ato_model = model + # In the *new* package dialog, a package has been created and may have aircraft + # assigned to it, but it is not a part of the ATO until the user saves it. + # + # Other actions (modifying settings, closing some other dialogs like the base + # menu) can cause a Game update which will forcibly close this window without + # either accepting or rejecting it, so we neither save the package nor release + # any allocated units. + # + # While it would be preferable to be able to update this dialog as needed in the + # event of game updates, the quick fix is to just not allow interaction with + # other UI elements until the new package has either been finalized or canceled. + self.setModal(True) + self.save_button = QPushButton("Save") self.save_button.setProperty("style", "start-button") self.save_button.clicked.connect(self.accept)