JAL-2716 fix broken checkIfModified behaviour
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 22 May 2018 15:05:03 +0000 (16:05 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 22 May 2018 15:05:03 +0000 (16:05 +0100)
src/jalview/gui/OptsAndParamsPage.java

index 298057f..c09d729 100644 (file)
@@ -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