diff src/name/blackcap/clipman/SettingsDialog.kt @ 47:19d9da731c43

Recoded; cleaned up root namespace, removed race conditions.
author David Barts <n5jrn@me.com>
date Sun, 12 Apr 2020 14:31:06 -0700
parents ca8a23bae4fa
children
line wrap: on
line diff
--- a/src/name/blackcap/clipman/SettingsDialog.kt	Mon Feb 10 16:40:09 2020 -0700
+++ b/src/name/blackcap/clipman/SettingsDialog.kt	Sun Apr 12 14:31:06 2020 -0700
@@ -25,7 +25,7 @@
 /* work around name shadowing */
 private val _PROPS = PROPERTIES
 
-class SettingsDialog: JDialog(frame.v), ActionListener, ChangeListener {
+class SettingsDialog: JDialog(Application.frame), ActionListener, ChangeListener {
     /* max queue length */
     private val _qLength = _PROPS.getInt("queue.length")
     private val _qlSlider = JSlider(10000, 30000, spinToSlide(_qLength)).also {
@@ -104,7 +104,7 @@
         when (e.actionCommand) {
             "OK" -> {
                 writeProperties()
-                queue.v.maxSize = qLength
+                Application.queue.maxSize = qLength
                 setVisible(false)
             }
             "Cancel" -> {
@@ -150,7 +150,7 @@
             if (message != null && !message.isEmpty()) {
                 LOGGER.log(Level.WARNING, message)
             }
-            JOptionPane.showMessageDialog(frame.v,
+            JOptionPane.showMessageDialog(Application.frame,
                 "Unable to write settings.",
                 "Error",
                 JOptionPane.ERROR_MESSAGE)
@@ -158,8 +158,6 @@
     }
 }
 
-val settingsDialog = SettingsDialog()
-
 fun Properties.getString(key: String): String = getProperty(key) as String
 
 fun Properties.getInt(key: String): Int = getString(key).toInt()