Changeset 657 for AE/installer2/src/net
- Timestamp:
- Jan 29, 2013, 12:43:01 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/AEInstaller.properties
r656 r657 1 1 appname=AE Installer 2 2 appversion=0.99 h2 appversion=0.99i -
AE/installer2/src/net/oni2/aeinstaller/Images.properties
r652 r657 15 15 img.folder=/net/oni2/aeinstaller/images/open_icon_library/folder-open-3.png 16 16 img.update=/net/oni2/aeinstaller/images/open_icon_library/system-software-update-2.png 17 img.unSelect16=/net/oni2/aeinstaller/images/open_icon_library/select-2.png 17 18 18 19 img.ae=/net/oni2/aeinstaller/images/AElogo.png -
AE/installer2/src/net/oni2/aeinstaller/backend/oni/Installer.java
r655 r657 267 267 } 268 268 } 269 269 270 combineBinaryFiles(foldersOni, listener, log); 270 271 combineBSLFolders(mods, listener, log); -
AE/installer2/src/net/oni2/aeinstaller/backend/packages/Package.java
r648 r657 11 11 import java.net.URISyntaxException; 12 12 import java.util.HashSet; 13 14 import org.apache.commons.io.FileUtils; 13 15 14 16 import net.oni2.aeinstaller.backend.Paths; … … 82 84 } 83 85 86 private void clearLocalOnlyInfo() { 87 aeVersion = 0; 88 bslInstallType = EBSLInstallType.NORMAL; 89 90 dependencies = new HashSet<Integer>(); 91 incompatibilities = new HashSet<Integer>(); 92 unlockLevel = new HashSet<Integer>(); 93 94 exeFile = null; 95 workingDir = null; 96 iconFile = null; 97 } 98 84 99 /** 85 100 * Update information for local package existence … … 109 124 iconFile = mi.getIconFile(); 110 125 } else { 126 clearLocalOnlyInfo(); 111 127 System.err.println("No config found for mod folder: " 112 128 + getLocalPath().getPath()); … … 311 327 312 328 /** 329 * @return Get the depot Node 330 */ 331 public NodeMod getNode() { 332 return node; 333 } 334 335 /** 313 336 * @return Depot page URI 314 337 */ … … 398 421 } 399 422 423 /** 424 * Delete the local package folder 425 */ 426 public void deleteLocalPackage() { 427 if (getLocalPath().exists()) { 428 try { 429 FileUtils.deleteDirectory(getLocalPath()); 430 updateLocalData(); 431 } catch (IOException e) { 432 e.printStackTrace(); 433 } 434 } 435 } 436 400 437 @Override 401 438 public int compareTo(Package o) { -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r656 r657 145 145 tblMods.addModSelectionListener(this); 146 146 tblMods.addDownloadSizeListener(this); 147 147 148 148 lblDescriptionVal.setMargin(new Insets(-15, 0, 0, 0)); 149 149 } … … 174 174 @DoInBackground(progressMessage = "updateDepot.title", cancelable = false, indeterminateProgress = false) 175 175 private void execDepotUpdate(final BackgroundEvent evt) { 176 if (!Settings.getInstance().isOfflineMode() && !Settings.getInstance().isNoCacheUpdateMode()) { 176 if (!Settings.getInstance().isOfflineMode() 177 && !Settings.getInstance().isNoCacheUpdateMode()) { 177 178 long start = new Date().getTime(); 178 179 … … 200 201 if (Settings.getInstance().isOfflineMode()) { 201 202 if (evtSource != this) { 202 JOptionPane.showMessageDialog(this, 203 bundle.getString("offlineMode.text"), 204 bundle.getString("offlineMode.title"), 203 JOptionPane.showMessageDialog( 204 this, 205 SwingJavaBuilder.getConfig().getResource( 206 "offlineMode.text"), 207 SwingJavaBuilder.getConfig().getResource( 208 "offlineMode.title"), 205 209 JOptionPane.WARNING_MESSAGE); 206 210 } 207 211 } else { 208 TreeSet<Package> mods = PackageManager.getInstance().getUpdatableMods(); 212 TreeSet<Package> mods = PackageManager.getInstance() 213 .getUpdatableMods(); 209 214 TreeSet<Package> tools = PackageManager.getInstance() 210 215 .getUpdatableTools(); … … 447 452 tblMods.revertSelection(); 448 453 } 454 455 @SuppressWarnings("unused") 456 private void unSelectAll() { 457 tblMods.unSelectAll(); 458 } 449 459 450 460 @DoInBackground(progressMessage = "checkCorePackages.title", cancelable = false, indeterminateProgress = false) … … 482 492 } 483 493 } 484 evt.setProgressMessage(bundle 485 .getString("coreToolsInstall.title")); 486 Installer 487 .installTools(PackageManager.getInstance().getCoreTools()); 494 evt.setProgressMessage(bundle.getString("coreToolsInstall.title")); 495 Installer.installTools(PackageManager.getInstance().getCoreTools()); 488 496 } 489 497 } … … 520 528 toDownload.add(m); 521 529 } 522 if ( Settings.getInstance().isOfflineMode()) {530 if (toDownload.size() > 0 && Settings.getInstance().isOfflineMode()) { 523 531 installState = EInstallState.OFFLINE; 524 532 break; … … 536 544 } 537 545 } 538 HashMap<Package, HashSet<Package>> dependencies = PackageManager .getInstance()539 . checkDependencies(mods);546 HashMap<Package, HashSet<Package>> dependencies = PackageManager 547 .getInstance().checkDependencies(mods); 540 548 if (dependencies.size() > 0) { 541 549 for (HashSet<Package> hm : dependencies.values()) { … … 681 689 break; 682 690 case OFFLINE: 683 JOptionPane.showMessageDialog(this, 684 bundle.getString("offlineMode.text"), 685 bundle.getString("offlineMode.title"), 691 JOptionPane.showMessageDialog( 692 this, 693 SwingJavaBuilder.getConfig().getResource( 694 "offlineMode.text"), 695 SwingJavaBuilder.getConfig().getResource( 696 "offlineMode.title"), 686 697 JOptionPane.WARNING_MESSAGE); 687 698 break; -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.yml
r648 r657 59 59 - JScrollPane(name=scrollMods, vScrollBar=always, hScrollBar=never): 60 60 ModTable(name=tblMods, visible=false) 61 - JButton(name=btnUnSelectAll, icon=img.unSelect16, text=btnUnSelectAll.text, onAction=[unSelectAll]) 61 62 - JButton(name=btnRevertSelection, icon=img.undo16, text=btnRevertSelection.text, toolTipText=btnRevertSelection.tooltip, onAction=[revertSelection]) 62 63 - JButton(name=btnInstall, icon=img.install, text=btnInstall.text, toolTipText=btnInstall.tooltip, onAction=[install,installExec,installDone]) … … 65 66 - MigLayout: | 66 67 [grow] 67 lblModTypes<,cmbModTypes [min]68 lblShowOnly<,radAll,radOnline,radLocal [min]69 scrollMods [grow]70 >btn RevertSelection,btnInstall[min]71 lblDownloadSize,lblDownloadSizeVal [min]68 lblModTypes<,cmbModTypes [min] 69 lblShowOnly<,radAll,radOnline,radLocal [min] 70 scrollMods [grow] 71 >btnUnSelectAll,>btnRevertSelection,btnInstall [min] 72 lblDownloadSize,lblDownloadSizeVal [min] 72 73 - JPanel(name=panInfo): 73 74 - JLabel(name=lblTitle, text=lblTitle.text) -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTable.java
r648 r657 19 19 import javax.swing.JComponent; 20 20 import javax.swing.JMenuItem; 21 import javax.swing.JOptionPane; 21 22 import javax.swing.JPopupMenu; 22 23 import javax.swing.JTable; … … 42 43 .getBundle("net.oni2.aeinstaller.localization.ModTable"); 43 44 45 /** 46 * @author Christian Illy 47 */ 48 public enum ETableContentType { 49 /** 50 * Table showing mods 51 */ 52 MODS, 53 /** 54 * Table showing tools 55 */ 56 TOOLS, 57 /** 58 * Table showing core packages 59 */ 60 CORE 61 }; 62 44 63 private HashSet<ModSelectionListener> modSelListeners = new HashSet<ModSelectionListener>(); 45 64 46 65 private ModTableModel model; 47 66 private TableRowSorter<ModTableModel> sorter; 67 68 private ETableContentType contentType = ETableContentType.MODS; 48 69 49 70 /** … … 186 207 */ 187 208 public void setFilter(Type type, int downloadState) { 188 sorter.setRowFilter(new ModTableFilter(type, downloadState)); 209 sorter.setRowFilter(new ModTableFilter(type, downloadState, 210 contentType == ETableContentType.CORE, false)); 189 211 } 190 212 … … 203 225 } 204 226 } 227 } 228 229 /** 230 * Select/Unselect all currently visible items depending on the current 231 * state of selection 232 */ 233 public void unSelectAll() { 234 boolean isAll = true; 235 for (int i = 0; i < getRowCount(); i++) { 236 int modRow = convertRowIndexToModel(i); 237 boolean inst = (Boolean) model.getValueAt(modRow, 0); 238 if (!inst) { 239 isAll = false; 240 break; 241 } 242 } 243 244 for (int i = 0; i < getRowCount(); i++) { 245 int modRow = convertRowIndexToModel(i); 246 model.setValueAt(!isAll, modRow, 0); 247 } 248 invalidate(); 249 repaint(); 205 250 } 206 251 … … 267 312 } 268 313 314 if (mod.isLocalAvailable() 315 && contentType != ETableContentType.CORE) { 316 // Delete package folder item 317 JMenuItem deleteModFolder = new JMenuItem( 318 bundle.getString("deletePackage.text")); 319 deleteModFolder.addActionListener(new ActionListener() { 320 @Override 321 public void actionPerformed(ActionEvent arg0) { 322 if (mod.getNode() == null) { 323 JOptionPane.showMessageDialog( 324 null, 325 bundle.getString("deletePackageLocalOnly.text"), 326 bundle.getString("deletePackageLocalOnly.title"), 327 JOptionPane.INFORMATION_MESSAGE); 328 } else { 329 int res = JOptionPane.showConfirmDialog( 330 null, 331 bundle.getString("deletePackageConfirm.text"), 332 bundle.getString("deletePackageConfirm.title"), 333 JOptionPane.YES_NO_OPTION, 334 JOptionPane.WARNING_MESSAGE); 335 if (res == JOptionPane.YES_OPTION) { 336 mod.deleteLocalPackage(); 337 invalidate(); 338 repaint(); 339 } 340 } 341 } 342 }); 343 popup.add(deleteModFolder); 344 } 345 269 346 if (popup.getSubElements().length > 0) 270 347 popup.show(e.getComponent(), e.getX(), e.getY()); -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTableFilter.java
r648 r657 13 13 private int downloadState = 0; 14 14 15 private boolean showCorePackages = false; 16 private boolean showInvalidPlatform = false; 17 15 18 /** 16 19 * @param type … … 18 21 * @param downloadState 19 22 * Show only: 0 = all, 1 = online, 2 = downloaded 23 * @param showCorePackages 24 * Show core packages in table 25 * @param showInvalidPlatform 26 * Show packages not valid on this platform 20 27 */ 21 public ModTableFilter(Type type, int downloadState) { 28 public ModTableFilter(Type type, int downloadState, 29 boolean showCorePackages, boolean showInvalidPlatform) { 22 30 super(); 23 31 this.type = type; 24 32 this.downloadState = downloadState; 33 this.showCorePackages = showCorePackages; 34 this.showInvalidPlatform = showInvalidPlatform; 25 35 } 26 36 … … 28 38 public boolean include( 29 39 RowFilter.Entry<? extends ModTableModel, ? extends Integer> entry) { 30 Package mod = (Package) entry.getModel().getValueAt(entry.getIdentifier(), -1); 31 32 if (mod.isCorePackage()) 40 Package mod = (Package) entry.getModel().getValueAt( 41 entry.getIdentifier(), -1); 42 43 if (mod.isCorePackage() && !showCorePackages) 33 44 return false; 34 45 35 if (!mod.isValidOnPlatform() )46 if (!mod.isValidOnPlatform() && !showInvalidPlatform) 36 47 return false; 37 48 … … 47 58 break; 48 59 } 49 60 50 61 return result; 51 62 } -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTableModel.java
r651 r657 60 60 return res; 61 61 case 5: 62 if (mod.getNode() != null) 63 return sdf.format(new Date( 64 mod.getNode().getCreated() * 1000)); 65 else 66 return null; 67 case 6: 62 68 if (mod.getFile() != null) 63 69 return sdf.format(new Date( … … 83 89 return bundle.getString("mod.state"); 84 90 case 5: 91 return bundle.getString("mod.added"); 92 case 6: 85 93 return bundle.getString("mod.date"); 86 94 } … … 95 103 @Override 96 104 public int getColumnCount() { 97 return 6;105 return 7; 98 106 } 99 107 … … 112 120 return String.class; 113 121 case 5: 122 return String.class; 123 case 6: 114 124 return String.class; 115 125 } … … 153 163 break; 154 164 case 5: 155 w = 115; 165 w = 100; 166 col.setPreferredWidth(w); 167 col.setMinWidth(w); 168 col.setMaxWidth(w); 169 break; 170 case 6: 171 w = 100; 156 172 col.setPreferredWidth(w); 157 173 col.setMinWidth(w); -
AE/installer2/src/net/oni2/aeinstaller/localization/MainWin.properties
r656 r657 33 33 menu.manageToolsTooltip=Install/Remove Tools 34 34 35 btnUnSelectAll.text=(Un)select all 35 36 btnRevertSelection.text=Revert selection 36 37 btnRevertSelection.tooltip=Select mods which are currently installed -
AE/installer2/src/net/oni2/aeinstaller/localization/ModTable.properties
r651 r657 4 4 mod.creator=Creator 5 5 mod.state=State 6 mod.added=Added 6 7 mod.date=Last change 7 8 … … 14 15 openModFolder.text=Open mod folder 15 16 openDepotPage.text=Open Depot page in browser 17 deletePackage.text=Delete package locally 18 19 deletePackageLocalOnly.title=Local only package 20 deletePackageLocalOnly.text=This package seems not to be on the Depot.\nFor security reasons deleting this package through the AEI is forbidden. 21 22 deletePackageConfirm.title=Delete package folder 23 deletePackageConfirm.text=Do you really want to delete the downloaded package?
Note:
See TracChangeset
for help on using the changeset viewer.