fix(start): unsaved settings let go rather than started without, a failed save starts nothing

- the second answer discards the edits (as "Restore" does): kept, the starter would write
  them when it closes, with auto-close while the simulator reads the file
- a save that fails is said and the simulator is not started
- settings read again from a file changed outside leave the page with no edit of its own
- a closed tape window lets go of the file it read last, shown or not
This commit is contained in:
maj00r
2026-11-16 00:16:13 +01:00
parent b63ba8fe2e
commit 5b43e29f9e
8 changed files with 39 additions and 17 deletions

View File

@@ -316,7 +316,13 @@ public partial class Settings : UserControl, ISettingsCapture
SelectExeCb.SelectedIndex = index;
}
public void ReloadFromSettings() => ApplyToUi();
/// <summary>The settings read again from the file: the page shows them, no edit of its own left.</summary>
public void ReloadFromSettings()
{
ApplyToUi();
_dirty = false;
UpdateSaveState();
}
/// <summary>
/// True while a cab-control binding is waiting for a keypress. The window's own
@@ -1145,7 +1151,10 @@ public partial class Settings : UserControl, ISettingsCapture
ThumbnailSizeChanged?.Invoke();
}
private void ResetButton_OnClick(object? sender, RoutedEventArgs e)
private void ResetButton_OnClick(object? sender, RoutedEventArgs e) => DiscardChanges();
/// <summary>The edits not saved let go, the page and the keys as the files have them: "Przywróć".</summary>
public void DiscardChanges()
{
AppServices.Current.SettingsStore.Load();
ApplyToUi();