mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
code_review: PR #956
* Just use `Check` instead of a new one `AutoCheck` Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
2105fd450d
commit
8edd955370
3 changed files with 5 additions and 12 deletions
|
@ -59,17 +59,15 @@ namespace SourceGit.ViewModels
|
|||
public void StartPopup(Popup popup)
|
||||
{
|
||||
Popup = popup;
|
||||
ProcessPopup(true);
|
||||
ProcessPopup();
|
||||
}
|
||||
|
||||
public async void ProcessPopup(bool autoCheck = false)
|
||||
public async void ProcessPopup()
|
||||
{
|
||||
if (_popup != null)
|
||||
{
|
||||
if (!_popup.Check())
|
||||
return;
|
||||
if (autoCheck && !_popup.AutoCheck())
|
||||
return;
|
||||
|
||||
_popup.InProgress = true;
|
||||
var task = _popup.Sure();
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
|
||||
[UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode")]
|
||||
public bool Check()
|
||||
public virtual bool Check()
|
||||
{
|
||||
if (HasErrors)
|
||||
return false;
|
||||
|
@ -37,11 +37,6 @@ namespace SourceGit.ViewModels
|
|||
return !HasErrors;
|
||||
}
|
||||
|
||||
public virtual bool AutoCheck()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual Task<bool> Sure()
|
||||
{
|
||||
return null;
|
||||
|
|
|
@ -152,9 +152,9 @@ namespace SourceGit.ViewModels
|
|||
View = new Views.Push() { DataContext = this };
|
||||
}
|
||||
|
||||
public override bool AutoCheck()
|
||||
public override bool Check()
|
||||
{
|
||||
return !string.IsNullOrEmpty(_selectedRemoteBranch?.Head);
|
||||
return base.Check() && !string.IsNullOrEmpty(_selectedRemoteBranch?.Head);
|
||||
}
|
||||
|
||||
public override Task<bool> Sure()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue