Ensured, that last minute changes are written to disk
This commit is contained in:
3 files changed
+36
-6
No files matched your search
@@ -50,12 +50,6 @@ public sealed partial class Translation : UserControl
|
||||
}
|
||||
}
|
||||
|
||||
private async void SaveChanges(object? sender, ElapsedEventArgs e)
|
||||
{
|
||||
if (this.currentTranslationId > -1)
|
||||
await TranslationProcessor.SaveChangedTranslation(this.currentTranslationId, this.textBox.Text);
|
||||
}
|
||||
|
||||
public async Task Configure(DataModel.Database.Translation translation)
|
||||
{
|
||||
this.isLoading = true;
|
||||
@@ -78,5 +72,16 @@ public sealed partial class Translation : UserControl
|
||||
this.saveTimer.Stop();
|
||||
|
||||
this.saveTimer.Start();
|
||||
if(this.ParentForm is UI_WinForms.Main main)
|
||||
main.AddDeferredSaveOperation(this.currentTranslationId, () => this.SaveChanges(null, null));
|
||||
}
|
||||
|
||||
private async void SaveChanges(object? sender, ElapsedEventArgs e)
|
||||
{
|
||||
if (this.currentTranslationId > -1)
|
||||
await TranslationProcessor.SaveChangedTranslation(this.currentTranslationId, this.textBox.Text);
|
||||
|
||||
if(this.ParentForm is UI_WinForms.Main main)
|
||||
main.RemoveDeferredSaveOperation(this.currentTranslationId);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user