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

@ -415,6 +415,9 @@
<sys:String x:Key="Text.Conflict.Revert">Revert merge request detected! Press 'Abort' to restore original HEAD</sys:String> <sys:String x:Key="Text.Conflict.Revert">Revert merge request detected! Press 'Abort' to restore original HEAD</sys:String>
<sys:String x:Key="Text.Conflict.Merge">Merge request detected! Press 'Abort' to restore original HEAD</sys:String> <sys:String x:Key="Text.Conflict.Merge">Merge request detected! Press 'Abort' to restore original HEAD</sys:String>
<sys:String x:Key="Text.Restart.Title">NOTICE</sys:String>
<sys:String x:Key="Text.Restart.Content">Restart required to apply changes in preference. Restart now?</sys:String>
<sys:String x:Key="Text.NotConfigured">Git has NOT been configured.\nPlease to go [Preference] and configure it first.</sys:String> <sys:String x:Key="Text.NotConfigured">Git has NOT been configured.\nPlease to go [Preference] and configure it first.</sys:String>
<sys:String x:Key="Text.PathNotFound">Path[{0}] not exists!</sys:String> <sys:String x:Key="Text.PathNotFound">Path[{0}] not exists!</sys:String>
<sys:String x:Key="Text.MissingBash">Can NOT locate bash.exe. Make sure bash.exe exists under the same folder with git.exe</sys:String> <sys:String x:Key="Text.MissingBash">Can NOT locate bash.exe. Make sure bash.exe exists under the same folder with git.exe</sys:String>

View file

@ -415,6 +415,9 @@
<sys:String x:Key="Text.Conflict.Revert">检测到回滚提交冲突!</sys:String> <sys:String x:Key="Text.Conflict.Revert">检测到回滚提交冲突!</sys:String>
<sys:String x:Key="Text.Conflict.Merge">检测到分支合并冲突!</sys:String> <sys:String x:Key="Text.Conflict.Merge">检测到分支合并冲突!</sys:String>
<sys:String x:Key="Text.Restart.Title">系统提示</sys:String>
<sys:String x:Key="Text.Restart.Content">本次配置变更需要在重启后生效,是否立即重启?</sys:String>
<sys:String x:Key="Text.NotConfigured">GIT尚未配置。请打开【偏好设置】配置GIT路径。</sys:String> <sys:String x:Key="Text.NotConfigured">GIT尚未配置。请打开【偏好设置】配置GIT路径。</sys:String>
<sys:String x:Key="Text.PathNotFound">路径({0})不存在或不可读取!</sys:String> <sys:String x:Key="Text.PathNotFound">路径({0})不存在或不可读取!</sys:String>
<sys:String x:Key="Text.MissingBash">无法找到bash.exe请确保其在git.exe同目录中</sys:String> <sys:String x:Key="Text.MissingBash">无法找到bash.exe请确保其在git.exe同目录中</sys:String>

View file

@ -121,7 +121,18 @@ namespace SourceGit.Views {
useDarkTheme != general.UseDarkTheme || useDarkTheme != general.UseDarkTheme ||
checkUpdate != general.CheckForUpdate || checkUpdate != general.CheckForUpdate ||
autoFetch != general.AutoFetchRemotes) { 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 { } else {
Close(); Close();
} }