mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-6999 - Fixed Fid menu action enablement
This commit is contained in:
@@ -121,7 +121,7 @@ public class FidPlugin extends ProgramPlugin implements ChangeListener {
|
|||||||
.buildAndInstall(tool);
|
.buildAndInstall(tool);
|
||||||
|
|
||||||
new ActionBuilder("Detach attached FidDb", getName())
|
new ActionBuilder("Detach attached FidDb", getName())
|
||||||
.enabledWhen(ac -> enabledForUserFidFiles())
|
.enabledWhen(ac -> fidFileManager.hasUserFidFiles())
|
||||||
.onAction(ac -> removeFidFile())
|
.onAction(ac -> removeFidFile())
|
||||||
.menuPath(ToolConstants.MENU_TOOLS, FUNCTION_ID_NAME, "Detach attached FidDb...")
|
.menuPath(ToolConstants.MENU_TOOLS, FUNCTION_ID_NAME, "Detach attached FidDb...")
|
||||||
.menuGroup(MENU_GROUP_1, "4")
|
.menuGroup(MENU_GROUP_1, "4")
|
||||||
@@ -130,7 +130,6 @@ public class FidPlugin extends ProgramPlugin implements ChangeListener {
|
|||||||
.buildAndInstall(tool);
|
.buildAndInstall(tool);
|
||||||
|
|
||||||
new ActionBuilder("Populate FidDb from programs", getName())
|
new ActionBuilder("Populate FidDb from programs", getName())
|
||||||
.enabledWhen(ac -> enabledForUserFidFiles())
|
|
||||||
.onAction(ac -> {
|
.onAction(ac -> {
|
||||||
fidFileManager.load();
|
fidFileManager.load();
|
||||||
PopulateFidDialog populateFidDialog = new PopulateFidDialog(tool, service);
|
PopulateFidDialog populateFidDialog = new PopulateFidDialog(tool, service);
|
||||||
@@ -153,15 +152,6 @@ public class FidPlugin extends ProgramPlugin implements ChangeListener {
|
|||||||
return fidFileManager.hasFidFiles();
|
return fidFileManager.hasFidFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean enabledForUserFidFiles() {
|
|
||||||
if (!fidFileManager.hasLoadedFidFiles()) {
|
|
||||||
// We haven't loaded Fid files yet. Since we don't know if we can enable, return true
|
|
||||||
// so users can at least try to perform the action.
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return fidFileManager.hasUserFidFiles();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to select which known FID databases are currently active
|
* Method to select which known FID databases are currently active
|
||||||
* during search.
|
* during search.
|
||||||
|
|||||||
Reference in New Issue
Block a user