mirror of
https://github.com/processing/processing4.git
synced 2026-05-03 17:35:00 +02:00
Disabled Install & Update buttons if Internet isn't available
This commit is contained in:
@@ -44,6 +44,7 @@ public class ContributionListing {
|
||||
Map<String, List<Contribution>> librariesByCategory;
|
||||
ArrayList<Contribution> allContributions;
|
||||
boolean hasDownloadedLatestList;
|
||||
boolean hasListDownloadFailed;
|
||||
ReentrantLock downloadingListingLock;
|
||||
|
||||
|
||||
@@ -371,6 +372,8 @@ public class ContributionListing {
|
||||
hasDownloadedLatestList = true;
|
||||
setAdvertisedList(listingFile);
|
||||
}
|
||||
else
|
||||
hasListDownloadFailed = true;
|
||||
}
|
||||
downloadingListingLock.unlock();
|
||||
}
|
||||
@@ -436,6 +439,11 @@ public class ContributionListing {
|
||||
}
|
||||
|
||||
|
||||
boolean hasListDownloadFailed() {
|
||||
return hasListDownloadFailed;
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * @return a lowercase string with all non-alphabetic characters removed
|
||||
// */
|
||||
|
||||
@@ -761,8 +761,10 @@ class ContributionPanel extends JPanel {
|
||||
|
||||
if (contrib != null) {
|
||||
updateButton.setVisible((contribListing.hasUpdates(contrib) && !contrib.isUpdateFlagged() && !contrib.isDeletionFlagged()) || isUpdateInProgress);
|
||||
updateButton.setEnabled(!contribListing.hasListDownloadFailed());
|
||||
}
|
||||
installRemoveButton.setVisible(isSelected() || installRemoveButton.getText().equals(Language.text("contrib.remove")) || isUpdateInProgress);
|
||||
installRemoveButton.setEnabled(installRemoveButton.getText().equals(Language.text("contrib.remove")) ||!contribListing.hasListDownloadFailed());
|
||||
reorganizePaneComponents();
|
||||
|
||||
// for (JTextPane textPane : headerPaneSet) {
|
||||
|
||||
Reference in New Issue
Block a user