()
| 104 | |
| 105 | |
| 106 | public void updateCheck() throws IOException, InterruptedException { |
| 107 | String info = PApplet.urlEncode(getUpdateID() + "\t" + |
| 108 | PApplet.nf(Base.getRevision(), 4) + "\t" + |
| 109 | System.getProperty("java.version") + "\t" + |
| 110 | System.getProperty("java.vendor") + "\t" + |
| 111 | System.getProperty("os.name") + "\t" + |
| 112 | System.getProperty("os.version") + "\t" + |
| 113 | System.getProperty("os.arch")); |
| 114 | |
| 115 | int latest = readInt(LATEST_URL + "?" + info); |
| 116 | |
| 117 | String lastString = Preferences.get("update.last"); |
| 118 | long now = System.currentTimeMillis(); |
| 119 | if (lastString != null) { |
| 120 | long when = Long.parseLong(lastString); |
| 121 | if (now - when < ONE_DAY) { |
| 122 | // don't annoy the shit outta people |
| 123 | return; |
| 124 | } |
| 125 | } |
| 126 | Preferences.set("update.last", String.valueOf(now)); |
| 127 | |
| 128 | if (base.activeEditor != null) { |
| 129 | // boolean offerToUpdateContributions = true; |
| 130 | |
| 131 | if (latest > Base.getRevision()) { |
| 132 | System.out.println("You are running Processing revision 0" + |
| 133 | Base.getRevision() + ", the latest build is 0" + |
| 134 | latest + "."); |
| 135 | // Assume the person is busy downloading the latest version |
| 136 | // offerToUpdateContributions = !promptToVisitDownloadPage(); |
| 137 | promptToVisitDownloadPage(); |
| 138 | } |
| 139 | |
| 140 | /* |
| 141 | if (offerToUpdateContributions) { |
| 142 | // Wait for xml file to be downloaded and updates to come in. |
| 143 | // (this should really be handled better). |
| 144 | Thread.sleep(5 * 1000); |
| 145 | if ((!base.contributionManagerFrame.hasAlreadyBeenOpened() |
| 146 | && (base.contributionManagerFrame.hasUpdates(base)))){ |
| 147 | promptToOpenContributionManager(); |
| 148 | } |
| 149 | } |
| 150 | */ |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | |
| 155 | protected boolean promptToVisitDownloadPage() { |
no test coverage detected