Changeset 646 for AE/installer2/src/net/oni2/aeinstaller/gui/downloadwindow
- Timestamp:
- Jan 23, 2013, 12:43:13 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller/gui/downloadwindow
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/gui/downloadwindow/Downloader.java
r638 r646 31 31 private BuildResult result = SwingJavaBuilder.build(this, bundle); 32 32 33 private JLabel lblNameVal; 34 private JLabel lblIsDep; 33 35 private JLabel lblElapsedVal; 34 36 private JLabel lblRemainingVal; … … 37 39 private JLabel lblRateVal; 38 40 private JProgressBar progress; 39 41 40 42 private JButton btnAbort; 41 43 42 44 private ModDownloader downloader; 45 private TreeSet<Mod> dependencies = new TreeSet<Mod>(); 43 46 44 47 /** 45 48 * @param mods 46 49 * Mods to download 50 * @param dependencies 51 * List of mods that only are auto-resolved dependencies 47 52 */ 48 public Downloader(TreeSet<Mod> mods ) {53 public Downloader(TreeSet<Mod> mods, TreeSet<Mod> dependencies) { 49 54 super(); 50 55 51 56 setResizable(false); 52 57 setSize(500, (int) getSize().getHeight()); 58 59 if (dependencies != null) 60 this.dependencies = dependencies; 53 61 54 62 downloader = new ModDownloader(mods, this); … … 84 92 85 93 @Override 86 public void updateStatus(ModDownloader source, State state, int filesDown,87 int filesTotal, int bytesDown, int bytesTotal, int duration,88 int remaining, int speed) {94 public void updateStatus(ModDownloader source, Mod currentDownload, 95 State state, int filesDown, int filesTotal, int bytesDown, 96 int bytesTotal, int duration, int remaining, int speed) { 89 97 if (state == ModDownloader.State.FINISHED) { 90 98 close(); … … 92 100 if (state == State.LAST_FILE_DOWNLOADED) 93 101 btnAbort.setEnabled(false); 94 102 95 103 progress.setValue(bytesDown); 96 104 progress.setToolTipText(String.format("%d / %d files downloaded", 97 105 filesDown, filesTotal)); 106 107 if (currentDownload != null) { 108 lblNameVal.setText(currentDownload.getName()); 109 lblIsDep.setVisible(dependencies.contains(currentDownload)); 110 } else { 111 lblNameVal.setText(bundle.getString("unpacking")); 112 lblIsDep.setVisible(false); 113 } 98 114 99 115 lblElapsedVal.setText(formatTime(duration)); -
AE/installer2/src/net/oni2/aeinstaller/gui/downloadwindow/Downloader.yml
r605 r646 10 10 content: 11 11 - JButton(name=btnAbort, text=btnAbort.title, icon=img.stop, onAction=[confirm,close]) 12 - JLabel(name=lblName, text=lblName.title) 13 - JLabel(name=lblNameVal, font=14pt) 14 - JLabel(name=lblIsDep, text=lblIsDep.title, foreground=darkred, visible=false) 12 15 - JLabel(name=lblElapsed, text=lblElapsed.title) 13 16 - JLabel(name=lblElapsedVal) … … 23 26 - MigLayout: | 24 27 [grow] 28 lblName<,lblNameVal<,lblIsDep< [min] 25 29 lblElapsed=1,lblElapsedVal=2,lblRemaining=1,lblRemainingVal=2 [min] 26 30 lblDownloaded=1,lblDownloadedVal=2,lblTotal=1,lblTotalVal=2 [min]
Note:
See TracChangeset
for help on using the changeset viewer.