Changeset 3380 in josm


Ignore:
Timestamp:
2010-07-21T21:17:09+02:00 (12 years ago)
Author:
stoecker
Message:

readded plugin checking

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r3344 r3380  
    752752     * The default plugin site
    753753     */
    754     private final static String[] DEFAULT_PLUGIN_SITE = {"http://josm.openstreetmap.de/plugin"};
     754    private final static String[] DEFAULT_PLUGIN_SITE = {"http://josm.openstreetmap.de/plugin%<?plugins=>"};
    755755
    756756    /**
  • trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java

    r3330 r3380  
    104104        String name;
    105105        try {
     106            site = site.replaceAll("%<(.*)>", "");
    106107            URL url = new URL(site);
    107108            StringBuilder sb = new StringBuilder();
     
    146147        StringBuilder sb = new StringBuilder();
    147148        try {
     149            /* replace %<x> with empty string or x=plugins (separated with comma) */
     150            String pl = Main.pref.getCollectionAsString("plugins");
     151            String printsite = site.replaceAll("%<(.*)>", "");
     152            if(pl != null && pl.length() != 0)
     153                site = site.replaceAll("%<(.*)>", "$1"+pl);
     154            else
     155                site = printsite;
     156
    148157            monitor.beginTask("");
    149             monitor.indeterminateSubTask(tr("Downloading plugin list from ''{0}''", site));
     158            monitor.indeterminateSubTask(tr("Downloading plugin list from ''{0}''", printsite));
    150159
    151160            URL url = new URL(site);
     
    196205        InputStream in = null;
    197206        OutputStream out = null;
    198         System.err.println("icons site: "+site);
    199         try {
     207        try {
     208            site = site.replaceAll("%<(.*)>", "");
     209
    200210            monitor.beginTask("");
    201211            monitor.indeterminateSubTask(tr("Downloading plugin list from ''{0}''", site));
     
    337347
    338348        for (String site: sites) {
    339             getProgressMonitor().subTask(tr("Processing plugin list from site ''{0}''", site));
     349            String printsite = site.replaceAll("%<(.*)>", "");
     350            getProgressMonitor().subTask(tr("Processing plugin list from site ''{0}''", printsite));
    340351            String list = downloadPluginList(site, getProgressMonitor().createSubTaskMonitor(0, false));
    341352            if (canceled) return;
Note: See TracChangeset for help on using the changeset viewer.