Changeset 1397 in josm for trunk/src/org/openstreetmap/josm/plugins
- Timestamp:
- 2009-02-14T12:25:54+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r1390 r1397 34 34 import org.openstreetmap.josm.gui.MapFrame; 35 35 import org.openstreetmap.josm.gui.download.DownloadSelection; 36 import org.openstreetmap.josm.gui.ExtendedDialog; 36 37 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 37 38 import org.openstreetmap.josm.tools.GBC; … … 150 151 } catch (Throwable e) { 151 152 e.printStackTrace(); 152 if(JOptionPane.showConfirmDialog(Main.parent, 153 tr("Could not load plugin {0}. Delete from preferences?", 154 info.name), tr("Disable plugin"), 155 JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION) 153 154 int result = new ExtendedDialog(Main.parent, 155 tr("Disable plugin"), 156 tr("Could not load plugin {0}. Delete from preferences?", info.name), 157 new String[] {tr("Disable plugin"), tr("Cancel")}, 158 new String[] {"dialogs/delete.png", "cancel.png"}).getValue(); 159 160 if(result == 1) 156 161 { 157 162 plugins.remove(info.name); … … 247 252 248 253 if (plugin != null) { 249 int answer = JOptionPane.showConfirmDialog( 250 Main.parent, tr("An unexpected exception occurred that may have come from the ''{0}'' plugin.", 251 plugin.info.name) + "\n"+ (plugin.info.author != null ? 252 tr("According to the information within the plugin, the author is {0}.", 253 plugin.info.author) : "") + "\n" + 254 tr("Try updating to the newest version of this plugin before reporting a bug.") + "\n" + 255 tr("Should the plugin be disabled?"), 256 tr("Disable plugin"), 257 JOptionPane.YES_NO_OPTION); 258 if (answer == JOptionPane.OK_OPTION) { 254 int answer = new ExtendedDialog(Main.parent, 255 tr("Disable plugin"), 256 tr("An unexpected exception occurred that may have come from the ''{0}'' plugin.", plugin.info.name) 257 + "\n" 258 + (plugin.info.author != null 259 ? tr("According to the information within the plugin, the author is {0}.", plugin.info.author) 260 : "") 261 + "\n" 262 + tr("Try updating to the newest version of this plugin before reporting a bug.") 263 + "\n" 264 + tr("Should the plugin be disabled?"), 265 new String[] {tr("Disable plugin"), tr("Cancel")}, 266 new String[] {"dialogs/delete.png", "cancel.png"}).getValue(); 267 if (answer == 1) { 259 268 LinkedList<String> plugins = new LinkedList<String>(Arrays.asList(Main.pref.get("plugins").split(","))); 260 269 if (plugins.contains(plugin.info.name)) { -
trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java
r1326 r1397 39 39 40 40 import org.openstreetmap.josm.Main; 41 import org.openstreetmap.josm.gui.ExtendedDialog; 41 42 import org.openstreetmap.josm.tools.OpenBrowser; 42 43 import org.openstreetmap.josm.tools.XmlObjectParser.Uniform; … … 78 79 done = true; 79 80 } else { 80 int answer = JOptionPane.showConfirmDialog(Main.parent, tr("Update the following plugins:\n\n{0}", 81 toUpdateStr.toString()), tr("Update"), JOptionPane.OK_CANCEL_OPTION); 82 if (answer == JOptionPane.OK_OPTION) { 81 int answer = new ExtendedDialog(Main.parent, 82 tr("Update"), 83 tr("Update the following plugins:\n\n{0}", toUpdateStr.toString()), 84 new String[] {tr("Update Plugins"), tr("Cancel")}, 85 new String[] {"dialogs/refresh.png", "cancel.png"}).getValue(); 86 if (answer == 1) { 83 87 PluginDownloader.update(toUpdate); 84 88 done = true; … … 100 104 } 101 105 if (!toDownload.isEmpty()) { 102 int answer = JOptionPane.showConfirmDialog(Main.parent, 103 tr("Download the following plugins?\n\n{0}", msg), 104 tr("Download missing plugins"), 105 JOptionPane.YES_NO_OPTION); 106 if (answer != JOptionPane.OK_OPTION) 106 int answer = new ExtendedDialog(Main.parent, 107 tr("Download missing plugins"), 108 tr("Download the following plugins?\n\n{0}", msg), 109 new String[] {tr("Download Plugins"), tr("Cancel")}, 110 new String[] {"download.png", "cancel.png"}).getValue(); 111 if (answer != 1) 107 112 for (PluginDescription pd : toDownload) 108 113 pluginMap.put(pd.name, false); … … 202 207 if ((getLoaded(plugin.name) == null) && (plinfo != null)) { 203 208 try { 204 int answer = JOptionPane.showConfirmDialog(Main.parent, 205 tr("Plugin archive already available. Do you want to download the current version by deleting existing archive?\n\n{0}", 206 plinfo.file.getCanonicalPath()), tr("Plugin already exists"), JOptionPane.OK_CANCEL_OPTION); 207 if (answer == JOptionPane.OK_OPTION) { 209 int answer = new ExtendedDialog(Main.parent, 210 tr("Plugin already exists"), 211 tr("Plugin archive already available. Do you want to download" 212 + " the current version by deleting existing archive?\n\n{0}", 213 plinfo.file.getCanonicalPath()), 214 new String[] {tr("Delete and Download"), tr("Cancel")}, 215 new String[] {"download.png", "cancel.png"}).getValue(); 216 217 if (answer == 1) { 208 218 if (!plinfo.file.delete()) { 209 219 JOptionPane.showMessageDialog(Main.parent, tr("Error deleting plugin file: {0}", plinfo.file.getCanonicalPath()));
Note:
See TracChangeset
for help on using the changeset viewer.