| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,15 +50,15 @@ public class UpdateCheck { | |||
| 50 | 50 | Base base; | |
| 51 | 51 | String downloadURL = "http://processing.org/download/latest.txt"; | |
| 52 | 52 | ||
| 53 | - static final long ONE_DAY = 24 * 60 * 60 * 1000; | ||
| 53 | + static final long ONE_DAY = 0;//24 * 60 * 60 * 1000; | ||
| 54 | 54 | ||
| 55 | 55 | ||
| 56 | 56 | public UpdateCheck(Base base) { | |
| 57 | 57 | this.base = base; | |
| 58 | 58 | new Thread(new Runnable() { | |
| 59 | 59 | public void run() { | |
| 60 | 60 | try { | |
| 61 | - Thread.sleep(30 * 1000); // give the PDE time to get rolling | ||
| 61 | + Thread.sleep(10 * 1000); // give the PDE time to get rolling | ||
| 62 | 62 | updateCheck(); | |
| 63 | 63 | } catch (Exception e) { | |
| 64 | 64 | // this can safely be ignored, too many instances where no net | |
@@ -122,13 +122,14 @@ public void updateCheck() throws Exception { | |||
| 122 | 122 | if (offerToUpdateContributions) { | |
| 123 | 123 | // Wait for xml file to be downloaded and updates to come in. | |
| 124 | 124 | // (this should really be handled better). | |
| 125 | + base.rebuildContribModes(); | ||
| 125 | 126 | Thread.sleep(5 * 1000); | |
| 126 | 127 | if ((!base.libraryManagerFrame.hasAlreadyBeenOpened() && | |
| 127 | - base.libraryManagerFrame.hasUpdates()) || | ||
| 128 | + base.libraryManagerFrame.hasUpdates(base)) || | ||
| 128 | 129 | (!base.toolManagerFrame.hasAlreadyBeenOpened() && | |
| 129 | - base.toolManagerFrame.hasUpdates()) || | ||
| 130 | + base.toolManagerFrame.hasUpdates(base)) || | ||
| 130 | 131 | (!base.modeManagerFrame.hasAlreadyBeenOpened() && | |
| 131 | - base.modeManagerFrame.hasUpdates())) { | ||
| 132 | + base.modeManagerFrame.hasUpdates(base))) { | ||
| 132 | 133 | promptToOpenContributionManager(); | |
| 133 | 134 | } | |
| 134 | 135 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,6 +27,8 @@ | |||
| 27 | 27 | import java.util.concurrent.locks.ReentrantLock; | |
| 28 | 28 | ||
| 29 | 29 | import processing.app.Base; | |
| 30 | + import processing.app.Editor; | ||
| 31 | + import processing.app.Library; | ||
| 30 | 32 | import processing.core.PApplet; | |
| 31 | 33 | ||
| 32 | 34 | ||
@@ -379,14 +381,41 @@ boolean hasUpdates() { | |||
| 379 | 381 | } | |
| 380 | 382 | return false; | |
| 381 | 383 | } | |
| 384 | + | ||
| 385 | + boolean hasUpdates(Base base) { | ||
| 386 | + System.out.println("here321"); | ||
| 387 | + try { | ||
| 388 | + System.out.println((base/*.getModeContribs()*/==null) ? "Null :(" : "what?!"); | ||
| 389 | + } | ||
| 390 | + catch (Exception e) | ||
| 391 | + { | ||
| 392 | + e.printStackTrace(); | ||
| 393 | + } | ||
| 394 | + System.out.println("Here too?!"); | ||
| 395 | + for (ModeContribution m : base.getModeContribs()) | ||
| 396 | + if (m.isInstalled()) { | ||
| 397 | + System.out.println(m.getName()); | ||
| 398 | + Contribution advertised = getAvailableContribution(m); | ||
| 399 | + if (advertised == null) { | ||
| 400 | + } | ||
| 401 | + else { | ||
| 402 | + System.out.println("Here2"); | ||
| 403 | + if (advertised.getVersion() > m.getVersion()) | ||
| 404 | + return true; | ||
| 405 | + } | ||
| 406 | + } | ||
| 407 | + return false; | ||
| 408 | + } | ||
| 382 | 409 | ||
| 383 | 410 | ||
| 384 | 411 | boolean hasUpdates(Contribution contribution) { | |
| 385 | 412 | if (contribution.isInstalled()) { | |
| 413 | + System.out.println("Here"); | ||
| 386 | 414 | Contribution advertised = getAvailableContribution(contribution); | |
| 387 | 415 | if (advertised == null) { | |
| 388 | 416 | return false; | |
| 389 | 417 | } | |
| 418 | + System.out.println("Here2"); | ||
| 390 | 419 | return advertised.getVersion() > contribution.getVersion(); | |
| 391 | 420 | } | |
| 392 | 421 | return false; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -74,6 +74,10 @@ public boolean hasUpdates() { | |||
| 74 | 74 | } | |
| 75 | 75 | ||
| 76 | 76 | ||
| 77 | + public boolean hasUpdates(Base base) { | ||
| 78 | + return contribListing.hasUpdates(base); | ||
| 79 | + } | ||
| 80 | + | ||
| 77 | 81 | public void showFrame(Editor editor) { | |
| 78 | 82 | this.editor = editor; | |
| 79 | 83 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments