mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-29 04:25:32 +08:00
Merge remote-tracking branch 'origin/GP-3080_ghidra1_DefaultToolOpen--SQUASHED'
This commit is contained in:
@@ -359,7 +359,11 @@
|
||||
<LI>To open a file in the tool that was <A href=
|
||||
"help/topics/Tool/Ghidra_Tool_Administration.htm#Set_Tool_Associations">specified as the
|
||||
"default,"</A> double click on the Program that you want to open, OR right mouse click on
|
||||
the file and choose <B>Open in Default Tool.</B></LI>
|
||||
the file and choose <B>Open in Default Tool.</B> Either a new tool will be launched
|
||||
or an existing running tool will be reused based upon the Tool option setting (see
|
||||
<A href="help/topics/Tool/ToolOptions_Dialog.htm#Front_End_Tool_Options">
|
||||
Front-End Tool Options</A>.
|
||||
</LI>
|
||||
</UL>
|
||||
|
||||
<H4><A name="Open_File_With"></A>Open a File With a Specific Tool</H4>
|
||||
|
||||
@@ -412,7 +412,16 @@
|
||||
whether or not Ghidra automatically opens the previously loaded project on
|
||||
startup.</TD>
|
||||
</TR>
|
||||
|
||||
|
||||
<TR>
|
||||
<TD valign="top" width="200" align="left">Default Tool Launch Mode</TD>
|
||||
|
||||
<TD valign="top" align="left">This controls
|
||||
if a new or already running tool should be used during default launch.
|
||||
Tool "reuse" mode will open selected file within a suitable running tool
|
||||
if one can be identified, otherwise a new tool will be launched.
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD valign="top" width="200" align="left"><A name="Use_Inverted_Colors"></A>Use
|
||||
|
||||
+1
-12
@@ -316,18 +316,7 @@ public final class LanguageProviderPlugin extends Plugin implements ApplicationL
|
||||
try {
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
ToolServices toolServices = tool.getToolServices();
|
||||
ToolTemplate defaultToolTemplate = toolServices.getDefaultToolTemplate(file);
|
||||
if (defaultToolTemplate != null) {
|
||||
String defaultToolName = defaultToolTemplate.getName();
|
||||
for (PluginTool t : toolServices.getRunningTools()) {
|
||||
if (t.getName().equals(defaultToolName)) {
|
||||
openTool = t;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (openTool == null ||
|
||||
!openTool.acceptDomainFiles(new DomainFile[] { file })) {
|
||||
if (toolServices.launchDefaultTool(domainFile) == null) {
|
||||
Msg.showError(this, tool.getToolFrame(), "Failed to Open Program",
|
||||
"A suitable default tool could not found!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user