# HG changeset patch # User David Barts # Date 1588865398 25200 # Node ID fb407182ba769b1634cd5313cb58bf716ebd4f0b # Parent 35fb8de77c7ddad93a4e315990038a7b1557d6e9 Add help menu item, UNTESTED. diff -r 35fb8de77c7d -r fb407182ba76 Building.html --- a/Building.html Mon May 04 18:12:59 2020 -0700 +++ b/Building.html Thu May 07 08:29:58 2020 -0700 @@ -53,8 +53,7 @@ net win, as it is portable, and would spell the death of the only bit of OS-dependent Kotlin code in this application.

In another year or two, I will probably make OpenJDK 11 or greater the - preferred version. It’s a little too early to do that right now, however, - as not many systems have Java 11 present.

+ preferred version.

Build Procedure

Install Prerequisites

See the “Prerequisites” section above for the details of what you will @@ -80,7 +79,7 @@ tools in its PATH).

Compile Kotlin Source and Bundle an App

Just type ant macapp, ant winapp, or ant - deb depending on whether you are building on a Mac, Windows, or + deb depending on whether you are building on a Mac, Windows, or Debian Linux (note that Ubuntu is a Debian variant).

That’s It!

If all went well, a system-specific bundle should be found in the dist diff -r 35fb8de77c7d -r fb407182ba76 build.xml --- a/build.xml Mon May 04 18:12:59 2020 -0700 +++ b/build.xml Thu May 07 08:29:58 2020 -0700 @@ -78,7 +78,7 @@ - + diff -r 35fb8de77c7d -r fb407182ba76 src/name/blackcap/exifwasher/HelpDialog.kt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/name/blackcap/exifwasher/HelpDialog.kt Thu May 07 08:29:58 2020 -0700 @@ -0,0 +1,62 @@ +/* + * The dialog that displays the Exif data in a single file (display only, + * no changing). We do this after washing. + */ +package name.blackcap.exifwasher + +import java.awt.Color +import java.awt.Dimension +import java.awt.event.ActionEvent +import java.awt.event.ActionListener +import java.io.File +import java.io.IOException +import java.io.BufferedReader +import java.io.InputStream +import java.io.InputStreamReader +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.* + +class HelpDialog : JDialog(Application.mainFrame) { + private val BW = 9 + private val BW2 = BW * 2 + private val WIDTH = 640 + private val HEIGHT = 480 + + private val dismissButton = JButton("Dismiss").also { + it.addActionListener(ActionListener { setVisible(false) }) + } + + private val helpPane = JTextPane().also { + it.contentType = "text/html"; + it.text = ::class.java.getResourceAsStream("help.html").bufferedReader().use { it.readText() } + } + + init { + setVisible(false) + 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(Box(BoxLayout.X_AXIS).apply { + alignmentX = Box.CENTER_ALIGNMENT + border = BorderFactory.createEmptyBorder(BW, BW2, BW2, BW2) + add(Box.createHorizontalGlue()) + add(dismissButton) + }) + } + pack() + } +} diff -r 35fb8de77c7d -r fb407182ba76 src/name/blackcap/exifwasher/Main.kt --- a/src/name/blackcap/exifwasher/Main.kt Mon May 04 18:12:59 2020 -0700 +++ b/src/name/blackcap/exifwasher/Main.kt Thu May 07 08:29:58 2020 -0700 @@ -14,6 +14,7 @@ /* global UI objects */ var mainFrame: MainFrame by setOnce() var settingsDialog: SettingsDialog by setOnce() + var helpDialog: HelpDialog by setOnce() fun initialize() { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); @@ -21,6 +22,7 @@ mainFrame.jMenuBar = MyMenuBar() setMacMenus() /* always safe to call; no-op if not a Mac */ settingsDialog = SettingsDialog() + helpDialog = HelpDialog() mainFrame.setVisible(true) } } diff -r 35fb8de77c7d -r fb407182ba76 src/name/blackcap/exifwasher/Menus.kt --- a/src/name/blackcap/exifwasher/Menus.kt Mon May 04 18:12:59 2020 -0700 +++ b/src/name/blackcap/exifwasher/Menus.kt Thu May 07 08:29:58 2020 -0700 @@ -37,11 +37,14 @@ }) } }) - if (OS.type != OS.MAC) { - add(JMenu("Help").apply { + add(JMenu("Help").apply { + if (OS.type != OS.MAC) { add(JMenuItem("About ${Application.MYNAME}…").apply { addActionListener(ActionListener { showAboutDialog() }) }) + } + add(JMenuItem("${Application.MYNAME} Help…").apply { + addActionListener(ActionListener { Application.helpDialog.setVisible(true) }) }) } } diff -r 35fb8de77c7d -r fb407182ba76 src/name/blackcap/exifwasher/help.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/name/blackcap/exifwasher/help.html Thu May 07 08:29:58 2020 -0700 @@ -0,0 +1,37 @@ + + + + + JpegWasher Help + + +

JpegWasher Help

+

Using This Program

+

To remove sensitive metadata from your digital photos, just drag the JPEG + file(s) containing them onto the main window of this application, or + choose File… Wash from the menu bar.

+

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 + 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 + “_washed” appended to it; e.g. washing cat.jpg will result + in cat_washed.jpg. (Whether or not the cat enjoys being + washed is an entirely different matter.)

+

Configuring JpegWasher

+

This is a configurable program, whose operation may be adjusted by the + preferences dialog (accessed under the JpegWasher menu on the + Mac and the File menu on Linux and Windows).

+

The whitelist that determines which metadata keys will not be + deleted can be changed, via the Whitelist pane of the + preferences dialog. Note that there are two kinds of whitelist entries: + ones that match entire keys, and ones that match the prefixes of keys (the + latter entries end with an asterisk “*”). Whitelist entries are case + sensitive; “exif.image.white*” will not match “Exif.Image.WhitePoint.”

+

It is also possible to set the folder where output files are created, via + the Folders pane (by default, this is the same folder the input + file was in).

+ +