From 4e92343d0f262f982f99c6da7a2e9e296942db9e Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Mon, 8 Aug 2022 21:38:03 -0400 Subject: [PATCH] get the new welcome screen running --- app/src/processing/app/Base.java | 9 +++-- app/src/processing/app/ui/Welcome.java | 11 +++--- build/shared/lib/defaults.txt | 4 +-- build/shared/lib/welcome/index.html | 36 ++++--------------- java/src/processing/mode/java/JavaEditor.java | 3 +- 5 files changed, 20 insertions(+), 43 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index b9966a464..e0253bd09 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -348,6 +348,7 @@ public class Base { static private void handleWelcomeScreen(Base base) { + /* boolean sketchbookPrompt = false; if (Preferences.getBoolean("welcome.four.beta.show")) { // only ask once about split sketchbooks @@ -369,16 +370,18 @@ public class Base { } } } + */ // Needs to be shown after the first editor window opens, so that it // shows up on top, and doesn't prevent an editor window from opening. - if (Preferences.getBoolean("welcome.four.beta.show")) { + if (Preferences.getBoolean("welcome.four.show")) { try { - new Welcome(base, sketchbookPrompt); + //new Welcome(base, sketchbookPrompt); + new Welcome(base); } catch (IOException e) { Messages.showTrace("Unwelcoming", "Please report this error to\n" + - "https://github.com/processing/processing/issues", e, false); + "https://github.com/processing/processing4/issues", e, false); } } } diff --git a/app/src/processing/app/ui/Welcome.java b/app/src/processing/app/ui/Welcome.java index 6b70a8258..099087fc3 100644 --- a/app/src/processing/app/ui/Welcome.java +++ b/app/src/processing/app/ui/Welcome.java @@ -24,10 +24,7 @@ package processing.app.ui; import java.awt.Color; import java.awt.EventQueue; import java.awt.Font; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; import java.io.File; import java.io.IOException; @@ -49,7 +46,7 @@ public class Welcome { WebFrame view; - public Welcome(Base base, boolean sketchbook) throws IOException { + public Welcome(Base base) throws IOException { this.base = base; JComponent panel = Box.createHorizontalBox(); @@ -77,7 +74,7 @@ public class Welcome { button.addActionListener(e -> view.handleClose()); panel.add(button); - view = new WebFrame(getIndexFile(sketchbook), 425, panel) { + view = new WebFrame(getIndexFile(), 420, panel) { /* @Override public void handleSubmit(StringDict dict) { @@ -130,7 +127,7 @@ public class Welcome { } - static private File getIndexFile(boolean sketchbook) { + static private File getIndexFile() { String filename = "welcome/index.html"; // version when running from IntelliJ for editing @@ -169,7 +166,7 @@ public class Welcome { EventQueue.invokeLater(new Runnable() { public void run() { try { - new Welcome(null, true); + new Welcome(null); } catch (IOException e) { e.printStackTrace(); } diff --git a/build/shared/lib/defaults.txt b/build/shared/lib/defaults.txt index fe7951bcf..f6265357c 100644 --- a/build/shared/lib/defaults.txt +++ b/build/shared/lib/defaults.txt @@ -35,8 +35,8 @@ # Note that this path must exist already otherwise it won't see # the sketchbook folder, and will instead assume the sketchbook # has gone missing, and that it should instead use the default. -# In 3.0, the location has changed. -#sketchbook.path.three= +# In 4.0, the location has changed. +#sketchbook.path.four= # Whether or not to show the Welcome screen for 4.0 # (It's always available under Help → Welcome) diff --git a/build/shared/lib/welcome/index.html b/build/shared/lib/welcome/index.html index 36454d3a5..98de94e2e 100644 --- a/build/shared/lib/welcome/index.html +++ b/build/shared/lib/welcome/index.html @@ -1,27 +1,12 @@ - Welcome + Welcome to Processing 4 - - - - - - -
-

Welcome to Processing 4

-
- -

- If you're new to Processing, start with an example:
  +

+ If you're new to Processing, start with an example:

@@ -67,7 +52,7 @@

- Run the example, see what happens. Try changing something. Select a keyword in the code and navigate to Help → Find in Reference to learn about it. Select File → Examples for hundreds more. + Run the example; watch what happens. Modify the code. Select a keyword and navigate to Help → Find in Reference to learn about it. Open File → Examples for hundreds more.

@@ -78,17 +63,8 @@ Or if you're familiar with 4.0, you can read about revisions and updates in recent 4.0 releases.

-

- Processing 4.0 contains dozens of new features and hundreds of bug fixes and usability updates. -

- Have fun! +

+ And when you're ready, visit Tools → Theme Selector to choose your own color scheme for the environment. Not fond of sketch_220809a? You can also select an alternate sketch naming method in the Preferences window.

diff --git a/java/src/processing/mode/java/JavaEditor.java b/java/src/processing/mode/java/JavaEditor.java index a5ac0a782..efb37b180 100644 --- a/java/src/processing/mode/java/JavaEditor.java +++ b/java/src/processing/mode/java/JavaEditor.java @@ -283,7 +283,8 @@ public class JavaEditor extends Editor { item = new JMenuItem(Language.text("menu.help.welcome")); item.addActionListener(e -> { try { - new Welcome(base, Preferences.getSketchbookPath().equals(Preferences.getOldSketchbookPath())); + new Welcome(base); + //new Welcome(base, Preferences.getSketchbookPath().equals(Preferences.getOldSketchbookPath())); } catch (IOException ioe) { Messages.showWarning("Unwelcome Error", "Please report this error to\n" +