mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
fix<Repository, History>: wrong context menu IsEnabled state.
* 'Pull' should always enabled for local branch with remote upstream * 'Discard All Changes' for current branch should only be enabled when there's at least one changes * 'Fast Forward' should check if target local branch has any commit ahead of it's upstream
This commit is contained in:
parent
280ef60111
commit
307e5a5ef0
2 changed files with 3 additions and 5 deletions
|
@ -597,6 +597,7 @@ namespace SourceGit.ViewModels {
|
|||
var discard = new MenuItem();
|
||||
discard.Header = App.Text("BranchCM.DiscardAll");
|
||||
discard.Icon = App.CreateMenuIcon("Icons.Undo");
|
||||
discard.IsEnabled = _workingCopy.Count > 0;
|
||||
discard.Click += (o, e) => {
|
||||
if (PopupHost.CanCreatePopup()) PopupHost.ShowPopup(new Discard(this));
|
||||
e.Handled = true;
|
||||
|
@ -619,7 +620,6 @@ namespace SourceGit.ViewModels {
|
|||
var pull = new MenuItem();
|
||||
pull.Header = new Views.NameHighlightedTextBlock("BranchCM.Pull", upstream);
|
||||
pull.Icon = App.CreateMenuIcon("Icons.Pull");
|
||||
pull.IsEnabled = !string.IsNullOrEmpty(branch.UpstreamTrackStatus);
|
||||
pull.Click += (o, e) => {
|
||||
if (PopupHost.CanCreatePopup()) PopupHost.ShowPopup(new Pull(this, null));
|
||||
e.Handled = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue