diff --git a/app/src/processing/app/contrib/ContributionListing.java b/app/src/processing/app/contrib/ContributionListing.java index 2ff6f8850..1f2a8a17b 100644 --- a/app/src/processing/app/contrib/ContributionListing.java +++ b/app/src/processing/app/contrib/ContributionListing.java @@ -35,19 +35,17 @@ import processing.data.StringDict; public class ContributionListing { // Stable URL that will redirect to wherever we're hosting the file - static final String LISTING_URL = - "http://download.processing.org/contribs"; - //"http://download.processing.org/contribs.txt"; + static final String LISTING_URL = "http://download.processing.org/contribs"; static final String LOCAL_FILENAME = "contribs.txt"; static volatile ContributionListing singleInstance; File listingFile; - ArrayList listeners; - ArrayList advertisedContributions; + List listeners; + List advertisedContributions; Map> librariesByCategory; public Map librariesByImportHeader; - ArrayList allContributions; + List allContributions; boolean hasDownloadedLatestList; boolean hasListDownloadFailed; ReentrantLock downloadingListingLock; @@ -444,6 +442,7 @@ public class ContributionListing { } + /* boolean hasUpdates() { for (Contribution info : allContributions) { if (hasUpdates(info)) { @@ -452,6 +451,32 @@ public class ContributionListing { } return false; } + */ + + + /** + * @return The number of contributions that have available updates. + */ + int countUpdates(Base base) { + int count = 0; + for (ModeContribution mc : base.getModeContribs()) { + if (hasUpdates(mc)) { + count++; + } + } + for (Library lib : base.getActiveEditor().getMode().contribLibraries) { + if (hasUpdates(lib)) { + count++; + } + } + for (ToolContribution tc : base.getActiveEditor().getToolContribs()) { + if (hasUpdates(tc)) { + count++; + } + } + return count; + } + boolean hasUpdates(Base base) { for (ModeContribution mc : base.getModeContribs()) { diff --git a/app/src/processing/app/contrib/ContributionManagerDialog.java b/app/src/processing/app/contrib/ContributionManagerDialog.java index 1a3ac1b77..02c55dbac 100644 --- a/app/src/processing/app/contrib/ContributionManagerDialog.java +++ b/app/src/processing/app/contrib/ContributionManagerDialog.java @@ -39,12 +39,8 @@ import processing.app.ui.Editor; import processing.app.ui.Toolkit; /** - * - * @author akarshit - * * This class is the main Contribution Manager Dialog. * It contains all the contributions tab and the update tab. - * */ public class ContributionManagerDialog { static final String ANY_CATEGORY = Language.text("contrib.all"); @@ -78,12 +74,14 @@ public class ContributionManagerDialog { } + /* public boolean hasUpdates() { return toolsContributionTab.hasUpdates() || librariesContributionTab.hasUpdates() || examplesContributionTab.hasUpdates() || modesContributionTab.hasUpdates(); } + */ public boolean hasUpdates(Base base) { diff --git a/app/src/processing/app/contrib/ContributionTab.java b/app/src/processing/app/contrib/ContributionTab.java index 46c27a8d2..d7f59c65a 100644 --- a/app/src/processing/app/contrib/ContributionTab.java +++ b/app/src/processing/app/contrib/ContributionTab.java @@ -93,9 +93,11 @@ public class ContributionTab { } + /* public boolean hasUpdates() { return contribListing.hasUpdates(); } + */ public boolean hasUpdates(Base base) { diff --git a/core/todo.txt b/core/todo.txt index 664333a6a..46ec4c8ed 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -6,10 +6,8 @@ X make PFont.size protected again X https://github.com/processing/processing/issues/3519 X fix problem with JAR loading inside createInputRaw() o https://github.com/processing/processing/pull/3514 - -_ are we clear on sketchPath() for OS X? -_ working dir (user.dir?) returns home dir, not app dir in Oracle Java -_ could add -Dapp.root=$APP_ROOT and get via System.getProperty("app.root") +X remove 'contrib updates available' dialog box for now +X new version coming soon in the UI opengl X Remove size() from setup() when copying to settings() @@ -69,6 +67,7 @@ X https://github.com/processing/processing/issues/2483 X Device parsing on Linux is incorrect X https://github.com/processing/processing/issues/3532 + docs _ note that full screen and present are now different _ on Export to Application, this has an impact @@ -88,6 +87,9 @@ _ use the BufferStrategy directly from the Frame object? _ might fix performance issues w/ Presentation mode _ sketch placement (window insets) not properly set on Linux _ https://github.com/processing/processing/issues/2063 +_ are we clear on sketchPath() for OS X? +_ working dir (user.dir?) returns home dir, not app dir in Oracle Java +_ could add -Dapp.root=$APP_ROOT and get via System.getProperty("app.root") javafx