Changeset 673 for AE/installer2/src/net/oni2/aeinstaller
- Timestamp:
- Feb 25, 2013, 5:52:49 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/AEInstaller.properties
r672 r673 1 1 appname=AE Installer 2 2 appversion=0.99 q2 appversion=0.99r -
AE/installer2/src/net/oni2/aeinstaller/backend/packages/unpack/Unpacker.java
r648 r673 119 119 120 120 zf = new ZipFile(zip); 121 121 122 122 if (target.exists()) 123 123 FileUtils.deleteDirectory(target); … … 145 145 if (!ze.isDirectory()) { 146 146 if (ze.getName().startsWith(pathStartName)) { 147 File targetFile = new File(target, ze 148 .getName().substring(pathStart)); 149 File parent = targetFile.getParentFile(); 150 parent.mkdirs(); 147 if (!(ze.getName().endsWith("aei.cfg") || ze 148 .getName().endsWith(".DS_Store"))) { 149 File targetFile = new File(target, ze 150 .getName().substring(pathStart)); 151 File parent = targetFile 152 .getParentFile(); 153 parent.mkdirs(); 151 154 152 InputStream in = zf.getInputStream(ze);155 InputStream in = zf.getInputStream(ze); 153 156 154 int read = 0; 155 byte[] data = new byte[1024]; 156 FileOutputStream fileOut = new FileOutputStream( 157 targetFile); 158 while ((read = in.read(data, 0, 1024)) != -1) { 159 fileOut.write(data, 0, read); 157 int read = 0; 158 byte[] data = new byte[1024]; 159 FileOutputStream fileOut = new FileOutputStream( 160 targetFile); 161 while ((read = in.read(data, 0, 1024)) != -1) { 162 fileOut.write(data, 0, read); 163 } 164 fileOut.close(); 160 165 } 161 fileOut.close();162 166 } 163 167 } -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
r672 r673 60 60 import net.oni2.aeinstaller.gui.corepackages.CorePackagesDialog; 61 61 import net.oni2.aeinstaller.gui.downloadwindow.Downloader; 62 import net.oni2.aeinstaller.gui.modtable. DownloadSizeListener;62 import net.oni2.aeinstaller.gui.modtable.ModInstallSelectionListener; 63 63 import net.oni2.aeinstaller.gui.modtable.EApplyFilterTo; 64 64 import net.oni2.aeinstaller.gui.modtable.ModSelectionListener; … … 80 80 */ 81 81 public class MainWin extends JFrame implements ApplicationListener, 82 DownloadSizeListener, ModSelectionListener {82 ModInstallSelectionListener, ModSelectionListener { 83 83 private static final long serialVersionUID = -4027395051382659650L; 84 84 … … 103 103 private JScrollPane scrollMods; 104 104 private ModTable tblMods; 105 private JLabel lblSelectedModsVal; 105 106 private JLabel lblDownloadSizeVal; 106 107 … … 147 148 148 149 getRootPane().setDefaultButton(btnInstall); 150 lblSelectedModsVal.setText("0"); 149 151 lblDownloadSizeVal.setText(SizeFormatter.format(0, 2)); 150 152 radAll.setSelected(true); … … 492 494 JOptionPane.ERROR_MESSAGE); 493 495 if (ex.getMessage().contains(".NET")) 494 JOptionPane.showMessageDialog(null, 496 JOptionPane.showMessageDialog( 497 null, 495 498 bundle.getString("dotNetNotFound.text"), 496 499 bundle.getString("dotNetNotFound.title"), … … 782 785 783 786 @Override 784 public void downloadSizeChanged(int newSize) { 787 public void modInstallSelectionChanged(int newSize, int newCount) { 788 lblSelectedModsVal.setText(String.valueOf(newCount)); 785 789 lblDownloadSizeVal.setText(SizeFormatter.format(newSize, 2)); 786 790 } -
AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.yml
r661 r673 64 64 - JButton(name=btnRevertSelection, icon=img.undo16, text=btnRevertSelection.text, toolTipText=btnRevertSelection.tooltip, onAction=[revertSelection]) 65 65 - JButton(name=btnInstall, icon=img.install, text=btnInstall.text, toolTipText=btnInstall.tooltip, onAction=[install,installExec,installDone]) 66 - JLabel(name=lblSelectedMods, text=lblSelectedMods.text) 67 - JLabel(name=lblSelectedModsVal) 66 68 - JLabel(name=lblDownloadSize, text=lblDownloadSize.text) 67 69 - JLabel(name=lblDownloadSizeVal) 68 70 - MigLayout: | 69 [min] [grow] 70 >lblModTypes cmbModTypes [min] 71 >lblShowOnly radAll,radOnline,radLocal [min] 72 >lblShowFilter txtShowFilter>,cmbShowFilterTo< [min] 73 scrollMods+* [grow] 74 >btnUnSelectAll+*,>btnRevertSelection,btnInstall [min] 75 lblDownloadSize+*,lblDownloadSizeVal [min] 71 [min] [grow] [min] 72 >lblModTypes cmbModTypes+* [min] 73 >lblShowOnly radAll+*,radOnline,radLocal [min] 74 >lblShowFilter txtShowFilter+*>,cmbShowFilterTo< [min] 75 scrollMods+* [grow] 76 >btnUnSelectAll+*,btnRevertSelection [min] 77 lblSelectedMods+2,lblSelectedModsVal >btnInstall+*+* [min] 78 lblDownloadSize+2,lblDownloadSizeVal [min] 76 79 - PackageInfoBox(name=pkgInfo) 77 80 - MigLayout: -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTable.java
r660 r673 38 38 import net.oni2.aeinstaller.backend.packages.Package; 39 39 import net.oni2.aeinstaller.backend.packages.Type; 40 import net.oni2.aeinstaller.gui.downloadwindow.Downloader; 40 41 41 42 /** … … 173 174 * Listener to add 174 175 */ 175 public void addDownloadSizeListener( DownloadSizeListener listener) {176 public void addDownloadSizeListener(ModInstallSelectionListener listener) { 176 177 model.addDownloadSizeListener(listener); 177 178 } … … 181 182 * Listener to remove 182 183 */ 183 public void removeDownloadSizeListener( DownloadSizeListener listener) {184 public void removeDownloadSizeListener(ModInstallSelectionListener listener) { 184 185 model.removeDownloadSizeListener(listener); 185 186 } … … 332 333 }); 333 334 popup.add(openDepotPage); 335 } 336 337 if (mod.getFile() != null) { 338 // Download package 339 JMenuItem downloadPackage = new JMenuItem( 340 bundle.getString("downloadPackage.text")); 341 downloadPackage.addActionListener(new ActionListener() { 342 @Override 343 public void actionPerformed(ActionEvent arg0) { 344 TreeSet<Package> toDo = new TreeSet<Package>(); 345 TreeSet<Package> deps = new TreeSet<Package>(); 346 toDo.add(mod); 347 Downloader dl = new Downloader(toDo, deps); 348 try { 349 dl.setVisible(true); 350 } finally { 351 dl.dispose(); 352 } 353 invalidate(); 354 repaint(); 355 } 356 }); 357 popup.add(downloadPackage); 334 358 } 335 359 -
AE/installer2/src/net/oni2/aeinstaller/gui/modtable/ModTableModel.java
r658 r673 29 29 private Vector<Boolean> install = new Vector<Boolean>(); 30 30 31 private HashSet< DownloadSizeListener> listeners = new HashSet<DownloadSizeListener>();31 private HashSet<ModInstallSelectionListener> listeners = new HashSet<ModInstallSelectionListener>(); 32 32 33 33 private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); … … 210 210 public void revertSelection() { 211 211 install.clear(); 212 int count = 0; 212 213 for (int i = 0; i < items.size(); i++) { 213 install.add(i, items.get(i).isInstalled()); 214 } 215 notifyDownloadSize(0); 214 boolean installed = items.get(i).isInstalled(); 215 install.add(i, installed); 216 if (installed) 217 count++; 218 } 219 notifyDownloadSize(0, count); 216 220 fireTableDataChanged(); 217 221 } … … 262 266 } 263 267 264 private void notifyDownloadSize(int size ) {265 for ( DownloadSizeListener dsl : listeners)266 dsl. downloadSizeChanged(size);268 private void notifyDownloadSize(int size, int count) { 269 for (ModInstallSelectionListener dsl : listeners) 270 dsl.modInstallSelectionChanged(size, count); 267 271 } 268 272 … … 274 278 275 279 int size = 0; 280 int count = 0; 276 281 for (int i = 0; i < items.size(); i++) { 277 282 if (install.get(i)) { 283 count++; 278 284 Package m = items.get(i); 279 285 if (!m.isLocalAvailable()) … … 281 287 } 282 288 } 283 notifyDownloadSize(size );289 notifyDownloadSize(size, count); 284 290 } 285 291 } … … 289 295 * Listener to receive download size changed events 290 296 */ 291 public void addDownloadSizeListener( DownloadSizeListener lis) {297 public void addDownloadSizeListener(ModInstallSelectionListener lis) { 292 298 listeners.add(lis); 293 299 } … … 297 303 * Listener to no longer receive download size changed events 298 304 */ 299 public void removeDownloadSizeListener( DownloadSizeListener lis) {305 public void removeDownloadSizeListener(ModInstallSelectionListener lis) { 300 306 listeners.remove(lis); 301 307 } -
AE/installer2/src/net/oni2/aeinstaller/localization/MainWin.properties
r672 r673 44 44 radLocal.text=Downloaded 45 45 lblShowFilter.text=Filter: 46 lblSelectedMods.text=Mods selected for installation: 46 47 lblDownloadSize.text=Size of files to download: 47 48 -
AE/installer2/src/net/oni2/aeinstaller/localization/ModTable.properties
r660 r673 20 20 openModFolder.text=Open mod folder 21 21 openDepotPage.text=Open Depot page in browser 22 downloadPackage.text=(Re)Download the package 22 23 deletePackage.text=Delete package locally 23 24
Note:
See TracChangeset
for help on using the changeset viewer.