optimize<Preference>: show a dialog to confirm restart request

This commit is contained in:
leo 2021-05-25 14:20:05 +08:00
parent 60584669f6
commit 0eae6f90af
3 changed files with 18 additions and 1 deletions

View file

@ -121,7 +121,18 @@ namespace SourceGit.Views {
useDarkTheme != general.UseDarkTheme ||
checkUpdate != general.CheckForUpdate ||
autoFetch != general.AutoFetchRemotes) {
App.Restart();
var result = MessageBox.Show(
this,
App.Text("Restart.Content"),
App.Text("Restart.Title"),
MessageBoxButton.OKCancel,
MessageBoxImage.Question,
MessageBoxResult.Cancel);
if (result == MessageBoxResult.OK) {
App.Restart();
} else {
Close();
}
} else {
Close();
}