Changeset 1120 in josm
- Timestamp:
- 2008-12-13T19:08:56+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r1104 r1120 229 229 plugins.addAll(Arrays.asList(System.getProperty("josm.plugins").split(","))); 230 230 231 String [] oldplugins = new String[] {"mappaint", "unglueplugin", "lang-de","lang-en_GB","lang-fr","lang-it","lang-pl","lang-ro","lang-ru"}; 231 String [] oldplugins = new String[] {"mappaint", "unglueplugin", 232 "lang-de", "lang-en_GB", "lang-fr", "lang-it", "lang-pl", "lang-ro", 233 "lang-ru", "ewmsplugin", "ywms"}; 232 234 for (String p : oldplugins) { 233 235 if (plugins.contains(p)) { … … 240 242 if (plugins.isEmpty()) 241 243 return; 242 244 243 245 SortedMap<Integer, Collection<PluginInformation>> p = new TreeMap<Integer, Collection<PluginInformation>>(); 244 246 for (String pluginName : plugins) { -
trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
r1096 r1120 243 243 244 244 // the following could probably be done more elegantly? 245 Collection<String> enabledPlugins = null; 246 String enabledProp = Main.pref.get("plugins"); 247 if ((enabledProp == null) || ("".equals(enabledProp))) { 248 enabledPlugins = Collections.emptySet(); 249 } 250 else 251 { 252 enabledPlugins = Arrays.asList(enabledProp.split(",")); 253 } 245 Collection<String> enabledPlugins = Main.pref.getCollection("plugins", null); 254 246 255 247 for (final PluginDescription plugin : availablePlugins) { … … 384 376 } 385 377 386 String plugins = ""; 378 String oldPlugins = Main.pref.get("plugins"); 379 LinkedList<String> plugins = new LinkedList<String>(); 387 380 Object pd[] = pluginMap.keySet().toArray(); 388 381 Arrays.sort(pd); 389 382 for (Object d : pd) { 390 383 if (pluginMap.get(d)) 391 plugins += ((PluginDescription)d).name + ","; 392 } 393 if (plugins.endsWith(",")) 394 plugins = plugins.substring(0, plugins.length()-1); 395 if (plugins.length() == 0) 396 plugins = null; 397 398 String oldPlugins = Main.pref.get("plugins"); 384 plugins.add(((PluginDescription)d).name); 385 } 386 387 Main.pref.putCollection("plugins", plugins); 388 String newPlugins = Main.pref.get("plugins"); 399 389 if(oldPlugins == null && plugins == null) 400 390 return; 401 391 if(plugins == null || oldPlugins == null || !plugins.equals(oldPlugins)) 402 {403 Main.pref.put("plugins", plugins);404 392 gui.requiresRestart = true; 405 }406 393 } 407 394 }
Note:
See TracChangeset
for help on using the changeset viewer.