| 102 |
|
|
| 103 |
|
private JButton btnInstall; |
| 104 |
|
|
| 105 |
+ |
private TreeSet<Mod> execMandatoryUpdates = new TreeSet<Mod>(); |
| 106 |
|
private TreeSet<Mod> execUpdates = null; |
| 107 |
|
|
| 108 |
|
private enum EInstallState { |
| 307 |
|
}); |
| 308 |
|
|
| 309 |
|
} |
| 310 |
+ |
|
| 311 |
+ |
@SuppressWarnings("unused") |
| 312 |
+ |
private void showMandatoryPackagesDialog() { |
| 313 |
+ |
// TODO: open mand-pack-dialog |
| 314 |
+ |
} |
| 315 |
|
|
| 316 |
|
private void showSettings() { |
| 317 |
|
new SettingsDialog().setVisible(true); |
| 438 |
|
@DoInBackground(progressMessage = "mandatoryFiles.title", cancelable = false, indeterminateProgress = false) |
| 439 |
|
private void checkMandatoryFiles(final BackgroundEvent evt) { |
| 440 |
|
if (!Settings.getInstance().isOfflineMode()) { |
| 435 |
– |
TreeSet<Mod> mand = new TreeSet<Mod>(); |
| 441 |
|
for (Mod m : ModManager.getInstance().getMandatoryTools()) { |
| 442 |
|
if (m.isNewerAvailable()) { |
| 443 |
< |
mand.add(m); |
| 443 |
> |
execMandatoryUpdates.add(m); |
| 444 |
|
} |
| 445 |
|
} |
| 446 |
|
for (Mod m : ModManager.getInstance().getMandatoryMods()) { |
| 447 |
|
if (m.isNewerAvailable()) { |
| 448 |
< |
mand.add(m); |
| 448 |
> |
execMandatoryUpdates.add(m); |
| 449 |
|
} |
| 450 |
|
} |
| 451 |
< |
if (mand.size() > 0) { |
| 452 |
< |
ModDownloader m = new ModDownloader(mand, |
| 451 |
> |
if (execMandatoryUpdates.size() > 0) { |
| 452 |
> |
ModDownloader m = new ModDownloader(execMandatoryUpdates, |
| 453 |
|
new ModDownloaderListener() { |
| 454 |
|
@Override |
| 455 |
|
public void updateStatus(ModDownloader source, |
| 476 |
|
} |
| 477 |
|
|
| 478 |
|
@SuppressWarnings("unused") |
| 479 |
+ |
private void infoMandatoryFiles() { |
| 480 |
+ |
if (execMandatoryUpdates.size() > 0) { |
| 481 |
+ |
String packages = ""; |
| 482 |
+ |
for (Mod m : execMandatoryUpdates) { |
| 483 |
+ |
packages += String.format("\n - %s (%s)", m.getName(), |
| 484 |
+ |
m.getVersion()); |
| 485 |
+ |
} |
| 486 |
+ |
JOptionPane.showMessageDialog(this, String.format( |
| 487 |
+ |
bundle.getString("mandatoryFilesUpdated.text"), packages), |
| 488 |
+ |
bundle.getString("mandatoryFilesUpdated.title"), |
| 489 |
+ |
JOptionPane.INFORMATION_MESSAGE); |
| 490 |
+ |
} |
| 491 |
+ |
} |
| 492 |
+ |
|
| 493 |
+ |
@SuppressWarnings("unused") |
| 494 |
|
private void install() { |
| 495 |
|
TreeSet<Mod> mods = new TreeSet<Mod>(); |
| 496 |
|
mods.addAll(ModManager.getInstance().getMandatoryMods()); |
| 562 |
|
break; |
| 563 |
|
} |
| 564 |
|
} else { |
| 565 |
< |
HashMap<Mod, HashSet<Mod>> incompatibilities = ModManager.getInstance() |
| 566 |
< |
.checkIncompabitilites(mods); |
| 565 |
> |
HashMap<Mod, HashSet<Mod>> incompatibilities = ModManager |
| 566 |
> |
.getInstance().checkIncompabitilites(mods); |
| 567 |
|
if (incompatibilities.size() > 0) { |
| 568 |
|
installState = EInstallState.INCOMPATIBLE; |
| 569 |
|
|