| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -450,9 +450,7 @@ public Base(String[] args) throws Exception { | |||
| 450 | 450 | } | |
| 451 | 451 | ||
| 452 | 452 | // check for updates | |
| 453 | - if (Preferences.getBoolean("update.check")) { //$NON-NLS-1$ | ||
| 454 | - new UpdateCheck(this); | ||
| 455 | - } | ||
| 453 | + new UpdateCheck(this); | ||
| 456 | 454 | } | |
| 457 | 455 | ||
| 458 | 456 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,7 @@ | |||
| 3 | 3 | /* | |
| 4 | 4 | Part of the Processing project - http://processing.org | |
| 5 | 5 | ||
| 6 | - Copyright (c) 2005-12 Ben Fry and Casey Reas | ||
| 6 | + Copyright (c) 2005-15 Ben Fry and Casey Reas | ||
| 7 | 7 | ||
| 8 | 8 | This program is free software; you can redistribute it and/or modify | |
| 9 | 9 | it under the terms of the GNU General Public License as published by | |
@@ -43,9 +43,12 @@ | |||
| 43 | 43 | * to check for updates. Also included is the operating system and | |
| 44 | 44 | * its version and the version of Java being used to run Processing. | |
| 45 | 45 | * <P> | |
| 46 | - * The ID number also helps provide us a general idea of how many | ||
| 47 | - * people are using Processing, which helps us when writing grant | ||
| 48 | - * proposals and that kind of thing so that we can keep Processing free. | ||
| 46 | + * Aside from the privacy invasion of knowing that an anonymous Processing | ||
| 47 | + * user opened the software at one time during a 24-hour period somewhere | ||
| 48 | + * in the world, we use the ID number to give us a general idea of how many | ||
| 49 | + * people are using Processing, which helps us when writing grant proposals | ||
| 50 | + * and that kind of thing so that we can keep Processing free. The numbers | ||
| 51 | + * are also sometimes used in ugly charts when Ben and Casey present. | ||
| 49 | 52 | */ | |
| 50 | 53 | public class UpdateCheck { | |
| 51 | 54 | private final Base base; | |
@@ -55,22 +58,27 @@ public class UpdateCheck { | |||
| 55 | 58 | ||
| 56 | 59 | static private final long ONE_DAY = 24 * 60 * 60 * 1000; | |
| 57 | 60 | ||
| 61 | + static boolean allowed; | ||
| 62 | + | ||
| 58 | 63 | ||
| 59 | 64 | public UpdateCheck(Base base) { | |
| 60 | 65 | this.base = base; | |
| 61 | - new Thread(new Runnable() { | ||
| 62 | - public void run() { | ||
| 63 | - try { | ||
| 64 | - Thread.sleep(20 * 1000); // give the PDE time to get rolling | ||
| 65 | - updateCheck(); | ||
| 66 | - | ||
| 67 | - } catch (Exception e) { | ||
| 68 | - // This can safely be ignored, too many situations where no net | ||
| 69 | - // connection is available that behave in strange ways. | ||
| 70 | - // Covers likely IOException, InterruptedException, and any others. | ||
| 66 | + | ||
| 67 | + if (isAllowed()) { | ||
| 68 | + new Thread(new Runnable() { | ||
| 69 | + public void run() { | ||
| 70 | + try { | ||
| 71 | + Thread.sleep(5 * 1000); // give the PDE time to get rolling | ||
| 72 | + updateCheck(); | ||
| 73 | + | ||
| 74 | + } catch (Exception e) { | ||
| 75 | + // This can safely be ignored, too many situations where no net | ||
| 76 | + // connection is available that behave in strange ways. | ||
| 77 | + // Covers likely IOException, InterruptedException, and any others. | ||
| 78 | + } | ||
| 71 | 79 | } | |
| 72 | - } | ||
| 73 | - }, "Update Checker").start(); | ||
| 80 | + }, "Update Checker").start(); | ||
| 81 | + } | ||
| 74 | 82 | } | |
| 75 | 83 | ||
| 76 | 84 | ||
@@ -186,4 +194,10 @@ protected int readInt(String filename) throws IOException { | |||
| 186 | 194 | BufferedReader reader = new BufferedReader(isr); | |
| 187 | 195 | return Integer.parseInt(reader.readLine()); | |
| 188 | 196 | } | |
| 197 | + | ||
| 198 | + | ||
| 199 | + static public boolean isAllowed() { | ||
| 200 | + // Disable update checks for the paranoid | ||
| 201 | + return Preferences.getBoolean("update.check"); | ||
| 202 | + } | ||
| 189 | 203 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -471,6 +471,14 @@ protected void updateContributionListing() { | |||
| 471 | 471 | ||
| 472 | 472 | ||
| 473 | 473 | protected void downloadAndUpdateContributionListing(Base base) { | |
| 474 | + if (!UpdateCheck.isAllowed()) { | ||
| 475 | + // A dialog box seems to in-your-face, but not saying anything seems | ||
| 476 | + // problematic. This isn't a great option but it'll do for beta 1. | ||
| 477 | + System.out.println("Cannot update contributions because " + | ||
| 478 | + "updates are disabled in preferences."); | ||
| 479 | + return; // update checking phones home! IT! PHONES! HOME! | ||
| 480 | + } | ||
| 481 | + | ||
| 474 | 482 | retryConnectingButton.setEnabled(false); | |
| 475 | 483 | status.setMessage(Language.text("contrib.status.downloading_list")); | |
| 476 | 484 | contribListing.downloadAvailableList(base, new ContribProgressBar(progressBar) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments