Changeset 34534 in osm for applications/editors


Ignore:
Timestamp:
2018-08-18T18:55:26+02:00 (6 years ago)
Author:
donvip
Message:

update to JOSM 14153

Location:
applications/editors/josm/plugins/no_more_mapping
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/no_more_mapping/build.xml

    r32680 r34534  
    55    <property name="commit.message" value="Commit message"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="10580"/>
     7    <property name="plugin.main.version" value="14153"/>
    88
    99    <!--
  • applications/editors/josm/plugins/no_more_mapping/src/nomore/NoMorePlugin.java

    r32553 r34534  
    99import javax.swing.JOptionPane;
    1010
    11 import org.openstreetmap.josm.Main;
     11import org.openstreetmap.josm.data.Preferences;
     12import org.openstreetmap.josm.gui.MainApplication;
    1213import org.openstreetmap.josm.plugins.Plugin;
    1314import org.openstreetmap.josm.plugins.PluginInformation;
     15import org.openstreetmap.josm.spi.preferences.Config;
    1416
    1517/**
     
    2628    public NoMorePlugin(PluginInformation info) {
    2729        super(info);
    28         long startDate = Main.pref.getLong("nomoremapping.date", 0);
    29         long lastHash = Math.max(Main.pref.getLong("pluginmanager.lastupdate", 0) / 1000,
    30                 Math.max(Main.pref.getLong("cache.motd.html", 0),
    31                 Main.pref.getLong("cache.bing.attribution.xml", 0))) + Main.pref.get("osm-download.bounds", "").hashCode();
    32         boolean sameHash = Main.pref.getLong("nomoremapping.hash", 0) == lastHash;
     30        long startDate = Config.getPref().getLong("nomoremapping.date", 0);
     31        long lastHash = Math.max(Config.getPref().getLong("pluginmanager.lastupdate", 0) / 1000,
     32                Math.max(Config.getPref().getLong("cache.motd.html", 0),
     33                Config.getPref().getLong("cache.bing.attribution.xml", 0))) + Config.getPref().get("osm-download.bounds", "").hashCode();
     34        boolean sameHash = Config.getPref().getLong("nomoremapping.hash", 0) == lastHash;
    3335        long today = new Date().getTime() / 1000;
    3436        if (startDate == 0 || !sameHash) {
    3537            startDate = today;
    36             Main.pref.putLong("nomoremapping.date", startDate);
    37             Main.pref.putLong("nomoremapping.hash", lastHash);
     38            Config.getPref().putLong("nomoremapping.date", startDate);
     39            Config.getPref().putLong("nomoremapping.hash", lastHash);
    3840        }
    3941        long days = Math.max(today - startDate, 0) / (60*60*24);
     
    5052        String prefs;
    5153        try {
    52              prefs = Main.pref.getPreferenceFile().getCanonicalPath();
     54             prefs = Preferences.main().getPreferenceFile().getCanonicalPath();
    5355        } catch (IOException e) {
    54             prefs = Main.pref.getPreferenceFile().getAbsolutePath();
     56            prefs = Preferences.main().getPreferenceFile().getAbsolutePath();
    5557        }
    5658        String howto = days > 0 ? "" : "\n\n" + tr("(To miserably continue mapping, edit out no_more_mapping\nfrom {0})", prefs);
    57         JOptionPane.showMessageDialog(Main.parent, intro + " " + message + howto, "No More Mapping", JOptionPane.INFORMATION_MESSAGE);
     59        JOptionPane.showMessageDialog(MainApplication.getMainFrame(), intro + " " + message + howto,
     60                "No More Mapping", JOptionPane.INFORMATION_MESSAGE);
    5861        System.exit(0);
    5962    }
Note: See TracChangeset for help on using the changeset viewer.