Changeset 603 for AE/installer2/src/net
- Timestamp:
- Jan 10, 2013, 5:25:51 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller
- Files:
-
- 1 added
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/AEInstaller2.java
r602 r603 21 21 import net.oni2.aeinstaller.backend.Settings.Platform; 22 22 import net.oni2.aeinstaller.backend.SizeFormatter; 23 import net.oni2.aeinstaller.backend.StuffToRefactorLater;24 23 import net.oni2.aeinstaller.backend.depot.DepotManager; 25 24 import net.oni2.aeinstaller.backend.oni.Installer; … … 128 127 System.out.println("TempPath: " + Paths.getTempPath()); 129 128 System.out.println("ValidPath: " 130 + StuffToRefactorLater.verifyRunningDirectory());129 + Installer.verifyRunningDirectory()); 131 130 System.out.println("Platform: " + Settings.getPlatform()); 132 131 System.out.println("Architect: " + Settings.getArchitecture()); … … 143 142 .getUsableSpace(), 3)); 144 143 145 if (! StuffToRefactorLater.verifyRunningDirectory()) {144 if (!Installer.verifyRunningDirectory()) { 146 145 JOptionPane.showMessageDialog(null, 147 146 basicBundle.getString("invalidPath.text"), -
AE/installer2/src/net/oni2/aeinstaller/backend/depot/DepotManager.java
r600 r603 87 87 88 88 // Get taxonomy vocabulary 89 listener.cacheUpdateProgress("Updating taxonomy vocabulary", 0, 100); 89 if (listener != null) 90 listener.cacheUpdateProgress("Updating taxonomy vocabulary", 0, 91 100); 90 92 page = 0; 91 93 do { … … 100 102 101 103 // Get taxonomy terms 102 listener.cacheUpdateProgress("Updating taxonomy terms", 0, 100); 104 if (listener != null) 105 listener.cacheUpdateProgress("Updating taxonomy terms", 0, 100); 103 106 page = 0; 104 107 do { … … 113 116 114 117 // Check nodes for new information 115 listener.cacheUpdateProgress("Checking for new/updated nodes", 1, 116 100); 118 if (listener != null) 119 listener.cacheUpdateProgress("Checking for new/updated nodes", 120 1, 100); 117 121 HashSet<Integer> nodesToUpdate = new HashSet<Integer>(); 118 122 page = 0; … … 142 146 143 147 // Check files for new stuff 144 listener.cacheUpdateProgress("Checking for new/updated files", 2, 145 100); 148 if (listener != null) 149 listener.cacheUpdateProgress("Checking for new/updated files", 150 2, 100); 146 151 HashSet<Integer> filesToUpdate = new HashSet<Integer>(); 147 152 page = 0; … … 168 173 // Update nodes with new information 169 174 for (int nid : nodesToUpdate) { 170 listener.cacheUpdateProgress("Updating nodes", step++, total); 175 if (listener != null) 176 listener.cacheUpdateProgress("Updating nodes", step++, 177 total); 171 178 172 179 ja = DrupalJSONQuery.getItem("node", nid, ""); … … 188 195 // Update new files 189 196 for (int fid : filesToUpdate) { 190 listener.cacheUpdateProgress("Updating files", step++, total); 197 if (listener != null) 198 listener.cacheUpdateProgress("Updating files", step++, 199 total); 191 200 192 201 ja = DrupalJSONQuery.getItem("file", fid, "&file_contents=0"); -
AE/installer2/src/net/oni2/aeinstaller/backend/depot/model/NodeMod.java
r600 r603 148 148 return Integer.parseInt(fields.get("package_number")); 149 149 } 150 151 /** 152 * @return Is this mod a tool? 153 */ 154 public boolean isTool() { 155 TaxonomyTerm tt = DepotManager.getInstance().getTaxonomyTerm( 156 DepotConfig.getTaxonomyName_ModType_Tool()); 157 return getTypes().contains(tt); 158 } 150 159 } -
AE/installer2/src/net/oni2/aeinstaller/backend/mods/Mod.java
r602 r603 13 13 import net.oni2.aeinstaller.backend.Settings; 14 14 import net.oni2.aeinstaller.backend.Settings.Platform; 15 import net.oni2.aeinstaller.backend.depot.DepotConfig;16 15 import net.oni2.aeinstaller.backend.depot.DepotManager; 17 16 import net.oni2.aeinstaller.backend.depot.model.NodeMod; … … 56 55 Type t = ModManager.getInstance().getTypeByName(tt.getName()); 57 56 types.add(t); 58 if (! t.getName().equals(DepotConfig.getTaxonomyName_ModType_Tool()))57 if (!nm.isTool()) 59 58 t.addEntry(this); 60 59 } … … 187 186 */ 188 187 public boolean isNewerAvailable() { 189 if ( node != null)190 return node.getUploads().firstElement().getTimestamp() > localTimestamp;188 if (file != null) 189 return file.getTimestamp() > localTimestamp; 191 190 else 192 191 return false; … … 261 260 public int getZipSize() { 262 261 return zipSize; 263 }264 265 /**266 * @return Depot Mod-Node267 */268 public NodeMod getNode() {269 return node;270 262 } 271 263 -
AE/installer2/src/net/oni2/aeinstaller/backend/mods/ModManager.java
r602 r603 10 10 11 11 import net.oni2.aeinstaller.backend.Paths; 12 import net.oni2.aeinstaller.backend.depot.DepotConfig;13 12 import net.oni2.aeinstaller.backend.depot.DepotManager; 14 13 import net.oni2.aeinstaller.backend.depot.model.NodeMod; … … 56 55 } 57 56 58 TaxonomyTerm toolTerm = DepotManager.getInstance().getTaxonomyTerm(59 DepotConfig.getTaxonomyName_ModType_Tool());60 57 for (NodeMod nm : DepotManager.getInstance().getModPackageNodes()) { 61 58 if (nm.getUploads().size() == 1) { 62 59 Mod m = new Mod(nm); 63 if (nm. getTypes().contains(toolTerm))60 if (nm.isTool()) 64 61 tools.put(m.getPackageNumber(), m); 65 62 else -
AE/installer2/src/net/oni2/aeinstaller/backend/oni/Installer.java
r602 r603 272 272 FileUtils.copyFile(keyConfVanilla, keyConfEdition); 273 273 274 // TODO: FileUtils.deleteDirectory(init); 274 FileUtils.deleteDirectory(init); 275 275 276 Date end = new Date(); 276 277 log.println("Initialization ended at " + sdf.format(end)); … … 384 385 } 385 386 } 387 388 /** 389 * Verify that the Edition is within a subfolder to vanilla Oni (..../Oni/Edition/AEInstaller) 390 * @return true if GDF can be found in the parent's parent-path 391 */ 392 public static boolean verifyRunningDirectory() { 393 return Paths.getVanillaGDF().exists() && Paths.getVanillaGDF().isDirectory(); 394 } 386 395 } -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r602 r603 71 71 private JLabel lblSubmitterVal; 72 72 private JLabel lblCreatorVal; 73 private JLabel lblFilesVal;74 73 private HTMLLinkLabel lblDescriptionVal; 75 74 … … 191 190 192 191 tblMods.setVisible(true); 193 DepotManager.getInstance().printStats();194 192 } catch (Exception e) { 195 193 e.printStackTrace(); … … 266 264 @DoInBackground(progressMessage = "mandatoryFiles.title", cancelable = false, indeterminateProgress = false) 267 265 private void checkMandatoryFiles(final BackgroundEvent evt) { 268 System.out.println("Tools:"); 269 for (Mod m : ModManager.getInstance().getTools()) { 270 System.out.format(" %05d %s", m.getPackageNumber(), m.getName()); 266 //TODO 267 System.out.println("Mandatory Tools:"); 268 for (Mod m : ModManager.getInstance().getMandatoryTools()) { 269 System.out.format(" %05d %15s - Local: %b - Update: %b", m.getPackageNumber(), m.getName(), m.isLocalAvailable(), m.isNewerAvailable()); 271 270 } 272 271 System.out.println(); 273 272 274 System.out.println("Mandatory tools:");275 for (Mod m : ModManager.getInstance().getMandatory Tools()) {276 System.out.format(" %05d % s", m.getPackageNumber(), m.getName());273 System.out.println("Mandatory Mods:"); 274 for (Mod m : ModManager.getInstance().getMandatoryMods()) { 275 System.out.format(" %05d %15s - Local: %b - Update: %b", m.getPackageNumber(), m.getName(), m.isLocalAvailable(), m.isNewerAvailable()); 277 276 } 278 277 } … … 305 304 lblSubmitterVal.setText(""); 306 305 lblCreatorVal.setText(""); 307 lblFilesVal.setText("");308 306 lblDescriptionVal.setText(""); 309 307 if (m != null) { 310 308 lblSubmitterVal.setText(m.getName()); 311 309 lblCreatorVal.setText(m.getCreator()); 312 if (m.getNode() != null) {313 lblFilesVal.setText(Integer.toString(m.getNode().getUploads()314 .size()));315 }316 310 lblDescriptionVal.setText(m.getDescription()); 317 311 } -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.yml
r602 r603 55 55 - JLabel(name=lblCreator, text=lblCreator.text) 56 56 - JLabel(name=lblCreatorVal) 57 - JLabel(name=lblFiles, text=lblFiles.text)58 - JLabel(name=lblFilesVal)59 57 - JLabel(name=lblDescription, text=lblDescription.text) 60 58 - JScrollPane(name=scrollDescription, vScrollBar=always, hScrollBar=asNeeded): … … 64 62 >lblSubmitter lblSubmitterVal [min] 65 63 >lblCreator lblCreatorVal [min] 66 >lblFiles lblFilesVal [min]67 64 >^lblDescription scrollDescription [grow] 68 65 - MigLayout:
Note:
See TracChangeset
for help on using the changeset viewer.