mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix airwing config not properly saving or loading (#437)
* fix airwing config not properly saving or loading * add helper message to save function * bugfixes * remove unnecessary import used during testing * yet another forgotten import * change raise error to log warning
This commit is contained in:
@@ -817,12 +817,25 @@ class AirWingConfigurationDialog(QDialog):
|
||||
layout.addLayout(buttons_layout)
|
||||
|
||||
def save_config(self) -> None:
|
||||
result = QMessageBox.information(
|
||||
None,
|
||||
"Save Air Wing?",
|
||||
"Revert will not be possible after saving a different Air Wing.<br />"
|
||||
"Are you sure you want to continue?",
|
||||
QMessageBox.StandardButton.Yes,
|
||||
QMessageBox.StandardButton.No,
|
||||
)
|
||||
if result == QMessageBox.StandardButton.No:
|
||||
return
|
||||
|
||||
awd = airwing_dir()
|
||||
fd = QFileDialog(
|
||||
caption="Save Air Wing", directory=str(awd), filter="*.yaml;*.yml"
|
||||
)
|
||||
fd.setAcceptMode(QFileDialog.AcceptMode.AcceptSave)
|
||||
if fd.exec_():
|
||||
for tab in self.tabs:
|
||||
tab.apply()
|
||||
airwing = self._build_air_wing()
|
||||
filename = fd.selectedFiles()[0]
|
||||
with open(filename, "w") as f:
|
||||
@@ -836,7 +849,7 @@ class AirWingConfigurationDialog(QDialog):
|
||||
for s in sqs:
|
||||
cp = s.location.at
|
||||
if isinstance(cp, Point):
|
||||
key = s.location.name
|
||||
key = s.location.full_name
|
||||
else:
|
||||
key = cp.id
|
||||
name = (
|
||||
|
||||
Reference in New Issue
Block a user