Ignore:
Timestamp:
2009-11-01T14:14:52+01:00 (16 years ago)
Author:
stoecker
Message:

fix #3391 - update plugins after josm update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java

    r2358 r2372  
    3939        private String errors = "";
    4040        private int count = 0;
     41        private boolean restart;
    4142
    42         private UpdateTask(Collection<PluginInformation> toUpdate, boolean up) {
     43        private UpdateTask(Collection<PluginInformation> toUpdate, boolean up, boolean restart) {
    4344            super(up ? tr("Update Plugins") : tr("Download Plugins"));
    4445            this.toUpdate = toUpdate;
     46            this.restart = restart;
    4547        }
    4648
     
    5860                );
    5961            } else {
     62                String txt = trn("{0} Plugin successfully downloaded.", "{0} Plugins successfully downloaded.", count, count);
     63                if(restart)
     64                    txt += "\n"+tr("Please restart JOSM.");
     65
    6066                JOptionPane.showMessageDialog(
    6167                        Main.parent,
    62                         trn("{0} Plugin successfully downloaded. Please restart JOSM.", "{0} Plugins successfully downloaded. Please restart JOSM.", count, count),
     68                        txt,
    6369                        tr("Information"),
    6470                        JOptionPane.INFORMATION_MESSAGE
     
    154160    }
    155161
    156     public static void update(Collection<PluginInformation> update) {
    157         Main.worker.execute(new UpdateTask(update, true));
     162    public static void update(Collection<PluginInformation> update, boolean restart) {
     163        Main.worker.execute(new UpdateTask(update, true, restart));
    158164    }
    159165
     
    162168        // Waiting for result is not a good idea because the waiting thread will probably be either EDT
    163169        // or worker thread. Blocking one of these threads will cause deadlock
    164         UpdateTask t = new UpdateTask(download, false);
     170        UpdateTask t = new UpdateTask(download, false, true);
    165171        t.run();
    166172        return t.failed;
Note: See TracChangeset for help on using the changeset viewer.