mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 13:49:18 +01:00
Merge pull request #3805 from Akarshit/master
Update to a incompatible version is not possible
This commit is contained in:
@@ -515,7 +515,8 @@ public class ContributionListing {
|
||||
if (advertised == null) {
|
||||
return false;
|
||||
}
|
||||
return advertised.getVersion() > contribution.getVersion();
|
||||
return advertised.getVersion() > contribution.getVersion()
|
||||
&& advertised.isCompatible(Base.getRevision());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -238,6 +238,16 @@ class StatusPanel extends JPanel {
|
||||
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 {
|
||||
@@ -254,15 +264,6 @@ class StatusPanel extends JPanel {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user