| 321 |
|
} |
| 322 |
|
} |
| 323 |
|
|
| 324 |
< |
@DoInBackground(progressMessage = "doUpdate.title", cancelable = false, indeterminateProgress = false) |
| 325 |
< |
private void doUpdate(final BackgroundEvent evt) { |
| 324 |
> |
@SuppressWarnings("unused") |
| 325 |
> |
private void doUpdate() { |
| 326 |
|
if (execUpdates != null) { |
| 327 |
< |
// TODO |
| 328 |
< |
System.out.println("Update: " + execUpdates.toString()); |
| 329 |
< |
// TODO: install new tools if previously installed |
| 327 |
> |
Downloader dl = new Downloader(execUpdates); |
| 328 |
> |
try { |
| 329 |
> |
dl.setVisible(true); |
| 330 |
> |
if (dl.isFinished()) { |
| 331 |
> |
TreeSet<Integer> installed = Installer.getInstalledTools(); |
| 332 |
> |
TreeSet<Mod> tools = new TreeSet<Mod>(); |
| 333 |
> |
for (Mod m : execUpdates) |
| 334 |
> |
if (m.isTool() |
| 335 |
> |
&& installed.contains(m.getPackageNumber())) |
| 336 |
> |
tools.add(m); |
| 337 |
> |
if (tools.size() > 0) { |
| 338 |
> |
Installer.installTools(tools); |
| 339 |
> |
} |
| 340 |
> |
} |
| 341 |
> |
} finally { |
| 342 |
> |
dl.dispose(); |
| 343 |
> |
} |
| 344 |
|
} |
| 345 |
|
execUpdates = null; |
| 346 |
|
} |
| 427 |
|
|
| 428 |
|
@SuppressWarnings("unused") |
| 429 |
|
private void tools() { |
| 430 |
< |
// TODO method stub |
| 430 |
> |
// TODO: Open tools manager |
| 431 |
|
JOptionPane.showMessageDialog(this, "tools", "todo", |
| 432 |
|
JOptionPane.INFORMATION_MESSAGE); |
| 433 |
|
} |
| 448 |
|
if (m.getIconFile() != null && m.getIconFile().exists()) { |
| 449 |
|
ico = new ImageIcon(m.getIconFile().getPath()); |
| 450 |
|
} else { |
| 451 |
< |
URL icon = AEInstaller2.class.getResource("images/transparent.png"); |
| 451 |
> |
URL icon = AEInstaller2.class |
| 452 |
> |
.getResource("images/transparent.png"); |
| 453 |
|
ico = new ImageIcon(icon); |
| 454 |
|
} |
| 455 |
|
item.setAction(new AbstractAction(m.getName(), ico) { |