Skip to content

Commit 6ee8fc8

Browse files
committed
Modified how ContributionManager is initialized. Changed how panels store information on contributions.
1 parent fbc70aa commit 6ee8fc8

6 files changed

Lines changed: 409 additions & 558 deletions

File tree

app/src/processing/app/Base.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ public Base(String[] args) {
223223
Mode javaScriptMode = new JavaScriptMode(this, getContentFile("modes/javascript"));
224224
modeList = new Mode[] { defaultMode, androidMode, javaScriptMode };
225225
// modeList = new Mode[] { defaultMode, androidMode };
226+
227+
libraryManagerFrame = new ContributionManager();
226228

227229
// Get the sketchbook path, and make sure it's set properly
228230
determineSketchbookFolder();
@@ -1404,12 +1406,10 @@ public void handlePrefs() {
14041406
* Show the library installer window.
14051407
*/
14061408
public void handleAddOrRemoveLibrary() {
1407-
if (libraryManagerFrame == null) libraryManagerFrame = new ContributionManager(activeEditor);
14081409
libraryManagerFrame.showFrame(activeEditor);
14091410
}
14101411

14111412
public void handleShowUpdates() {
1412-
if (libraryManagerFrame == null) libraryManagerFrame = new ContributionManager(activeEditor);
14131413
libraryManagerFrame.showFrame(activeEditor);
14141414
libraryManagerFrame.setFilterText("has:updates");
14151415
}
@@ -1419,7 +1419,6 @@ public void handleShowUpdates() {
14191419
* user. Returns the number of libraries installed.
14201420
*/
14211421
public boolean handleConfirmAndInstallLibrary(File libFile) {
1422-
if (libraryManagerFrame == null) libraryManagerFrame = new ContributionManager(activeEditor);
14231422
return libraryManagerFrame.confirmAndInstallLibrary(activeEditor, libFile) != null;
14241423
}
14251424

app/src/processing/app/Contribution.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,11 @@ public static abstract class ContributionInfo implements Comparable<Contribution
5353
protected String sentence; // Write graphics to PDF files.
5454
protected String paragraph; // <paragraph length description for site>
5555
protected int version; // 102
56+
protected int latestVersion; // 103
5657
protected String prettyVersion; // "1.0.2"
5758

5859
protected String link = "";
5960

60-
protected ContributionInfo advertisedVersion;
61-
6261
public static class Author {
6362
public String name;
6463

@@ -83,13 +82,9 @@ public static enum ContributionType {
8382
* installed
8483
*/
8584
public abstract Contribution getContribution();
86-
87-
public void setAdvertisedVersion(ContributionInfo advertisedInfo) {
88-
advertisedVersion = advertisedInfo;
89-
}
90-
85+
9186
public boolean hasUpdates() {
92-
return advertisedVersion != null && advertisedVersion.version > version;
87+
return latestVersion > version && link != null;
9388
}
9489

9590
}

0 commit comments

Comments
 (0)