# HG changeset patch # User David Barts # Date 1588870768 25200 # Node ID 39895d44a287d553347d9aae6b106330757f5a08 # Parent d4ccc5ccdc6de1b70b24cf778b46f71c797fa2d3 Get help working on Linux. diff -r d4ccc5ccdc6d -r 39895d44a287 build.xml --- a/build.xml Thu May 07 08:30:56 2020 -0700 +++ b/build.xml Thu May 07 09:59:28 2020 -0700 @@ -177,7 +177,7 @@ - + diff -r d4ccc5ccdc6d -r 39895d44a287 src/name/blackcap/exifwasher/HelpDialog.kt --- a/src/name/blackcap/exifwasher/HelpDialog.kt Thu May 07 08:30:56 2020 -0700 +++ b/src/name/blackcap/exifwasher/HelpDialog.kt Thu May 07 09:59:28 2020 -0700 @@ -4,7 +4,6 @@ */ package name.blackcap.exifwasher -import java.awt.Color import java.awt.Dimension import java.awt.event.ActionEvent import java.awt.event.ActionListener @@ -16,9 +15,6 @@ import java.util.logging.Level import java.util.logging.Logger import javax.swing.* -import javax.swing.table.DefaultTableModel -import javax.swing.table.TableColumn -import javax.swing.table.TableColumnModel import name.blackcap.exifwasher.exiv2.* @@ -32,9 +28,22 @@ it.addActionListener(ActionListener { setVisible(false) }) } - private val helpPane = JTextPane().also { + private val helpPane = JScrollPane(JTextPane().also { it.contentType = "text/html"; - it.text = ::class.java.getResourceAsStream("help.html").bufferedReader().use { it.readText() } + it.text = this::class.java.getResourceAsStream("help.html").bufferedReader().use { it.readText() } + }).apply { + alignmentX = JScrollPane.CENTER_ALIGNMENT + border = BorderFactory.createEmptyBorder(BW2, BW2, BW, BW2) + verticalScrollBarPolicy = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS + horizontalScrollBarPolicy = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER + preferredSize = Dimension(WIDTH, HEIGHT) + background = Application.mainFrame.background + } + + override fun setVisible(vis: Boolean) { + if (vis) + helpPane.verticalScrollBar.run { value = minimum } + super.setVisible(vis) } init { @@ -42,14 +51,7 @@ title = "Help" contentPane.apply { layout = BoxLayout(this, BoxLayout.Y_AXIS) - add(JScrollPane(helpPane).apply { - alignmentX = JScrollPane.CENTER_ALIGNMENT - border = BorderFactory.createEmptyBorder(BW2, BW2, BW, BW2) - verticalScrollBarPolicy = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS - horizontalScrollBarPolicy = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER - preferredSize = Dimension(WIDTH, HEIGHT) - background = Application.mainFrame.background - }) + add(helpPane) add(Box(BoxLayout.X_AXIS).apply { alignmentX = Box.CENTER_ALIGNMENT border = BorderFactory.createEmptyBorder(BW, BW2, BW2, BW2) diff -r d4ccc5ccdc6d -r 39895d44a287 src/name/blackcap/exifwasher/Menus.kt --- a/src/name/blackcap/exifwasher/Menus.kt Thu May 07 08:30:56 2020 -0700 +++ b/src/name/blackcap/exifwasher/Menus.kt Thu May 07 09:59:28 2020 -0700 @@ -46,7 +46,7 @@ add(JMenuItem("${Application.MYNAME} Help…").apply { addActionListener(ActionListener { Application.helpDialog.setVisible(true) }) }) - } + }) } fun getMenu(name: String): JMenu? { diff -r d4ccc5ccdc6d -r 39895d44a287 src/name/blackcap/exifwasher/help.html --- a/src/name/blackcap/exifwasher/help.html Thu May 07 08:30:56 2020 -0700 +++ b/src/name/blackcap/exifwasher/help.html Thu May 07 09:59:28 2020 -0700 @@ -1,7 +1,6 @@ - JpegWasher Help @@ -13,7 +12,7 @@

A dialog will pop up displaying the metadata in the file, with check boxes in the leftmost column marking the data to be deleted. If you disagree with JpegWasher’s choices, check or uncheck boxes until you are - satisfied, then click on the Wash button below. The file will then be + satisfied, then click on the Wash button below. The file will then be washed, and a new dialog will pop up displaying any remaining metadata in the washed file.

The newly-washed file will have the same name as the original one, with