ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/java/installer2/src/net/oni2/aeinstaller/gui/MainWin.java
(Generate patch)

Comparing AE/installer2/src/net/oni2/aeinstaller/gui/MainWin.java (file contents):
Revision 643 by alloc, Mon Jan 21 16:23:48 2013 UTC vs.
Revision 645 by alloc, Tue Jan 22 21:24:47 2013 UTC

# Line 102 | Line 102 | public class MainWin extends JFrame impl
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 {
# Line 306 | Line 307 | public class MainWin extends JFrame impl
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);
# Line 432 | Line 438 | public class MainWin extends JFrame impl
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,
# Line 471 | Line 476 | public class MainWin extends JFrame impl
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());
# Line 542 | Line 562 | public class MainWin extends JFrame impl
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)