Changeset 853 for java/AEInstaller2-Updater
- Timestamp:
- May 3, 2013, 3:34:53 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/gui/MainWin.java
r767 r853 110 110 111 111 class Updater extends SwingWorker<Status, Status> { 112 boolean uptodate = false; 112 113 113 114 @Override … … 136 137 int x = svn.checkSVN("http://svn.aei.oni2.net", 137 138 new File(Paths.getPrefsPath(), "bin")); 138 if (x != 0) { 139 // Update available, missing files or no WC yet 140 svn.updateWC("http://svn.aei.oni2.net", 141 new File(Paths.getPrefsPath(), "bin"), 142 new SVNUpdateListener() { 143 public void statusUpdate(int done, int total) { 144 publish(new Status(done, total)); 145 } 146 }); 139 switch (x) { 140 case -2: // No repos connection 141 break; 142 case 0: // Repos up to date 143 uptodate = true; 144 break; 145 case -1:// no WC yet 146 case 1:// Update available 147 case 2:// missing files 148 uptodate = svn.updateWC("http://svn.aei.oni2.net", 149 new File(Paths.getPrefsPath(), "bin"), 150 new SVNUpdateListener() { 151 public void statusUpdate(int done, int total) { 152 publish(new Status(done, total)); 153 } 154 }); 155 break; 156 } 157 if (!uptodate) { 158 JOptionPane 159 .showMessageDialog( 160 null, 161 "Perhaps you don't have a internet connection right now or\nyou have (not) entered (wrong) proxy data?", 162 "Updating AEI failed!", 163 JOptionPane.ERROR_MESSAGE); 164 System.exit(1); 147 165 } 148 166 } catch (Exception e) { … … 179 197 protected void done() { 180 198 super.done(); 181 step.setText("AEI is up to date"); 182 bar.setValue(1); 183 bar.setMaximum(1); 184 closeBtn.setEnabled(true); 199 if (uptodate) { 200 step.setText("AEI is up to date"); 201 bar.setValue(1); 202 bar.setMaximum(1); 203 closeBtn.setEnabled(true); 204 } 185 205 } 186 206 }
Note:
See TracChangeset
for help on using the changeset viewer.