From 643653adbe04c8ca449bf80ced7bd74b26c3ae58 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 25 Sep 2020 07:56:41 -0400 Subject: [PATCH] cleaning up the Export to Application dialog --- README.md | 5 ++ build/shared/lib/languages/PDE.properties | 2 +- java/src/processing/mode/java/JavaEditor.java | 61 ++++++++++--------- todo.txt | 15 ++++- 4 files changed, 50 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 725c53240..c369b7d20 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,11 @@ As with all releases, we'll do everything possible to avoid breaking API. Howeve * Processing 4 will be 64-bit only. This is the overwhelming majority of users, and we don't have the necessary help to maintain and support 32-bit systems. +## Translation Updates + +* `export.embed_java.for` changed to `export.include_java` which also embeds a string for the platform for better localization support. + + ## Building the Code We'll eventually create a new wiki page with the build instructions, but for the time being, the instructions are: diff --git a/build/shared/lib/languages/PDE.properties b/build/shared/lib/languages/PDE.properties index 91c8b4601..b81fcd11e 100644 --- a/build/shared/lib/languages/PDE.properties +++ b/build/shared/lib/languages/PDE.properties @@ -242,7 +242,7 @@ export.notice.exporting.cancel = Export to Application canceled. export.tooltip.macosx = macOS export is only available on macOS export.full_screen = Full Screen export.embed_java = Embed Java -export.embed_java.for = Embed Java for +export.include_java = Include Java in the %s application export.code_signing = Code Signing export.messages.is_read_only = Sketch is Read-Only export.messages.is_read_only.description = Some files are marked "read-only", so you will\nneed to re-save the sketch in another location,\nand try again. diff --git a/java/src/processing/mode/java/JavaEditor.java b/java/src/processing/mode/java/JavaEditor.java index ea111a617..806df27cf 100644 --- a/java/src/processing/mode/java/JavaEditor.java +++ b/java/src/processing/mode/java/JavaEditor.java @@ -646,13 +646,13 @@ public class JavaEditor extends Editor { final JButton cancelButton = new JButton(Language.text("prompt.cancel")); final JCheckBox windowsButton = new JCheckBox("Windows"); - final JCheckBox macosxButton = new JCheckBox("Mac OS X"); + final JCheckBox macosButton = new JCheckBox("Mac OS X"); final JCheckBox linuxButton = new JCheckBox("Linux"); protected void updateExportButton() { exportButton.setEnabled(windowsButton.isSelected() || - macosxButton.isSelected() || + macosButton.isSelected() || linuxButton.isSelected()); } @@ -699,16 +699,16 @@ public class JavaEditor extends Editor { // Make sure they don't have a previous 'true' setting for this Preferences.setBoolean(EXPORT_MACOSX, false); } - macosxButton.setSelected(Preferences.getBoolean(EXPORT_MACOSX)); - macosxButton.addItemListener(new ItemListener() { + macosButton.setSelected(Preferences.getBoolean(EXPORT_MACOSX)); + macosButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { - Preferences.setBoolean(EXPORT_MACOSX, macosxButton.isSelected()); + Preferences.setBoolean(EXPORT_MACOSX, macosButton.isSelected()); updateExportButton(); } }); if (!Platform.isMacOS()) { - macosxButton.setEnabled(false); - macosxButton.setToolTipText(Language.text("export.tooltip.macosx")); + macosButton.setEnabled(false); + macosButton.setToolTipText(Language.text("export.tooltip.macosx")); } linuxButton.setSelected(Preferences.getBoolean(EXPORT_LINUX)); @@ -725,7 +725,7 @@ public class JavaEditor extends Editor { //platformPanel.setLayout(new BoxLayout(platformPanel, BoxLayout.X_AXIS)); platformPanel.add(windowsButton); platformPanel.add(Box.createHorizontalStrut(6)); - platformPanel.add(macosxButton); + platformPanel.add(macosButton); platformPanel.add(Box.createHorizontalStrut(6)); platformPanel.add(linuxButton); platformPanel.setBorder(new TitledBorder(Language.text("export.platforms"))); @@ -824,39 +824,42 @@ public class JavaEditor extends Editor { String platformName = null; if (Platform.isMacOS()) { - platformName = "Mac OS X"; + platformName = "macOS"; } else if (Platform.isWindows()) { platformName = "Windows (" + Platform.getNativeBits() + "-bit)"; } else if (Platform.isLinux()) { platformName = "Linux (" + Platform.getNativeBits() + "-bit)"; } - boolean embed = Preferences.getBoolean("export.application.embed_java"); - final String embedWarning = - "
" + -// "" + + final boolean embed = + Preferences.getBoolean("export.application.embed_java"); + final String JDK_DOWNLOAD = "https://adoptopenjdk.net/"; + final String warning1 = + "
"; + final String warning2a = "Embedding Java will make the " + platformName + " application " + "larger, but it will be far more likely to work. " + - "Users on other platforms will need to " + - "install Java " + PApplet.javaPlatform + "."; - final String nopeWarning = - "
" + -// "" + - "Users on all platforms will have to install the latest " + - "version of Java " + PApplet.javaPlatform + - " from http://java.com/download. " + - "
 "; - //"from java.com/download."; + "Users on other platforms will need to "; + final String warning2b = + "Users will need to "; + final String warning3 = + "install OpenJDK " + + PApplet.javaPlatform + "."; +// "
 "; + final String embedWarning = warning1 + warning2a + warning3; + final String nopeWarning = warning1 + warning2b + warning3; + final JLabel warningLabel = new JLabel(embed ? embedWarning : nopeWarning); warningLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent event) { - Platform.openURL("http://java.com/download"); + Platform.openURL(JDK_DOWNLOAD); } }); warningLabel.setBorder(new EmptyBorder(3, 13 + indent, 3, 13)); final JCheckBox embedJavaButton = - new JCheckBox(Language.text("export.embed_java.for") + " " + platformName); + //new JCheckBox(Language.text("export.embed_java.for") + " " + platformName); + new JCheckBox(Language.interpolate("export.include_java", platformName)); embedJavaButton.setSelected(embed); embedJavaButton.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { @@ -885,9 +888,10 @@ public class JavaEditor extends Editor { // gatekeeper: http://support.apple.com/kb/ht5290 // for developers: https://developer.apple.com/developer-id/ + final String APPLE_URL = "https://developer.apple.com/developer-id/"; String thePain = //"" + - "In recent versions of OS X, Apple has introduced the \u201CGatekeeper\u201D system, " + + "In recent versions of macOS, Apple has introduced the \u201CGatekeeper\u201D system, " + "which makes it more difficult to run applications like those exported from Processing. "; if (new File("/usr/bin/codesign_allocate").exists()) { @@ -899,12 +903,11 @@ public class JavaEditor extends Editor { } else { thePain += "Gatekeeper requires applications to be \u201Csigned\u201D, or they will be reported as damaged. " + - "To prevent this message, install Xcode (and the Command Line Tools) from the App Store, or visit " + - "System Preferences \u2192 Security & Privacy and select Allow apps downloaded from: anywhere. "; + "To prevent this message, install Xcode (and the Command Line Tools) from the App Store. "; } thePain += "To avoid the messages entirely, manually code sign your app. " + - "For more information: https://developer.apple.com/developer-id/"; + "For more information: " + APPLE_URL + ""; // xattr -d com.apple.quarantine thesketch.app diff --git a/todo.txt b/todo.txt index a9f1f3d32..39554d6a6 100755 --- a/todo.txt +++ b/todo.txt @@ -21,14 +21,23 @@ X drop '64' from the folder name X export.txt error "big fat lie" spew on export X was including all dll and so files as if they'd been extracted X also several .jar files from other platforms included -_ the "embed Java" shouldn't be available unless the current platform is selected -_ update text to macOS instead of Mac OS X -_ install Java 11 should link to OpenJDK site +o the "embed Java" shouldn't be available unless the current platform is selected +X changed text to be a little clearer +X export.embed_java.for changed to export.include_java +X update text to macOS instead of Mac OS X +X install Java 11 should link to OpenJDK site _ get rid of extra chatter with windows version: Compiling resources Linking Successfully created /Users/fry/Desktop/sketch_200925b/application.windows64/sketch_200925b.exe +_ launch4j warnings +WARNING: An illegal reflective access operation has occurred +WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/Users/fry/coconut/processing4/build/macosx/work/Processing.app/Contents/Java/modes/java/application/launch4j/lib/xstream.jar) to field java.util.Properties.defaults +WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields +WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations +WARNING: All illegal access operations will be denied in a future release + contribs X Updates and fixes for PDE_pt.properties (Portugese translation)