Mercurial > cgi-bin > hgweb.cgi > ImagePrep
comparison src/name/blackcap/imageprep/Menus.kt @ 3:09dcd475d1bf
Works (prelim tests only).
author | David Barts <n5jrn@me.com> |
---|---|
date | Fri, 17 Jul 2020 11:48:07 -0700 |
parents | 0bded24f746e |
children | 884f1415a330 |
comparison
equal
deleted
inserted
replaced
2:a6f9b51d5e8d | 3:09dcd475d1bf |
---|---|
73 return null | 73 return null |
74 } | 74 } |
75 | 75 |
76 private fun doOpen() { | 76 private fun doOpen() { |
77 val chooser = JFileChooser().apply { | 77 val chooser = JFileChooser().apply { |
78 fileFilter = FileNameExtensionFilter("Image files", *ImageIO.getReaderFileSuffixes()) | 78 fileFilter = FileNameExtensionFilter("Image Files", *ImageIO.getReaderFileSuffixes()) |
79 } | 79 } |
80 if (chooser.showOpenDialog(Application.mainFrame) == JFileChooser.APPROVE_OPTION) { | 80 if (chooser.showOpenDialog(Application.mainFrame) == JFileChooser.APPROVE_OPTION) { |
81 RotateDialog.makeDialog(chooser.selectedFile) | 81 RotateDialog.makeDialog(chooser.selectedFile) |
82 } | 82 } |
83 } | 83 } |
102 val chooser = JFileChooser().apply { | 102 val chooser = JFileChooser().apply { |
103 selectedFile = File( | 103 selectedFile = File( |
104 if (Settings.outputToInputDir) w.file.parent else Settings.outputTo, | 104 if (Settings.outputToInputDir) w.file.parent else Settings.outputTo, |
105 outName) | 105 outName) |
106 } | 106 } |
107 if (chooser.showOpenDialog(Application.mainFrame) != JFileChooser.APPROVE_OPTION) { | 107 if (chooser.showSaveDialog(Application.mainFrame) != JFileChooser.APPROVE_OPTION) { |
108 return | 108 return |
109 } | 109 } |
110 val (name, ext) = splitext(chooser.selectedFile.name) | 110 val (name, ext) = splitext(chooser.selectedFile.name) |
111 val file = if (ext.toLowerCase() in setOf(".jpg", ".jpeg")) { | 111 val file = if (ext.toLowerCase() in setOf(".jpg", ".jpeg")) { |
112 chooser.selectedFile | 112 chooser.selectedFile |