Ignore:
Timestamp:
2009-02-14T12:25:54+01:00 (16 years ago)
Author:
stoecker
Message:

apply patches from xeen for #1977.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r1390 r1397  
    3434import org.openstreetmap.josm.gui.MapFrame;
    3535import org.openstreetmap.josm.gui.download.DownloadSelection;
     36import org.openstreetmap.josm.gui.ExtendedDialog;
    3637import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
    3738import org.openstreetmap.josm.tools.GBC;
     
    150151                } catch (Throwable e) {
    151152                    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)
    156161                    {
    157162                        plugins.remove(info.name);
     
    247252
    248253        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) {
    259268                LinkedList<String> plugins = new LinkedList<String>(Arrays.asList(Main.pref.get("plugins").split(",")));
    260269                if (plugins.contains(plugin.info.name)) {
  • trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java

    r1326 r1397  
    3939
    4040import org.openstreetmap.josm.Main;
     41import org.openstreetmap.josm.gui.ExtendedDialog;
    4142import org.openstreetmap.josm.tools.OpenBrowser;
    4243import org.openstreetmap.josm.tools.XmlObjectParser.Uniform;
     
    7879            done = true;
    7980        } 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) {
    8387                PluginDownloader.update(toUpdate);
    8488                done = true;
     
    100104        }
    101105        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)
    107112                for (PluginDescription pd : toDownload)
    108113                    pluginMap.put(pd.name, false);
     
    202207                        if ((getLoaded(plugin.name) == null) && (plinfo != null)) {
    203208                            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) {
    208218                                    if (!plinfo.file.delete()) {
    209219                                        JOptionPane.showMessageDialog(Main.parent, tr("Error deleting plugin file: {0}", plinfo.file.getCanonicalPath()));
Note: See TracChangeset for help on using the changeset viewer.