From 96559dbb0a7f54cfb37a23483b0ae89c11f29ad9 Mon Sep 17 00:00:00 2001 From: Akarshit Wal Date: Wed, 16 Sep 2015 22:55:42 +0530 Subject: [PATCH 1/3] Revert "Update to a incompatible version is not possible" This reverts commit 4ecacefbded0bec10489a03b78ea84a31211d2a4. --- .../app/contrib/ContributionListing.java | 3 +-- .../processing/app/contrib/StatusPanel.java | 19 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/src/processing/app/contrib/ContributionListing.java b/app/src/processing/app/contrib/ContributionListing.java index 828272d06..ba2c3da1f 100644 --- a/app/src/processing/app/contrib/ContributionListing.java +++ b/app/src/processing/app/contrib/ContributionListing.java @@ -515,8 +515,7 @@ public class ContributionListing { if (advertised == null) { return false; } - return advertised.getVersion() > contribution.getVersion() - && advertised.isCompatible(Base.getRevision()); + return advertised.getVersion() > contribution.getVersion(); } return false; } diff --git a/app/src/processing/app/contrib/StatusPanel.java b/app/src/processing/app/contrib/StatusPanel.java index a53777ac6..1f011007d 100644 --- a/app/src/processing/app/contrib/StatusPanel.java +++ b/app/src/processing/app/contrib/StatusPanel.java @@ -238,16 +238,6 @@ 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 { @@ -264,6 +254,15 @@ 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); From 87db7c6febf74906213a2694747ac9e9f6bcdbfe Mon Sep 17 00:00:00 2001 From: Akarshit Wal Date: Fri, 18 Sep 2015 14:56:48 +0530 Subject: [PATCH 2/3] Revert "Revert "Update to a incompatible version is not possible"" This reverts commit 728a21a5571c82ea1eb94b141c2211f9306e06df. --- .../app/contrib/ContributionListing.java | 3 ++- .../processing/app/contrib/StatusPanel.java | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/src/processing/app/contrib/ContributionListing.java b/app/src/processing/app/contrib/ContributionListing.java index ba2c3da1f..828272d06 100644 --- a/app/src/processing/app/contrib/ContributionListing.java +++ b/app/src/processing/app/contrib/ContributionListing.java @@ -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; } diff --git a/app/src/processing/app/contrib/StatusPanel.java b/app/src/processing/app/contrib/StatusPanel.java index 1f011007d..a53777ac6 100644 --- a/app/src/processing/app/contrib/StatusPanel.java +++ b/app/src/processing/app/contrib/StatusPanel.java @@ -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); From dbbb0b8883a32aef0839b7e22a14ce5b193c780c Mon Sep 17 00:00:00 2001 From: Akarshit Wal Date: Fri, 18 Sep 2015 14:58:30 +0530 Subject: [PATCH 3/3] Removing all items before adding all --- app/src/processing/app/Base.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 216d0c776..fc865bfa3 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -660,7 +660,7 @@ public class Base { // return o1.getMenuTitle().compareTo(o2.getMenuTitle()); // } // }); - + toolsMenu.removeAll(); for (Tool tool : internalTools) { toolsMenu.add(createToolItem(tool)); }