Ignore:
Timestamp:
2013-02-16T16:58:22+01:00 (11 years ago)
Author:
Don-vip
Message:

fix #7754 - plugin management: unable to activate plugin after aborted download + fix EDT violations

File:
1 edited

Legend:

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

    r5631 r5723  
    4545import org.openstreetmap.josm.gui.preferences.plugin.PluginPreferencesModel;
    4646import org.openstreetmap.josm.gui.preferences.plugin.PluginUpdatePolicyPanel;
     47import org.openstreetmap.josm.gui.util.GuiHelper;
    4748import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
    4849import org.openstreetmap.josm.plugins.PluginDownloadTask;
     
    303304
    304305        protected void notifyDownloadResults(PluginDownloadTask task) {
    305             Collection<PluginInformation> downloaded = task.getDownloadedPlugins();
    306             Collection<PluginInformation> failed = task.getFailedPlugins();
    307             StringBuilder sb = new StringBuilder();
     306            final Collection<PluginInformation> downloaded = task.getDownloadedPlugins();
     307            final Collection<PluginInformation> failed = task.getFailedPlugins();
     308            final StringBuilder sb = new StringBuilder();
    308309            sb.append("<html>");
    309310            sb.append(buildDownloadSummary(task));
     
    312313            }
    313314            sb.append("</html>");
    314             HelpAwareOptionPane.showOptionDialog(
    315                     pnlPluginPreferences,
    316                     sb.toString(),
    317                     tr("Update plugins"),
    318                     !failed.isEmpty() ? JOptionPane.WARNING_MESSAGE : JOptionPane.INFORMATION_MESSAGE,
    319                             HelpUtil.ht("/Preferences/Plugins")
    320                     );
     315            GuiHelper.runInEDTAndWait(new Runnable() {
     316                @Override
     317                public void run() {
     318                    HelpAwareOptionPane.showOptionDialog(
     319                            pnlPluginPreferences,
     320                            sb.toString(),
     321                            tr("Update plugins"),
     322                            !failed.isEmpty() ? JOptionPane.WARNING_MESSAGE : JOptionPane.INFORMATION_MESSAGE,
     323                                    HelpUtil.ht("/Preferences/Plugins")
     324                            );
     325                }
     326            });
    321327        }
    322328
     
    359365                    model.refreshLocalPluginVersion(pluginDownloadTask.getDownloadedPlugins());
    360366                    model.clearPendingPlugins(pluginDownloadTask.getDownloadedPlugins());
    361                     pnlPluginPreferences.refreshView();
     367                    GuiHelper.runInEDT(new Runnable() {
     368                        @Override
     369                        public void run() {
     370                            pnlPluginPreferences.refreshView();                        }
     371                    });
    362372                }
    363373            };
Note: See TracChangeset for help on using the changeset viewer.