New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#11108 Disabled hotkeys in scenarios where their usage was not intended #11109
#11108 Disabled hotkeys in scenarios where their usage was not intended #11109
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most similar issues should be handled by the check in the method returns false when conditions are not fulfilled (the action could be handled by another form then). This should be done here too.
I will not oppose a merge though, if another maintainer approves.
I am sure there are several other similar issues still even if several similar issues exists...
Yes, I have tried that. When the method returns false, the hotkey is passed to the context menu. Every time we open the context menu for the selected commit, it checks if create branch action or some other action should be enabled, but that is to late. The problem is when we select a regular commit, right click, and then select an artificial commit - without right clicking on the artificial commit, and press the hotkey, we can still cause this bug. If you are still in favor of passing the action handling to another form, we may want to add a double redundant validation in context menu click event handeling or change the context menu to perform update of Enabled propery of all context menu items every time a new commit is selected. |
I just want to move the logic ti the method handling the request, not in |
Ok, |
@gerhardol I have updated the code for your review, according to your suggestions. |
26a0308
to
b27346c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with two suggested changes.
Changing from draft.
GitUI/GitUICommands.cs
Outdated
@@ -440,6 +440,11 @@ public bool StartCreateBranchDialog(IWin32Window? owner, string? branch) | |||
|
|||
public bool StartCreateBranchDialog(IWin32Window? owner = null, ObjectId? objectId = null, string? newBranchNamePrefix = null) | |||
{ | |||
if (Module.IsBareRepository() || (objectId is not null && objectId.IsArtificial)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (Module.IsBareRepository() || (objectId is not null && objectId.IsArtificial)) | |
if (Module.IsBareRepository() || objectId?.IsArtificial is true) |
b27346c
to
28daf37
Compare
Hi, @gerhardol |
28daf37
to
d81a054
Compare
Sorry, my bad. I missed the question marks in my last commit. It should pass the build now. |
…as not intended
…arios where they were not intended(gitextensions#11108)
d81a054
to
e3d5b0a
Compare
Thank you! |
Fixes #11108
Proposed changes
Ctrl + B
does not promptFromCreateBranch
while in bare repository, neither when artificial commit is selected.Ctrl + Shift + E
is disabled while artificial commit is selectedCtrl + T
is disabled while artificial commit is selectedTest methodology
Test environment(s)