diff --git a/app/src/processing/app/UpdateCheck.java b/app/src/processing/app/UpdateCheck.java index fe98fab2b..fad5f4c59 100644 --- a/app/src/processing/app/UpdateCheck.java +++ b/app/src/processing/app/UpdateCheck.java @@ -50,7 +50,7 @@ public class UpdateCheck { Base base; String downloadURL = "http://processing.org/download/latest.txt"; - static final long ONE_DAY = 24 * 60 * 60 * 1000; + static final long ONE_DAY = 0;//24 * 60 * 60 * 1000; public UpdateCheck(Base base) { @@ -58,7 +58,7 @@ public class UpdateCheck { new Thread(new Runnable() { public void run() { try { - Thread.sleep(30 * 1000); // give the PDE time to get rolling + Thread.sleep(10 * 1000); // give the PDE time to get rolling updateCheck(); } catch (Exception e) { // this can safely be ignored, too many instances where no net @@ -122,13 +122,14 @@ public class UpdateCheck { if (offerToUpdateContributions) { // Wait for xml file to be downloaded and updates to come in. // (this should really be handled better). + base.rebuildContribModes(); Thread.sleep(5 * 1000); if ((!base.libraryManagerFrame.hasAlreadyBeenOpened() && - base.libraryManagerFrame.hasUpdates()) || + base.libraryManagerFrame.hasUpdates(base)) || (!base.toolManagerFrame.hasAlreadyBeenOpened() && - base.toolManagerFrame.hasUpdates()) || + base.toolManagerFrame.hasUpdates(base)) || (!base.modeManagerFrame.hasAlreadyBeenOpened() && - base.modeManagerFrame.hasUpdates())) { + base.modeManagerFrame.hasUpdates(base))) { promptToOpenContributionManager(); } } diff --git a/app/src/processing/app/contrib/ContributionListing.java b/app/src/processing/app/contrib/ContributionListing.java index 05531f63d..bd05f5cba 100644 --- a/app/src/processing/app/contrib/ContributionListing.java +++ b/app/src/processing/app/contrib/ContributionListing.java @@ -27,6 +27,8 @@ import java.util.*; import java.util.concurrent.locks.ReentrantLock; import processing.app.Base; +import processing.app.Editor; +import processing.app.Library; import processing.core.PApplet; @@ -379,14 +381,41 @@ public class ContributionListing { } return false; } + + boolean hasUpdates(Base base) { + System.out.println("here321"); + try { + System.out.println((base/*.getModeContribs()*/==null) ? "Null :(" : "what?!"); + } + catch (Exception e) + { + e.printStackTrace(); + } + System.out.println("Here too?!"); + for (ModeContribution m : base.getModeContribs()) + if (m.isInstalled()) { + System.out.println(m.getName()); + Contribution advertised = getAvailableContribution(m); + if (advertised == null) { + } + else { + System.out.println("Here2"); + if (advertised.getVersion() > m.getVersion()) + return true; + } + } + return false; + } boolean hasUpdates(Contribution contribution) { if (contribution.isInstalled()) { + System.out.println("Here"); Contribution advertised = getAvailableContribution(contribution); if (advertised == null) { return false; } + System.out.println("Here2"); return advertised.getVersion() > contribution.getVersion(); } return false; diff --git a/app/src/processing/app/contrib/ContributionManagerDialog.java b/app/src/processing/app/contrib/ContributionManagerDialog.java index 6cbe3b888..bc534faa9 100644 --- a/app/src/processing/app/contrib/ContributionManagerDialog.java +++ b/app/src/processing/app/contrib/ContributionManagerDialog.java @@ -74,6 +74,10 @@ public class ContributionManagerDialog { } + public boolean hasUpdates(Base base) { + return contribListing.hasUpdates(base); + } + public void showFrame(Editor editor) { this.editor = editor;