code_review: PR #1412

- Use `ViewModels.StashesPage.SelectedStash` instead of `sender is not ListBox { SelectedValue: Models.Stash stash }`
- In tags view, `SelectedItem` can be `Models.Tag` or `ViewModels.TagTreeNode`
- In logs window, `vm.SelectedLog` may be null

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-06-11 16:13:47 +08:00
parent 196b454ae8
commit a128b67bd4
10 changed files with 56 additions and 70 deletions

View File

@@ -1365,12 +1365,6 @@ namespace SourceGit.ViewModels
ShowPopup(new DeleteBranch(this, branch));
}
public void DeleteRemote(Models.Remote remote)
{
if (CanCreatePopup())
ShowPopup(new DeleteRemote(this, remote));
}
public void DeleteMultipleBranches(List<Models.Branch> branches, bool isLocal)
{
if (CanCreatePopup())
@@ -1407,6 +1401,12 @@ namespace SourceGit.ViewModels
ShowPopup(new AddRemote(this));
}
public void DeleteRemote(Models.Remote remote)
{
if (CanCreatePopup())
ShowPopup(new DeleteRemote(this, remote));
}
public void AddSubmodule()
{
if (CanCreatePopup())

View File

@@ -295,6 +295,12 @@ namespace SourceGit.ViewModels
SearchFilter = string.Empty;
}
public void Drop(Models.Stash stash)
{
if (stash != null && _repo.CanCreatePopup())
_repo.ShowPopup(new DropStash(_repo, stash));
}
private void RefreshVisible()
{
if (string.IsNullOrEmpty(_searchFilter))
@@ -314,12 +320,6 @@ namespace SourceGit.ViewModels
}
}
public void Drop(Models.Stash stash)
{
if (_repo.CanCreatePopup())
_repo.ShowPopup(new DropStash(_repo, stash));
}
private Repository _repo = null;
private List<Models.Stash> _stashes = [];
private List<Models.Stash> _visibleStashes = [];