From aecb9184e4f9c4965dd0667b1ba3b42d5c018bbf Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 22 May 2018 16:05:03 +0100 Subject: [PATCH] JAL-2716 fix broken checkIfModified behaviour --- src/jalview/gui/OptsAndParamsPage.java | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/jalview/gui/OptsAndParamsPage.java b/src/jalview/gui/OptsAndParamsPage.java index 298057f..c09d729 100644 --- a/src/jalview/gui/OptsAndParamsPage.java +++ b/src/jalview/gui/OptsAndParamsPage.java @@ -559,7 +559,7 @@ public class OptsAndParamsPage { if (adjusting) { - return; + // return; } if (!isChoiceParameter) { @@ -574,23 +574,13 @@ public class OptsAndParamsPage */ private void checkIfModified() { - if (!adjusting) + Object newValue = updateSliderFromValueField(); + boolean modified = true; + if (newValue.getClass() == lastVal.getClass()) { - try - { - adjusting = true; - Object newValue = updateSliderFromValueField(); - boolean modified = true; - if (newValue.getClass() == lastVal.getClass()) - { - modified = !newValue.equals(lastVal); - } - pmdialogbox.argSetModified(this, modified); - } finally - { - adjusting = false; - } + modified = !newValue.equals(lastVal); } + pmdialogbox.argSetModified(this, modified); } @Override @@ -734,6 +724,8 @@ public class OptsAndParamsPage if (isChoiceParameter) { choicebox = buildComboBox(parm); + choicebox.setSelectedItem(parm.getValue()); + choicebox.addActionListener(this); controlsPanel.add(choicebox, BorderLayout.CENTER); } else -- 1.7.10.2