Changeset 30502 in osm for applications


Ignore:
Timestamp:
2014-06-30T13:48:46+02:00 (10 years ago)
Author:
beata.jancso
Message:
  • fixed error
File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustHelpPanel.java

    r30500 r30502  
    9999     */
    100100    private String buildText() {
    101         String version = Main.pref.get("mapdust.version");
    102         String localVersion = Main.pref.get("mapdust.localVersion");
     101        Integer version;
     102        try{
     103            version = Integer.decode(Main.pref.get("mapdust.version"));
     104        } catch (NumberFormatException e){
     105            version = null;
     106        }
     107               
     108        Integer localVersion;
     109        try{
     110            localVersion= Integer.decode(Main.pref.get("mapdust.localVersion"));
     111        } catch (NumberFormatException e) {
     112            localVersion = null;
     113        }
     114             
    103115        StringBuilder sb = new StringBuilder("<html>");
    104116        sb.append("<font style='font-size:10px' face='Times New Roman'>");
    105117        sb.append("<b>You are using MapDust version ");
    106118        sb.append("<i style='color:red;font-size:10px'>");
    107         if (version.equals(localVersion)) {
    108             sb.append(version).append("</i>.</b><br>");
     119        if (version != null && localVersion != null && version <= localVersion) {
     120            sb.append(Main.pref.get("mapdust.version")).append("</i>.</b><br>");
    109121        } else {
    110             sb.append(localVersion);
     122            sb.append(Main.pref.get("mapdust.localVersion"));
    111123            sb.append("</i>. There is an update available. ");
    112124            sb.append("Please update to version ");
Note: See TracChangeset for help on using the changeset viewer.