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 623 by alloc, Wed Jan 16 10:25:00 2013 UTC vs.
Revision 624 by alloc, Wed Jan 16 11:22:28 2013 UTC

# Line 321 | Line 321 | public class MainWin extends JFrame impl
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          }
# Line 413 | Line 427 | public class MainWin extends JFrame impl
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          }
# Line 434 | Line 448 | public class MainWin extends JFrame impl
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) {

Diff Legend

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