Changeset 3297 in josm
- Timestamp:
- 2010-06-03T08:48:38+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r3287 r3297 376 376 */ 377 377 public static void loadPlugin(Window parent, PluginInformation plugin, ClassLoader pluginClassLoader) { 378 String msg = tr("Could not load plugin {0}. Delete from preferences?", plugin.name); 378 379 try { 379 380 Class<?> klass = plugin.loadClass(pluginClassLoader); … … 382 383 pluginList.add(plugin.load(klass)); 383 384 } 385 msg = null; 384 386 } catch(PluginException e) { 385 387 e.printStackTrace(); 386 388 if (e.getCause() instanceof ClassNotFoundException) { 387 Stringmsg = tr("<html>Could not load plugin {0} because the plugin<br>main class ''{1}'' was not found.<br>"389 msg = tr("<html>Could not load plugin {0} because the plugin<br>main class ''{1}'' was not found.<br>" 388 390 + "Delete from preferences?", plugin.name, plugin.className); 389 if (confirmDisablePlugin(parent, msg, plugin.name)) {390 Main.pref.removeFromCollection("plugins", plugin.name);391 }392 391 } 393 392 } catch (Throwable e) { 394 393 e.printStackTrace(); 395 String msg = tr("Could not load plugin {0}. Delete from preferences?", plugin.name); 396 if (confirmDisablePlugin(parent, msg, plugin.name)) { 397 Main.pref.removeFromCollection("plugins", plugin.name); 398 } 399 } 394 } 395 if(msg != null && confirmDisablePlugin(parent, msg, plugin.name)) 396 Main.pref.removeFromCollection("plugins", plugin.name); 400 397 } 401 398 … … 910 907 public static String getBugReportText() { 911 908 String text = ""; 912 String pl = Main.pref.getCollectionAsString("plugins"); 913 if (pl != null && pl.length() != 0) { 914 text += "Plugins: " + pl + "\n"; 915 } 909 LinkedList <String> pl = new LinkedList<String>(Main.pref.getCollection("plugins", new LinkedList<String>())); 916 910 for (final PluginProxy pp : pluginList) { 917 text += "Plugin " + pp.getPluginInformation().name; 918 String version = pp.getPluginInformation().localversion; 919 text += version != null && !version.equals("") ? " (Version: " + version + ")\n" 920 : "\n"; 921 } 911 PluginInformation pi = pp.getPluginInformation(); 912 pl.remove(pi.name); 913 pl.add(pi.name + " (" + (pi.localversion != null && !pi.localversion.equals("") 914 ? pi.localversion : "unknown") + ")"); 915 } 916 Collections.sort(pl); 917 for (String s : pl) 918 text += "Plugin: " + s + "\n"; 922 919 return text; 923 920 }
Note:
See TracChangeset
for help on using the changeset viewer.