Skip to content

Commit e73316b

Browse files
committed
Stage 1 complete: at least update manager opens
1 parent b4050e7 commit e73316b

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

app/src/processing/app/UpdateCheck.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public class UpdateCheck {
5050
Base base;
5151
String downloadURL = "http://processing.org/download/latest.txt";
5252

53-
static final long ONE_DAY = 24 * 60 * 60 * 1000;
53+
static final long ONE_DAY = 0;//24 * 60 * 60 * 1000;
5454

5555

5656
public UpdateCheck(Base base) {
5757
this.base = base;
5858
new Thread(new Runnable() {
5959
public void run() {
6060
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
6262
updateCheck();
6363
} catch (Exception e) {
6464
// this can safely be ignored, too many instances where no net
@@ -122,13 +122,14 @@ public void updateCheck() throws Exception {
122122
if (offerToUpdateContributions) {
123123
// Wait for xml file to be downloaded and updates to come in.
124124
// (this should really be handled better).
125+
base.rebuildContribModes();
125126
Thread.sleep(5 * 1000);
126127
if ((!base.libraryManagerFrame.hasAlreadyBeenOpened() &&
127-
base.libraryManagerFrame.hasUpdates()) ||
128+
base.libraryManagerFrame.hasUpdates(base)) ||
128129
(!base.toolManagerFrame.hasAlreadyBeenOpened() &&
129-
base.toolManagerFrame.hasUpdates()) ||
130+
base.toolManagerFrame.hasUpdates(base)) ||
130131
(!base.modeManagerFrame.hasAlreadyBeenOpened() &&
131-
base.modeManagerFrame.hasUpdates())) {
132+
base.modeManagerFrame.hasUpdates(base))) {
132133
promptToOpenContributionManager();
133134
}
134135
}

app/src/processing/app/contrib/ContributionListing.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import java.util.concurrent.locks.ReentrantLock;
2828

2929
import processing.app.Base;
30+
import processing.app.Editor;
31+
import processing.app.Library;
3032
import processing.core.PApplet;
3133

3234

@@ -379,14 +381,41 @@ boolean hasUpdates() {
379381
}
380382
return false;
381383
}
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+
}
382409

383410

384411
boolean hasUpdates(Contribution contribution) {
385412
if (contribution.isInstalled()) {
413+
System.out.println("Here");
386414
Contribution advertised = getAvailableContribution(contribution);
387415
if (advertised == null) {
388416
return false;
389417
}
418+
System.out.println("Here2");
390419
return advertised.getVersion() > contribution.getVersion();
391420
}
392421
return false;

app/src/processing/app/contrib/ContributionManagerDialog.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ public boolean hasUpdates() {
7474
}
7575

7676

77+
public boolean hasUpdates(Base base) {
78+
return contribListing.hasUpdates(base);
79+
}
80+
7781
public void showFrame(Editor editor) {
7882
this.editor = editor;
7983

0 commit comments

Comments
 (0)