mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-19 15:02:15 +01:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user