Ignore:
Timestamp:
2010-01-11T21:06:49+01:00 (14 years ago)
Author:
Gubaer
Message:

fixed #3063: Downloading a plugin yields 3 dialogs at the same time: Downloading plugin / You should restart JOSM / Plugin downloaded
fixed #3628: JOSM blocking itself updating broken plugin
fixed #4187: JOSM deleted random files from disk after start (data loss)
fixed #4199: new version - plugins update vs josm start [should be fixed. Be careful if you have two JOSM instances running. Auto-update of plugins in the second instance will fail because plugin files are locked by the first instance]
fixed #4034: JOSM should auto-download plugin list when it hasn't been downloaded before [JOSM now displays a hint]

fixed: splash screen showing again even if plugins are auto-updated
new: progress indication integrated in splash screen
new: cancelable, asynchronous download of plugins from preferences
new: cancelable, asynchronous download of plugin list from plugin download sites
new: asynchronous loading of plugin information, launch of preferences dialog accelerated
refactored: clean up, documentation of plugin management code (PluginHandler)

File:
1 edited

Legend:

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

    r2801 r2817  
    2222import org.openstreetmap.josm.Main;
    2323import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
     24import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2425import org.openstreetmap.josm.io.DefaultProxySelector;
    2526import org.openstreetmap.josm.io.auth.CredentialsManagerFactory;
    2627import org.openstreetmap.josm.io.auth.DefaultAuthenticator;
    2728import org.openstreetmap.josm.plugins.PluginHandler;
     29import org.openstreetmap.josm.plugins.PluginInformation;
    2830import org.openstreetmap.josm.tools.BugReportExceptionHandler;
    2931import org.openstreetmap.josm.tools.I18n;
     
    4547     * display the frame.
    4648     */
    47     public MainApplication(JFrame mainFrame, SplashScreen splash) {
    48         super(splash);
     49    public MainApplication(JFrame mainFrame) {
     50        super();
    4951        mainFrame.setContentPane(contentPane);
    5052        mainFrame.setJMenuBar(menu);
     
    151153        }
    152154
    153         SplashScreen splash = new SplashScreen(Main.pref.getBoolean("draw.splashscreen", true));
    154 
    155         splash.setStatus(tr("Activating updated plugins"));
    156         PluginHandler.earlyCleanup();
    157 
    158         splash.setStatus(tr("Loading early plugins"));
    159         PluginHandler.loadPlugins(true);
    160 
    161         splash.setStatus(tr("Setting defaults"));
     155        SplashScreen splash = new SplashScreen();
     156        ProgressMonitor monitor = splash.getProgressMonitor();
     157        monitor.beginTask(tr("Initializing"));
     158        monitor.setTicksCount(7);
     159        splash.setVisible(Main.pref.getBoolean("draw.splashscreen", true));
     160
     161        List<PluginInformation> pluginsToLoad = PluginHandler.buildListOfPluginsToLoad(monitor.createSubTaskMonitor(1, false));
     162        if (!pluginsToLoad.isEmpty() && PluginHandler.checkAndConfirmPluginUpdate()) {
     163            monitor.subTask(tr("Updating plugins..."));
     164            PluginHandler.updatePlugins(pluginsToLoad, monitor.createSubTaskMonitor(1, false));
     165        }
     166        monitor.worked(1);
     167
     168        monitor.subTask(tr("Installing updated plugins"));
     169        PluginHandler.installDownloadedPlugins();
     170        monitor.worked(1);
     171
     172        monitor.subTask(tr("Loading early plugins"));
     173        PluginHandler.loadEarlyPlugins(pluginsToLoad, monitor.createSubTaskMonitor(1, false));
     174        monitor.worked(1);
     175
     176        monitor.subTask(tr("Setting defaults"));
    162177        preConstructorInit(args);
    163178        removeObsoletePreferences();
    164         splash.setStatus(tr("Creating main GUI"));
     179        monitor.worked(1);
     180
     181        monitor.indeterminateSubTask(tr("Creating main GUI"));
    165182        JFrame mainFrame = new JFrame(tr("Java OpenStreetMap Editor"));
    166183        Main.parent = mainFrame;
    167         final Main main = new MainApplication(mainFrame, splash);
    168         splash.setStatus(tr("Loading plugins"));
    169         PluginHandler.loadPlugins(false);
     184        final Main main = new MainApplication(mainFrame);
     185        monitor.worked(1);
     186
     187        monitor.subTask(tr("Loading plugins"));
     188        PluginHandler.loadLatePlugins(pluginsToLoad,  monitor.createSubTaskMonitor(1, false));
     189        monitor.worked(1);
    170190        toolbar.refreshToolbarControl();
    171 
     191        splash.setVisible(false);
     192        splash.dispose();
    172193        mainFrame.setVisible(true);
    173         splash.closeSplash();
    174194
    175195        if (((!args.containsKey("no-maximize") && !args.containsKey("geometry")
Note: See TracChangeset for help on using the changeset viewer.