Skip to content

Commit

Permalink
Merge pull request #3805 from Akarshit/master
Browse files Browse the repository at this point in the history
Update to a incompatible version is not possible
  • Loading branch information
benfry committed Sep 16, 2015
2 parents a0a7aba + 22928ff commit 43fd2b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion app/src/processing/app/contrib/ContributionListing.java
Expand Up @@ -515,7 +515,8 @@ boolean hasUpdates(Contribution contribution) {
if (advertised == null) {
return false;
}
return advertised.getVersion() > contribution.getVersion();
return advertised.getVersion() > contribution.getVersion()
&& advertised.isCompatible(Base.getRevision());
}
return false;
}
Expand Down
19 changes: 10 additions & 9 deletions app/src/processing/app/contrib/StatusPanel.java
Expand Up @@ -238,6 +238,16 @@ public void update(ContributionPanel panel) {
contributionListing.getLatestVersion(panel.getContrib());
String currentVersion = panel.getContrib().getPrettyVersion();

installButton.setEnabled(!panel.getContrib().isInstalled()
&& contributionListing.hasDownloadedLatestList()
&& panel.getContrib().isCompatible(Base.getRevision()));

if (installButton.isEnabled()) {
updateLabel.setText(latestVersion + " available");
} else {
updateLabel.setText(currentVersion + " installed");
}

if (latestVersion != null) {
latestVersion = "Update to " + latestVersion;
} else {
Expand All @@ -254,15 +264,6 @@ public void update(ContributionPanel panel) {
updateButton.setText("Update");
}

installButton.setEnabled(!panel.getContrib().isInstalled()
&& contributionListing.hasDownloadedLatestList()
&& panel.getContrib().isCompatible(Base.getRevision()));

if (installButton.isEnabled()) {
updateLabel.setText(currentVersion + " available");
} else {
updateLabel.setText(currentVersion + " installed");
}

removeButton.setEnabled(panel.getContrib().isInstalled());
progressBarPanel.add(panel.installProgressBar);
Expand Down

0 comments on commit 43fd2b1

Please sign in to comment.