mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
commit
6b04eb793f
33 changed files with 1219 additions and 368 deletions
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue