Ticket #12045: 12045.patch

File 12045.patch, 8.2 KB (added by Larry0ua, 10 years ago)
  • build.xml

     
    11<?xml version="1.0" encoding="utf-8"?>
    22<project name="PicLayer" default="dist" basedir=".">
    3     <property name="commit.message" value="[josm/PicLayer] - #10335 add interpolation hints for the image drawing"/>
     3    <property name="commit.message" value="[josm/PicLayer] - #12045 add ability to localize dialog titles"/>
    44    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    55    <property name="plugin.main.version" value="7817"/>
    66       
  • src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java

     
    2020
    2121package org.openstreetmap.josm.plugins.piclayer;
    2222
    23 import static org.openstreetmap.josm.tools.I18n.tr;
    24 
    2523import java.util.ArrayList;
    2624import java.util.List;
    27 
    2825import javax.swing.JOptionPane;
    29 import javax.swing.UIManager;
    30 
    3126import org.openstreetmap.josm.Main;
    3227import org.openstreetmap.josm.actions.JosmAction;
    3328import org.openstreetmap.josm.actions.mapmode.MapMode;
     
    5247import org.openstreetmap.josm.plugins.piclayer.actions.transform.affine.RemovePointAction;
    5348import org.openstreetmap.josm.plugins.piclayer.actions.transform.affine.TransformPointAction;
    5449import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerAbstract;
     50import static org.openstreetmap.josm.tools.I18n.tr;
    5551
    5652/**
    5753 * Main Plugin class.
     
    157153        if (arg0 instanceof PicLayerAbstract && ((PicLayerAbstract) arg0).getTransformer().isModified()) {
    158154            if (JOptionPane.showConfirmDialog(Main.parent, tr("Do you want to save current calibration of layer {0}?",
    159155                    ((PicLayerAbstract)arg0).getPicLayerName()),
    160                     UIManager.getString("OptionPane.titleText"),
     156                    tr("Select an option"),
    161157                    JOptionPane.YES_NO_OPTION) == 0)
    162158                new SavePictureCalibrationAction((PicLayerAbstract) arg0).actionPerformed(null);
    163159        }
  • src/org/openstreetmap/josm/plugins/piclayer/actions/LoadPictureCalibrationAction.java

     
    7676            } catch (Exception e) {
    7777                // Error
    7878                e.printStackTrace();
    79                 JOptionPane.showMessageDialog(Main.parent , tr("Loading file failed: {0}", e.getMessage()));
     79                JOptionPane.showMessageDialog(Main.parent , tr("Loading file failed: {0}", e.getMessage()), tr("Problem occurred"), JOptionPane.WARNING_MESSAGE);
    8080            }
    8181        }
    8282    }
  • src/org/openstreetmap/josm/plugins/piclayer/actions/LoadPictureCalibrationFromWorldAction.java

     
    3838            } catch (Exception ex) {
    3939                // Error
    4040                ex.printStackTrace();
    41                 JOptionPane.showMessageDialog(Main.parent , tr("Loading file failed: {0}", ex.getMessage()));
     41                JOptionPane.showMessageDialog(Main.parent , tr("Loading file failed: {0}", ex.getMessage()), tr("Problem occurred"), JOptionPane.WARNING_MESSAGE);
    4242            }
    4343        }
    4444    }
  • src/org/openstreetmap/josm/plugins/piclayer/actions/SavePictureCalibrationAction.java

     
    8484            } catch (Exception e) {
    8585                // Error
    8686                e.printStackTrace();
    87                 JOptionPane.showMessageDialog(Main.parent , tr("Saving file failed: {0}", e.getMessage()));
     87                JOptionPane.showMessageDialog(Main.parent , tr("Saving file failed: {0}", e.getMessage()), tr("Problem occurred"), JOptionPane.WARNING_MESSAGE);
    8888            }
    8989        }
    9090    }
  • src/org/openstreetmap/josm/plugins/piclayer/actions/newlayer/NewLayerFromClipboardAction.java

     
    5959        catch (IOException e) {
    6060            // Failed
    6161            System.out.println( "NewLayerFromClipboardAction::actionPerformed - " + e.getMessage() );
    62             JOptionPane.showMessageDialog(null, e.getMessage() );
     62            JOptionPane.showMessageDialog(null, e.getMessage(), tr("Problem occurred"), JOptionPane.WARNING_MESSAGE);
    6363            return;
    6464        }
    6565        // Add layer
  • src/org/openstreetmap/josm/plugins/piclayer/actions/newlayer/NewLayerFromFileAction.java

     
    135135                    kml.process();
    136136                    JOptionPane.showMessageDialog(null, tr("KML calibration is in beta stage and may produce incorrectly calibrated layers!\n"+
    137137                    "Please use {0} to upload your KMLs that were calibrated incorrectly.",
    138                     "https://josm.openstreetmap.de/ticket/5451"));
     138                    "https://josm.openstreetmap.de/ticket/5451"), tr("Notification"), JOptionPane.INFORMATION_MESSAGE);
    139139                    for (KMLGroundOverlay overlay : kml.getGroundOverlays()) {
    140140                        //TODO: zoom to whole picture, not only the last
    141141                        addNewLayerFromKML(file, overlay, newLayerPos);
     
    157157        catch (IOException e) {
    158158            // Failed
    159159            System.out.println( "NewLayerFromFileAction::actionPerformed - " + e.getMessage() );
    160             JOptionPane.showMessageDialog(null, e.getMessage() );
     160            JOptionPane.showMessageDialog(null, e.getMessage(), tr("Problem occurred"), JOptionPane.WARNING_MESSAGE);
    161161        }
    162162    }
    163163
     
    183183        } catch (IOException e) {
    184184            // Failed
    185185            System.out.println( "NewLayerFromFileAction::actionPerformed - " + e.getMessage() );
    186             JOptionPane.showMessageDialog(null, e.getMessage() );
     186            JOptionPane.showMessageDialog(null, e.getMessage(), tr("Problem occurred"), JOptionPane.WARNING_MESSAGE);
    187187        }
    188188    }
    189189}
  • src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromFile.java

     
    215215            msg += "\n" + tr("Set \"{0}\" to yes/no/ask in the preferences\n"+
    216216                            "to control the autoloading of calibration files.", prefkey);
    217217            msg += "\n" + tr("Do you want to apply it ?");
    218             int answer = JOptionPane.showConfirmDialog(Main.parent, msg, tr("Load calibration file ?"), JOptionPane.YES_NO_OPTION);
     218            int answer = JOptionPane.showConfirmDialog(Main.parent, msg, tr("Load calibration file?"), JOptionPane.YES_NO_OPTION);
    219219            if (answer == JOptionPane.YES_OPTION) {
    220220                loadcal = true;
    221221            }