Changeset 3088 in josm for trunk


Ignore:
Timestamp:
2010-03-05T17:07:49+01:00 (15 years ago)
Author:
Gubaer
Message:

cosmetics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java

    r3086 r3088  
    328328        public void actionPerformed(ActionEvent e) {
    329329            List<PluginInformation> toUpdate = model.getSelectedPlugins();
    330             final PluginDownloadTask task = new PluginDownloadTask(
     330            // the async task for downloading plugins
     331            final PluginDownloadTask pluginDownloadTask = new PluginDownloadTask(
    331332                    pnlPluginPreferences,
    332333                    toUpdate,
    333334                    tr("Update plugins")
    334335            );
    335 
    336             final ReadRemotePluginInformationTask task2 = new ReadRemotePluginInformationTask(Main.pref.getPluginSites());
    337 
    338             final Runnable r2 = new Runnable() {
     336            // the async task for downloading plugin information
     337            final ReadRemotePluginInformationTask pluginInfoDownloadTask = new ReadRemotePluginInformationTask(Main.pref.getPluginSites());
     338
     339            // to be run asynchronously after the plugin download
     340            //
     341            final Runnable pluginDownloadContinuation = new Runnable() {
    339342                public void run() {
    340                     if (task2.isCanceled())
     343                    if (pluginDownloadTask.isCanceled())
    341344                        return;
    342                     notifyDownloadResults(task);
    343                     model.refreshLocalPluginVersion(task.getDownloadedPlugins());
     345                    notifyDownloadResults(pluginDownloadTask);
     346                    model.refreshLocalPluginVersion(pluginDownloadTask.getDownloadedPlugins());
    344347                    pnlPluginPreferences.refreshView();
    345348                }
    346349            };
    347350
    348             final Runnable r1 = new Runnable() {
     351            // to be run asynchronously after the plugin list download
     352            //
     353            final Runnable pluginInfoDownloadContinuation = new Runnable() {
    349354                public void run() {
    350                     if (task.isCanceled())
     355                    if (pluginInfoDownloadTask.isCanceled())
    351356                        return;
    352                     Main.worker.submit(task2);
    353                     Main.worker.submit(r2);
     357                    Main.worker.submit(pluginDownloadTask);
     358                    Main.worker.submit(pluginDownloadContinuation);
    354359                }
    355360            };
    356361
    357             Main.worker.submit(task);
    358             Main.worker.submit(r1);
     362            Main.worker.submit(pluginInfoDownloadTask);
     363            Main.worker.submit(pluginInfoDownloadContinuation);
    359364        }
    360365    }
Note: See TracChangeset for help on using the changeset viewer.