Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6dd517d

Browse files
committed
GP-4558 fixing a few bugs with actions dialog
1 parent b77b4a4 commit 6dd517d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Ghidra/Framework/Docking/src/main/java/docking/action/ShowActionChooserDialogAction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public void actionPerformed(ActionContext context) {
4646
Tool tool = DockingWindowManager.getActiveInstance().getTool();
4747

4848
if (focusedWindow instanceof DockingDialog dialog) {
49+
context = dialog.getDialogComponent().getActionContext(null);
4950
showActionsDialog(tool, dialog, context);
5051
}
5152
else if (focusedWindow instanceof DockingFrame dockingFrame) {

Ghidra/Framework/Docking/src/main/java/docking/actions/dialog/ActionChooserDialog.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public ActionChooserDialog(ActionsModel model) {
6363
"This dialog initialy shows only locally relevant actions. Repeat initial keybinding " +
6464
"to show More. Use up down arrows to scroll through list of actions and press" +
6565
" enter to invoke selected action. Type text to filter list.");
66+
setOkEnabled(false);
6667
}
6768

6869
@Override
@@ -308,7 +309,8 @@ private String getHtmlText(DockingActionIf action, String category, boolean isSe
308309
Color fgName = getForeground(); // defaults to list foreground; handles selected state
309310
Color fgKeyBinding = isSelected ? getForeground() : Messages.HINT;
310311

311-
if (!action.isEnabled()) {
312+
ActionContext context = model.getContext();
313+
if (!(action.isValidContext(context) && action.isEnabledForContext(context))) {
312314
fgName = isSelected ? getForeground() : Colors.FOREGROUND_DISABLED;
313315
fgKeyBinding = isSelected ? getForeground() : Colors.FOREGROUND_DISABLED;
314316
disabledText = isSelected ? " <I>disabled</I>" : "";

0 commit comments

Comments
 (0)