mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
fix: add a new interface CanStartDirectly
and move this check to StartPopup
(#956)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
8ed7a99923
commit
9a36e652e6
3 changed files with 11 additions and 4 deletions
|
@ -59,6 +59,8 @@ namespace SourceGit.ViewModels
|
||||||
public void StartPopup(Popup popup)
|
public void StartPopup(Popup popup)
|
||||||
{
|
{
|
||||||
Popup = popup;
|
Popup = popup;
|
||||||
|
|
||||||
|
if (popup.CanStartDirectly())
|
||||||
ProcessPopup();
|
ProcessPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace SourceGit.ViewModels
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode")]
|
[UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2026:RequiresUnreferencedCode")]
|
||||||
public virtual bool Check()
|
public bool Check()
|
||||||
{
|
{
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
return false;
|
return false;
|
||||||
|
@ -37,6 +37,11 @@ namespace SourceGit.ViewModels
|
||||||
return !HasErrors;
|
return !HasErrors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual bool CanStartDirectly()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public virtual Task<bool> Sure()
|
public virtual Task<bool> Sure()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -152,9 +152,9 @@ namespace SourceGit.ViewModels
|
||||||
View = new Views.Push() { DataContext = this };
|
View = new Views.Push() { DataContext = this };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Check()
|
public override bool CanStartDirectly()
|
||||||
{
|
{
|
||||||
return base.Check() && !string.IsNullOrEmpty(_selectedRemoteBranch?.Head);
|
return !string.IsNullOrEmpty(_selectedRemoteBranch?.Head);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Task<bool> Sure()
|
public override Task<bool> Sure()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue