| | 289 | // if user enabled a plugin, it is not loaded but found somewhere on disk: offer to delete jar |
| | 290 | if (pluginCheck.isSelected()) { |
| | 291 | PluginInformation plinfo = PluginInformation.findPlugin(plugin.name); |
| | 292 | |
| | 293 | if ((PluginInformation.getLoaded(plugin.name) == null) && (plinfo != null)) { |
| | 294 | try { |
| | 295 | int answer = JOptionPane.showConfirmDialog(Main.parent, tr("Plugin archive already available. Do you want to download current version by deleting existing archive?\n\n{0}", |
| | 296 | plinfo.file.getCanonicalPath()), tr("Plugin already exists"), JOptionPane.OK_CANCEL_OPTION); |
| | 297 | if (answer == JOptionPane.OK_OPTION) { |
| | 298 | if (!plinfo.file.delete()) { |
| | 299 | JOptionPane.showMessageDialog(Main.parent, tr("Error deleting plugin file: {0}", plinfo.file.getCanonicalPath())); |
| | 300 | } |
| | 301 | } |
| | 302 | } catch (IOException e1) { |
| | 303 | e1.printStackTrace(); |
| | 304 | JOptionPane.showMessageDialog(Main.parent, tr("Error deleting plugin file: {0}", e1.getMessage())); |
| | 305 | } |
| | 306 | } |
| | 307 | } |