Implement manual squadron transfers.

Lightly tested but seems to work fine.

https://github.com/dcs-liberation/dcs_liberation/issues/1145
This commit is contained in:
Dan Albert
2021-08-28 18:09:33 -07:00
parent cd15de6d42
commit c2e5cba061
7 changed files with 148 additions and 43 deletions

17
qt_ui/errorreporter.py Normal file
View File

@@ -0,0 +1,17 @@
import logging
from collections import Iterator
from contextlib import contextmanager
from typing import Type
from PySide2.QtWidgets import QDialog, QMessageBox
@contextmanager
def report_errors(
title: str, parent: QDialog, error_type: Type[Exception] = Exception
) -> Iterator[None]:
try:
yield
except error_type as ex:
logging.exception(title)
QMessageBox().critical(parent, title, str(ex), QMessageBox.Ok)