Skip to content

Commit 9f588bd

Browse files
committed
Merge branch 'main' into welcome-screen
2 parents 33f45b5 + 467cee7 commit 9f588bd

File tree

22 files changed

+473
-310
lines changed

22 files changed

+473
-310
lines changed

app/ant/processing/app/ui/Welcome.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,18 @@
2121

2222
package processing.app.ui;
2323

24-
import java.awt.Color;
25-
import java.awt.EventQueue;
26-
import java.awt.Font;
24+
import processing.app.Base;
25+
import processing.app.Platform;
26+
import processing.app.Preferences;
27+
28+
import javax.swing.*;
29+
import javax.swing.border.EmptyBorder;
30+
import java.awt.*;
2731
import java.awt.event.ItemEvent;
2832
import java.io.File;
2933
import java.io.IOException;
3034

31-
import javax.swing.Box;
32-
import javax.swing.JButton;
33-
import javax.swing.JCheckBox;
34-
import javax.swing.JComponent;
35-
import javax.swing.border.EmptyBorder;
36-
37-
import processing.app.Base;
38-
import processing.app.Platform;
39-
import processing.app.Preferences;
35+
import static processing.app.ui.WelcomeSurveyKt.addSurveyToWelcomeScreen;
4036

4137

4238
public class Welcome {
@@ -47,6 +43,7 @@ public class Welcome {
4743
public Welcome(Base base) throws IOException {
4844
this.base = base;
4945

46+
var parent = Box.createVerticalBox();
5047
JComponent panel = Box.createHorizontalBox();
5148
//panel.setBackground(new Color(245, 245, 245));
5249
panel.setBackground(Color.WHITE);
@@ -71,11 +68,13 @@ public Welcome(Base base) throws IOException {
7168
button.setFont(Toolkit.getSansFont(14, Font.PLAIN));
7269
button.addActionListener(e -> view.handleClose());
7370
panel.add(button);
71+
parent.add(addSurveyToWelcomeScreen());
72+
parent.add(panel);
7473

7574
File indexFile = getIndexFile();
7675
if (indexFile == null) return; // giving up; error already printed
7776

78-
view = new WebFrame(getIndexFile(), 420, panel) {
77+
view = new WebFrame(getIndexFile(), 420, parent) {
7978
/*
8079
@Override
8180
public void handleSubmit(StringDict dict) {

app/src/main/resources/languages/PDE.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,9 @@ beta.window.title = Welcome to Beta
633633
beta.title = Thanks for testing this Processing Beta!
634634
beta.message = This preview release lets us gather feedback and fix issues before the final version. **Some features may not work as expected.** If you encounter problems, [please post on the forum](https://discourse.processing.org) or [open a GitHub issue](https://github.com/processing/processing4/issues).
635635
beta.button = Ok
636+
# Welcome
637+
welcome.survey.title=Take the Community Survey
638+
welcome.survey.description=Processing is free, open-source, and shaped by its community. Your answers help us focus on what matters most.
636639

637640
# ---------------------------------------
638641
# Color Chooser

app/src/main/resources/languages/PDE_ar.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,10 @@ update_check = تحديث
550550
update_check.updates_available.core = يوجد نسخة جديدة من بروسسنج جاهزة للتحميل. \nهل تود زيارة الموقع الرسمي لتحميلها؟
551551
update_check.updates_available.contributions = يوجد تحديثات متوفرة لبعض المشاركات المثبتة. \nهل تريد الذهاب إلى مدير المشاركات الآن؟
552552

553+
# ---------------------------------------
554+
# Welcome
555+
welcome.survey.title=شارك في استطلاع المجتمع (بالإنجليزية)
556+
welcome.survey.description=Processing مجاني ومفتوح المصدر ومشكّل من قبل مجتمعه. إجاباتك تساعدنا على التركيز على ما يهم أكثر.
553557

554558
# ---------------------------------------
555559
# Color Chooser

app/src/main/resources/languages/PDE_de.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,10 @@ update_check = Update
420420
update_check.updates_available.core = Eine neue Version von Processing ist verfügbar,\nsoll der Download-Bereich aufgerufen werden?
421421
update_check.updates_available.contributions = Es sind neue Updates von installierten Paketen verfügbar,\nsoll der Contribution Manager geöffnet werden?
422422

423+
# ---------------------------------------
424+
# Welcome
425+
welcome.survey.title=Nimm an der Community-Umfrage teil (auf Englisch)
426+
welcome.survey.description=Processing ist kostenlos, open source und von seiner Community geprägt. Deine Antworten helfen uns, die wichtigsten Schwerpunkte zu setzen.
423427

424428
# ---------------------------------------
425429
# Color Chooser

app/src/main/resources/languages/PDE_fr.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@ update_check = Mise à jour
502502
update_check.updates_available.core = Une nouvelle version de Processing est disponible, \nVoulez-vous visiter la page de téléchargement de Processing?
503503
update_check.updates_available.contributions = Il y a des mises à jour disponibles pour certaines des contributions installées, \nVoulez-vous ouvrir le gestionnaire de contributions?
504504

505+
# Welcome
506+
welcome.survey.title=Participez au sondage de la communauté (en anglais)
507+
welcome.survey.description=Processing est gratuit, open source et façonné par sa communauté. Vos réponses nous aident à nous concentrer sur ce qui compte le plus.
505508

506509
# ---------------------------------------
507510
# Color Chooser

app/src/main/resources/languages/PDE_it.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,11 @@ update_check = Aggiorna
546546
update_check.updates_available.core = Una nuova versione di Processing è disponibile,\nvuoi visitare la pagina di download del sito di Processing?
547547
update_check.updates_available.contributions = Ci sono aggiornamenti disponibili per alcuni dei contributi installati,\nvorresti aprire il gestore dei contributi ora?
548548

549+
# ---------------------------------------
550+
# Welcome
551+
welcome.survey.title=Partecipa al sondaggio della community (in inglese)
552+
welcome.survey.description=Processing è gratuito, open-source e plasmato dalla sua community. Le tue risposte ci aiutano a capire ciò che conta di più.
553+
549554
# ---------------------------------------
550555
# Color Chooser
551556

app/src/main/resources/languages/PDE_ja.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,11 @@ update_check = 更新
550550
update_check.updates_available.core = 新しいバージョンのProcessingが利用可能です。\nProcessingのダウンロードページにアクセスしますか?
551551
update_check.updates_available.contributions = There are updates available for some of the installed contributions,\nwould you like to open the the Contribution Manager now?
552552

553+
# ---------------------------------------
554+
# Welcome
555+
welcome.survey.title=コミュニティ調査にご協力ください(英語)
556+
welcome.survey.description=Processing は無料でオープンソースであり、コミュニティによって形作られています。あなたの回答は、私たちが何に注力すべきかを知る助けになります。
557+
553558

554559
# ---------------------------------------
555560
# Color Chooser

app/src/main/resources/languages/PDE_nl.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ update_check = Update
315315
update_check.updates_available.core = Een nieuwe versie van Processing is beschikbaar,\nwilt u de Processing download pagina bezoeken?
316316
update_check.updates_available.contributions = Er zijn updates beschikbaar voor sommige van de door u geïnstalleerde bijdragen,\nwilt u nu de Bijdragen Manager openen?
317317

318+
# ---------------------------------------
319+
# Welcome
320+
welcome.survey.title=Doe mee aan de community-enquête (in het Engels)
321+
welcome.survey.description=Processing is gratis, open-source en gevormd door de community. Jouw antwoorden helpen ons te focussen op wat het belangrijkst is.
322+
318323
# ---------------------------------------
319324
# Beta
320325
beta.window.title = Welkom bij Beta

app/src/main/resources/languages/PDE_zh-CN.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,4 +313,9 @@ warn.delete.sketch_last = 为了确保您的文件安全,Processing 不支持
313313
warn.delete.file = 你确定要删除 "%s" 吗?
314314
warn.delete.sketch_file = 你确定要删除 “%s” 吗?
315315
warn.cannot_change_mode.title = 无法切换模式
316-
warn.cannot_change_mode.body = 无法切换模式,\n因为 “%s” 模式与当前模式不兼容。
316+
warn.cannot_change_mode.body = 无法切换模式,\n因为 “%s” 模式与当前模式不兼容。
317+
318+
# ---------------------------------------
319+
# Welcome
320+
welcome.survey.title=参与社区调查(英文)
321+
welcome.survey.description=Processing 是免费的、开源的,并由社区共同塑造。你的回答将帮助我们关注最重要的事项。

app/src/processing/app/Base.java

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,29 +2206,54 @@ static public InputStream getLibStream(String filename) throws IOException {
22062206
* something similar on Windows, a dot folder on Linux.) Removed this as a
22072207
* preference for 3.0a3 because we need this to be stable, but adding back
22082208
* for 4.0 beta 4 so that folks can do 'portable' versions again.
2209+
*
2210+
* @deprecated use processing.utils.Settings.getFolder() instead, this method will invoke AWT
22092211
*/
22102212
static public File getSettingsFolder() {
2211-
File settingsFolder = null;
2212-
2213-
try {
2214-
settingsFolder = Platform.getSettingsFolder();
2215-
2216-
// create the folder if it doesn't exist already
2217-
if (!settingsFolder.exists()) {
2218-
if (!settingsFolder.mkdirs()) {
2219-
Messages.showError("Settings issues",
2220-
"Processing cannot run because it could not\n" +
2221-
"create a folder to store your settings at\n" +
2222-
settingsFolder, null);
2223-
}
2213+
var override = getSettingsOverride();
2214+
if (override != null) {
2215+
return override;
22242216
}
2225-
} catch (Exception e) {
2226-
Messages.showTrace("An rare and unknowable thing happened",
2227-
"Could not get the settings folder. Please report:\n" +
2228-
"http://github.com/processing/processing/issues/new",
2229-
e, true);
2230-
}
2231-
return settingsFolder;
2217+
try {
2218+
return processing.utils.Settings.getFolder();
2219+
} catch (processing.utils.Settings.SettingsFolderException e) {
2220+
switch (e.getType()) {
2221+
case COULD_NOT_CREATE_FOLDER -> Messages.showError("Settings issues",
2222+
"""
2223+
Processing cannot run because it could not
2224+
create a folder to store your settings at
2225+
""" + e.getMessage(), null);
2226+
case WINDOWS_APPDATA_NOT_FOUND -> Messages.showError("Settings issues",
2227+
"""
2228+
Processing cannot run because it could not
2229+
find the AppData or LocalAppData folder on your system.
2230+
""", null);
2231+
case MACOS_LIBRARY_FOLDER_NOT_FOUND -> Messages.showError("Settings issues",
2232+
"""
2233+
Processing cannot run because it could not
2234+
find the Library folder on your system.
2235+
""", null);
2236+
case LINUX_CONFIG_FOLDER_NOT_FOUND -> Messages.showError("Settings issues",
2237+
"""
2238+
Processing cannot run because either your
2239+
XDG_CONFIG_HOME or SNAP_USER_COMMON is set
2240+
but the folder does not exist.
2241+
""", null);
2242+
case LINUX_SUDO_USER_ERROR -> Messages.showError("Settings issues",
2243+
"""
2244+
Processing cannot run because it was started
2245+
with sudo and Processing could not resolve
2246+
the original users home directory.
2247+
""", null);
2248+
default -> Messages.showTrace("An rare and unknowable thing happened",
2249+
"""
2250+
Could not get the settings folder. Please report:
2251+
http://github.com/processing/processing4/issues/new
2252+
""",
2253+
e, true);
2254+
}
2255+
}
2256+
throw new RuntimeException("Unreachable code in Base.getSettingsFolder()");
22322257
}
22332258

22342259

0 commit comments

Comments
 (0)