From: gmungoc Date: Tue, 22 May 2018 15:05:03 +0000 (+0100) Subject: JAL-2716 fix broken checkIfModified behaviour X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=aecb9184e4f9c4965dd0667b1ba3b42d5c018bbf;p=jalview.git JAL-2716 fix broken checkIfModified behaviour --- 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