enhance: disable CONTINUE button while it is running (#1046)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-03-04 09:29:07 +08:00
parent 35ee4a47db
commit d4bcc60113
No known key found for this signature in database
2 changed files with 14 additions and 1 deletions

View file

@ -440,6 +440,8 @@ namespace SourceGit.ViewModels
public void ContinueMerge() public void ContinueMerge()
{ {
IsCommitting = true;
if (_inProgressContext != null) if (_inProgressContext != null)
{ {
_repo.SetWatcherEnabled(false); _repo.SetWatcherEnabled(false);
@ -456,17 +458,21 @@ namespace SourceGit.ViewModels
CommitMessage = string.Empty; CommitMessage = string.Empty;
_repo.SetWatcherEnabled(true); _repo.SetWatcherEnabled(true);
IsCommitting = false;
}); });
}); });
} }
else else
{ {
_repo.MarkWorkingCopyDirtyManually(); _repo.MarkWorkingCopyDirtyManually();
IsCommitting = false;
} }
} }
public void SkipMerge() public void SkipMerge()
{ {
IsCommitting = true;
if (_inProgressContext != null) if (_inProgressContext != null)
{ {
_repo.SetWatcherEnabled(false); _repo.SetWatcherEnabled(false);
@ -479,17 +485,21 @@ namespace SourceGit.ViewModels
CommitMessage = string.Empty; CommitMessage = string.Empty;
_repo.SetWatcherEnabled(true); _repo.SetWatcherEnabled(true);
IsCommitting = false;
}); });
}); });
} }
else else
{ {
_repo.MarkWorkingCopyDirtyManually(); _repo.MarkWorkingCopyDirtyManually();
IsCommitting = false;
} }
} }
public void AbortMerge() public void AbortMerge()
{ {
IsCommitting = true;
if (_inProgressContext != null) if (_inProgressContext != null)
{ {
_repo.SetWatcherEnabled(false); _repo.SetWatcherEnabled(false);
@ -502,12 +512,14 @@ namespace SourceGit.ViewModels
CommitMessage = string.Empty; CommitMessage = string.Empty;
_repo.SetWatcherEnabled(true); _repo.SetWatcherEnabled(true);
IsCommitting = false;
}); });
}); });
} }
else else
{ {
_repo.MarkWorkingCopyDirtyManually(); _repo.MarkWorkingCopyDirtyManually();
IsCommitting = false;
} }
} }

View file

@ -397,7 +397,8 @@
Width="0" Height="0" Width="0" Height="0"
Background="Transparent" Background="Transparent"
Command="{Binding CommitWithAutoStage}" Command="{Binding CommitWithAutoStage}"
HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"/> HotKey="{OnPlatform Ctrl+Shift+Enter, macOS=⌘+Shift+Enter}"
IsEnabled="{Binding !IsCommitting}"/>
<Button Grid.Column="8" <Button Grid.Column="8"
Classes="flat" Classes="flat"