App: Add option to restore database when a DB error occurs at startup
Test / Run tests (push) Successful in 2m12s
Test / Run tests (push) Successful in 2m12s
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user