# HG changeset patch # User David Barts # Date 1607887206 28800 # Node ID 9bf3d8de690435dd455d8d9fd839406a7c774ff0 # Parent a4737a525af8813449dc90d2bcc5c5d2b6776f4a Fix Preferences bug, bump version number. diff -r a4737a525af8 -r 9bf3d8de6904 build.xml --- a/build.xml Wed Nov 25 08:40:45 2020 -0800 +++ b/build.xml Sun Dec 13 11:20:06 2020 -0800 @@ -32,7 +32,7 @@ - + diff -r a4737a525af8 -r 9bf3d8de6904 src/name/blackcap/imageprep/SettingsDialog.kt --- a/src/name/blackcap/imageprep/SettingsDialog.kt Wed Nov 25 08:40:45 2020 -0800 +++ b/src/name/blackcap/imageprep/SettingsDialog.kt Sun Dec 13 11:20:06 2020 -0800 @@ -15,6 +15,8 @@ import java.util.logging.Level import java.util.logging.Logger import javax.swing.* +import javax.swing.event.ChangeEvent +import javax.swing.event.ChangeListener import kotlin.text.toInt /* work around name shadowing */ @@ -44,8 +46,21 @@ return _outputSuffix.text } + /* button to change that other directory */ + private val otid = _PROPS.getBoolean("outputToInputDir") + protected val changeOutputTo = JButton("Change").also { + it.noTaller() + it.addActionListener(ActionListener { + val status = _outputTo.showOpenDialog(this) + if (status == JFileChooser.APPROVE_OPTION) { + val path = outputTo + outputToText.text = path + } + }) + it.setEnabled(!otid) + } + /* output to input dir? */ - private val otid = _PROPS.getBoolean("outputToInputDir") private val outputToInputButton = JRadioButton("Create output file in same folder as input.", otid).apply { alignmentX = LEFT_ALIGNMENT } @@ -57,6 +72,9 @@ /* output to some other directory */ private val outputToButton = JRadioButton("Create output file in:", !otid).apply { alignmentX = LEFT_ALIGNMENT + addChangeListener(ChangeListener { + changeOutputTo.setEnabled(isSelected()) + }) } /* name of the other directory */ @@ -76,19 +94,6 @@ return _outputTo.selectedFile?.getCanonicalPath() ?: oto } - /* button to change that other directory */ - protected val changeOutputTo = JButton("Change").also { - it.noTaller() - it.addActionListener(ActionListener { - val status = _outputTo.showOpenDialog(this) - if (status == JFileChooser.APPROVE_OPTION) { - val path = outputTo - outputToText.text = path - } - }) - it.setEnabled(!otid) - } - /* radio button group */ protected val buttonGroup = ButtonGroup().apply { add(outputToButton)