mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
code_review: PR #98
* remove the `Leave` option (it may lead to an undefined behaviour), so user can only choose `Stash & reapply` or `Discard`. * re-design the UI * remove unused resources
This commit is contained in:
parent
927a1cab24
commit
776605cb68
7 changed files with 75 additions and 89 deletions
|
@ -690,6 +690,17 @@ namespace SourceGit.ViewModels
|
|||
PopupHost.ShowPopup(new CreateBranch(this, current));
|
||||
}
|
||||
|
||||
public void CheckoutLocalBranch(string branch)
|
||||
{
|
||||
if (!PopupHost.CanCreatePopup())
|
||||
return;
|
||||
|
||||
if (WorkingCopyChangesCount > 0)
|
||||
PopupHost.ShowPopup(new Checkout(this, branch));
|
||||
else
|
||||
PopupHost.ShowAndStartPopup(new Checkout(this, branch));
|
||||
}
|
||||
|
||||
public void CreateNewTag()
|
||||
{
|
||||
var current = Branches.Find(x => x.IsCurrent);
|
||||
|
@ -842,11 +853,7 @@ namespace SourceGit.ViewModels
|
|||
checkout.Icon = App.CreateMenuIcon("Icons.Check");
|
||||
checkout.Click += (o, e) =>
|
||||
{
|
||||
if (PopupHost.CanCreatePopup())
|
||||
{
|
||||
Checkout.ShowPopup(this, branch.Name);
|
||||
}
|
||||
|
||||
CheckoutLocalBranch(branch.Name);
|
||||
e.Handled = true;
|
||||
};
|
||||
menu.Items.Add(checkout);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue