changeset 52:39895d44a287

Get help working on Linux.
author David Barts <n5jrn@me.com>
date Thu, 07 May 2020 09:59:28 -0700
parents d4ccc5ccdc6d
children 61a06e050bac
files build.xml src/name/blackcap/exifwasher/HelpDialog.kt src/name/blackcap/exifwasher/Menus.kt src/name/blackcap/exifwasher/help.html
diffstat 4 files changed, 19 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
       </manifest>
       <zipgroupfileset dir="${lib.home}" includes="*.jar"/>
       <zipfileset src="${work.jar}"/>
-      <zipfileset dir="${src.home}" includes="**/*.properties,**/*.dll,**/*.so,**/*.dylib"/>
+      <zipfileset dir="${src.home}" includes="**/*.properties,**/*.html,**/*.dll,**/*.so,**/*.dylib"/>
       <zipfileset file="${pf.home}/linux/icon_48x48.png"
         fullpath="name/blackcap/exifwasher/icon_48x48.png"/>
     </jar>
--- 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)
--- 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? {
--- 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 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
   <head>
-    <meta http-equiv="content-type" content="text/html; charset=utf-8">
     <title>JpegWasher Help</title>
   </head>
   <body>
@@ -13,7 +12,7 @@
     <p>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 <em>Wash</em> button below. The file will then be
       washed, and a new dialog will pop up displaying any remaining metadata in
       the washed file.</p>
     <p>The newly-washed file will have the same name as the original one, with