mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-28 17:45:53 +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
|
@Override
|
||||||
public void close() {
|
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.action.builder.ActionBuilder;
|
||||||
import docking.theme.gui.ThemeDialog;
|
import docking.theme.gui.ThemeDialog;
|
||||||
import docking.theme.gui.ThemeUtils;
|
import docking.theme.gui.ThemeUtils;
|
||||||
|
import generic.theme.Gui;
|
||||||
import ghidra.app.plugin.PluginCategoryNames;
|
import ghidra.app.plugin.PluginCategoryNames;
|
||||||
import ghidra.framework.main.ApplicationLevelOnlyPlugin;
|
import ghidra.framework.main.ApplicationLevelOnlyPlugin;
|
||||||
import ghidra.framework.main.UtilityPluginPackage;
|
import ghidra.framework.main.UtilityPluginPackage;
|
||||||
@@ -85,4 +86,12 @@ public class ThemeManagerPlugin extends Plugin implements ApplicationLevelOnlyPl
|
|||||||
tool.setMenuGroup(new String[] { "Edit", themeSubMenu }, group, "2");
|
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
|
@Override
|
||||||
public void close() {
|
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.
|
* <LI>notify the project tool services that this tool is going away.
|
||||||
* </OL>
|
* </OL>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
if (canClose(false) && pluginMgr.saveData()) {
|
close(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void close(boolean isExiting) {
|
||||||
|
if (canClose(isExiting) && pluginMgr.saveData()) {
|
||||||
doClose();
|
doClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user