Merge remote-tracking branch 'origin/patch'

This commit is contained in:
ghidra1 2021-08-03 19:26:00 -04:00
commit 6b04eb793f
33 changed files with 1219 additions and 368 deletions

View file

@ -22,6 +22,7 @@ import java.beans.PropertyChangeListener;
import javax.swing.tree.TreePath;
import docking.DialogComponentProvider;
import docking.widgets.OptionDialog;
import ghidra.framework.options.Options;
/**
@ -85,9 +86,20 @@ public class OptionsDialog extends DialogComponentProvider {
@Override
protected void cancelCallback() {
if (panel.cancel()) {
close();
// stop any active editors
panel.cancel();
if (hasChanges) {
int result = OptionDialog.showYesNoCancelDialog(panel, "Save Changes?",
"These options have changed. Do you want to save them?");
if (result == OptionDialog.CANCEL_OPTION) {
return;
}
if (result == OptionDialog.YES_OPTION) {
applyChanges();
}
}
close();
}
@Override

View file

@ -183,7 +183,7 @@ public class OptionsPanel extends JPanel {
processSelection(node);
}
public boolean cancel() {
public void cancel() {
Set<Entry<OptionsTreeNode, OptionsEditor>> entrySet = editorMap.entrySet();
for (Map.Entry<OptionsTreeNode, OptionsEditor> entry : entrySet) {
OptionsEditor editor = entry.getValue();
@ -199,8 +199,6 @@ public class OptionsPanel extends JPanel {
Msg.showError(this, this, title, title + "\nError Message: " + msg, e);
}
}
return true;
}
public boolean apply() {