From 9641613bdb4423038f09fed7c4cc28b45c313fab Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 2 Apr 2021 17:44:07 +0800 Subject: [PATCH] feature: show waiting panel while commiting --- src/Resources/Locales/en_US.xaml | 1 + src/Resources/Locales/zh_CN.xaml | 1 + src/UI/WorkingCopy.xaml.cs | 8 +++++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Resources/Locales/en_US.xaml b/src/Resources/Locales/en_US.xaml index 09702b2e..376eae91 100644 --- a/src/Resources/Locales/en_US.xaml +++ b/src/Resources/Locales/en_US.xaml @@ -413,6 +413,7 @@ WAITING SUBMOUDLE UPDATE COMPLETE... WAITING STAGE COMPLETE... + WAITING COMMIT COMPLETE ... Git has NOT been configured.\nPlease to go [Preference] and configure it first. Path[{0}] not exists! diff --git a/src/Resources/Locales/zh_CN.xaml b/src/Resources/Locales/zh_CN.xaml index 83833b45..1abf5d71 100644 --- a/src/Resources/Locales/zh_CN.xaml +++ b/src/Resources/Locales/zh_CN.xaml @@ -413,6 +413,7 @@ 等待子模块更新完成... 等待暂存完成 ... + 等待提交完成 ... GIT尚未配置。请打开【偏好设置】配置GIT路径。 路径({0})不存在或不可读取! diff --git a/src/UI/WorkingCopy.xaml.cs b/src/UI/WorkingCopy.xaml.cs index e3adff24..41274d90 100644 --- a/src/UI/WorkingCopy.xaml.cs +++ b/src/UI/WorkingCopy.xaml.cs @@ -914,7 +914,7 @@ namespace SourceGit.UI { } } - private async void Commit(object sender, RoutedEventArgs e) { + private void Commit(object sender, RoutedEventArgs e) { foreach (var c in UnstagedListData) { if (c.IsConflit) { App.RaiseError("You have unsolved conflicts in your working copy!"); @@ -933,8 +933,10 @@ namespace SourceGit.UI { txtCommitMsg.GetBindingExpression(TextBox.TextProperty).UpdateSource(); if (Validation.GetHasError(txtCommitMsg)) return; - bool succ = await Task.Run(() => Repo.DoCommit(CommitMessage, amend)); - if (succ) ClearMessage(); + Waiting.Show(Repo, "Text.Waiting.Commit", () => { + bool succ = Repo.DoCommit(CommitMessage, amend); + if (succ) Dispatcher.Invoke(ClearMessage); + }); } private async void CommitAndPush(object sender, RoutedEventArgs e) {