App: Add option to restore database when a DB error occurs at startup
Test / Run tests (push) Successful in 2m12s

This commit is contained in:
2026-08-26 12:01:03 +02:00
parent c1690bf104
commit cadac4302d
5 changed files with 81 additions and 30 deletions
+1 -18
View File
@@ -182,24 +182,7 @@ namespace Elwig.Windows {
}
private async void Menu_Database_Restore_Click(object sender, RoutedEventArgs evt) {
try {
var d = new OpenFileDialog() {
Title = "Datenbank wiederherstellen - Elwig",
DefaultDirectory = App.Config.BackupPath,
InitialDirectory = App.Config.BackupPath,
DefaultExt = "sql.zip",
Filter = "SQLite-Datenbank (*.sqlite3, *.sqlite3.zip, *.sql, *.sql.zip)|*.sqlite3;*.sqlite3.zip;*.sql;*.sql.zip",
};
if (d.ShowDialog() == true) {
if (!InteractionService.AskContinue("Datenbank wiederherstellen", "Soll die Datenbank wirklich unwiederruflich durch die wiederhergestellte Version ersetzt werden?"))
return;
Mouse.OverrideCursor = Cursors.Wait;
await App.ReplaceDatabase(d.FileName);
}
} catch (Exception exc) {
InteractionService.ShowException(exc);
}
Mouse.OverrideCursor = null;
await BackupService.RestoreDatabase();
}
private async void SyncButton_Click(object sender, RoutedEventArgs evt) {