Commit ac1d1a58 authored by Ahmed Ashour's avatar Ahmed Ashour Committed by skylot

fix(gui): disable all components on saving the settings (PR #586)

parent 74a72a5c
......@@ -83,6 +83,9 @@ public class JadxSettingsWindow extends JDialog {
JButton saveBtn = new JButton(NLS.str("preferences.save"));
saveBtn.addActionListener(event -> {
settings.sync();
enableComponents(this, false);
SwingUtilities.invokeLater(() -> {
if (needReload) {
mainWindow.reOpenFile();
}
......@@ -96,6 +99,7 @@ public class JadxSettingsWindow extends JDialog {
}
dispose();
});
});
JButton cancelButton = new JButton(NLS.str("preferences.cancel"));
cancelButton.addActionListener(event -> {
JadxSettingsAdapter.fill(settings, startSettings);
......@@ -139,6 +143,15 @@ public class JadxSettingsWindow extends JDialog {
getRootPane().setDefaultButton(saveBtn);
}
private static void enableComponents(Container container, boolean enable) {
for (Component component : container.getComponents()) {
if (component instanceof Container) {
enableComponents((Container) component, enable);
}
component.setEnabled(enable);
}
}
private SettingsGroup makeDeobfuscationGroup() {
JCheckBox deobfOn = new JCheckBox();
deobfOn.setSelected(settings.isDeobfuscationOn());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment