comparison src/name/blackcap/exifwasher/WashDialog.kt @ 24:3d9c36307704

Should make the wait cursor appear, but doesn't. Java bug?
author davidb
date Thu, 16 Apr 2020 19:26:37 -0700
parents 39b977021ea1
children 40911898ed23
comparison
equal deleted inserted replaced
23:5cac95c17fef 24:3d9c36307704
99 } 99 }
100 } 100 }
101 101
102 selectAll.setSelected(false) 102 selectAll.setSelected(false)
103 washing = dirty 103 washing = dirty
104 useWaitCursor() 104 Application.mainFrame.useWaitCursor()
105 swingWorker<Array<Array<Any>>?> { 105 swingWorker<Array<Array<Any>>?> {
106 inBackground { 106 inBackground {
107 try { 107 try {
108 val image = Image(dirty.canonicalPath) 108 val image = Image(dirty.canonicalPath)
109 val meta = image.metadata 109 val meta = image.metadata
120 LOGGER.log(Level.SEVERE, "unable to read metadata", e) 120 LOGGER.log(Level.SEVERE, "unable to read metadata", e)
121 null 121 null
122 } 122 }
123 } 123 }
124 whenDone { 124 whenDone {
125 useNormalCursor() 125 Application.mainFrame.useNormalCursor()
126 val tableData = get() 126 val tableData = get()
127 if (tableData == null) { 127 if (tableData == null) {
128 JOptionPane.showMessageDialog(Application.mainFrame, 128 JOptionPane.showMessageDialog(Application.mainFrame,
129 "Unable to read metadata.", 129 "Unable to read metadata.",
130 "Error", JOptionPane.ERROR_MESSAGE) 130 "Error", JOptionPane.ERROR_MESSAGE)
187 return 187 return
188 } 188 }
189 } 189 }
190 190
191 /* copy the file, then edit the Exif in the copy */ 191 /* copy the file, then edit the Exif in the copy */
192 useWaitCursor() 192 Application.mainFrame.useWaitCursor()
193 swingWorker<Boolean> { 193 swingWorker<Boolean> {
194 inBackground { 194 inBackground {
195 try { 195 try {
196 FileInputStream(washing).use { source -> 196 FileInputStream(washing).use { source ->
197 FileOutputStream(newFile).use { target -> 197 FileOutputStream(newFile).use { target ->
214 LOGGER.log(Level.SEVERE, "unable to edit metadata", e) 214 LOGGER.log(Level.SEVERE, "unable to edit metadata", e)
215 false 215 false
216 } 216 }
217 } 217 }
218 whenDone { 218 whenDone {
219 useNormalCursor() 219 Application.mainFrame.useNormalCursor()
220 close() 220 close()
221 /* if all went well, show the Exif in the new file */ 221 /* if all went well, show the Exif in the new file */
222 if (get()) { 222 if (get()) {
223 ShowDialog().show(newFile) 223 ShowDialog().show(newFile)
224 } else { 224 } else {