mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-23 13:16:48 +08:00
GP-1981 added check for theme changes when exiting tool. Fixed
FrontEndTool's close method. It was cheating before
This commit is contained in:
+1
-1
@@ -429,7 +429,7 @@ public class AnalyzeAllOpenProgramsTaskTest extends AbstractGhidraHeadedIntegrat
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
runSwing(super::close);
|
||||
runSwing(() -> super.close());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package ghidra.app.plugin.gui;
|
||||
import docking.action.builder.ActionBuilder;
|
||||
import docking.theme.gui.ThemeDialog;
|
||||
import docking.theme.gui.ThemeUtils;
|
||||
import generic.theme.Gui;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.framework.main.ApplicationLevelOnlyPlugin;
|
||||
import ghidra.framework.main.UtilityPluginPackage;
|
||||
@@ -85,4 +86,12 @@ public class ThemeManagerPlugin extends Plugin implements ApplicationLevelOnlyPl
|
||||
tool.setMenuGroup(new String[] { "Edit", themeSubMenu }, group, "2");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canClose() {
|
||||
if (Gui.hasThemeChanges()) {
|
||||
return ThemeUtils.askToSaveThemeChanges();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ public class FrontEndTool extends PluginTool implements OptionsChangeListener {
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
exit();
|
||||
close(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1119,10 +1119,13 @@ public abstract class PluginTool extends AbstractDockingTool {
|
||||
* <LI>notify the project tool services that this tool is going away.
|
||||
* </OL>
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (canClose(false) && pluginMgr.saveData()) {
|
||||
close(false);
|
||||
}
|
||||
|
||||
protected void close(boolean isExiting) {
|
||||
if (canClose(isExiting) && pluginMgr.saveData()) {
|
||||
doClose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user