mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Merge pull request #1203 from catilac/beta-welcome-logic
Display Welcome to Beta once per revision
This commit is contained in:
@@ -35,6 +35,7 @@ import processing.app.ui.WelcomeToBeta;
|
||||
import processing.core.PApplet;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Threaded class to check for updates in the background.
|
||||
* <p/>
|
||||
@@ -112,6 +113,7 @@ public class UpdateCheck {
|
||||
System.getProperty("os.arch"));
|
||||
|
||||
int latest = readInt(LATEST_URL + "?" + info);
|
||||
int revision = Base.getRevision();
|
||||
|
||||
String lastString = Preferences.get("update.last");
|
||||
long now = System.currentTimeMillis();
|
||||
@@ -125,18 +127,19 @@ public class UpdateCheck {
|
||||
Preferences.set("update.last", String.valueOf(now));
|
||||
|
||||
if (base.activeEditor != null) {
|
||||
// boolean offerToUpdateContributions = true;
|
||||
|
||||
if (latest > Base.getRevision()) {
|
||||
if (latest > revision) {
|
||||
System.out.println("You are running Processing revision 0" +
|
||||
Base.getRevision() + ", the latest build is 0" +
|
||||
revision + ", the latest build is 0" +
|
||||
latest + ".");
|
||||
// Assume the person is busy downloading the latest version
|
||||
// offerToUpdateContributions = !promptToVisitDownloadPage();
|
||||
promptToVisitDownloadPage();
|
||||
}
|
||||
if(latest < Base.getRevision()){
|
||||
WelcomeToBeta.showWelcomeToBeta();
|
||||
|
||||
int lastBetaWelcomeSeen = Preferences.getInteger("update.beta_welcome");
|
||||
if(latest < revision && revision != lastBetaWelcomeSeen ) {
|
||||
WelcomeToBeta.showWelcomeToBeta();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.mikepenz.markdown.m2.markdownColor
|
||||
import com.mikepenz.markdown.m2.markdownTypography
|
||||
import com.mikepenz.markdown.model.MarkdownColors
|
||||
import com.mikepenz.markdown.model.MarkdownTypography
|
||||
import processing.app.Preferences
|
||||
import processing.app.Base.getRevision
|
||||
import processing.app.Base.getVersionName
|
||||
import processing.app.ui.theme.LocalLocale
|
||||
@@ -61,7 +62,10 @@ class WelcomeToBeta {
|
||||
val mac = SystemInfo.isMacFullWindowContentSupported
|
||||
SwingUtilities.invokeLater {
|
||||
JFrame(windowTitle).apply {
|
||||
val close = { dispose() }
|
||||
val close = {
|
||||
Preferences.set("update.beta_welcome", getRevision().toString())
|
||||
dispose()
|
||||
}
|
||||
rootPane.putClientProperty("apple.awt.transparentTitleBar", mac)
|
||||
rootPane.putClientProperty("apple.awt.fullWindowContent", mac)
|
||||
defaultCloseOperation = JFrame.DISPOSE_ON_CLOSE
|
||||
|
||||
@@ -76,6 +76,10 @@ theme.gradient.method = rgb
|
||||
# on how many people are using Processing)
|
||||
update.check = true
|
||||
|
||||
# default value for beta_welcome
|
||||
# -1 means no beta has been run
|
||||
update.beta_welcome = -1
|
||||
|
||||
# on windows, automatically associate .pde files with processing.exe
|
||||
platform.auto_file_type_associations = true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user