Changeset 32553 in osm for applications/editors/josm/plugins/no_more_mapping/src
- Timestamp:
- 2016-07-04T13:19:34+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/no_more_mapping/src/nomore/NoMorePlugin.java
r29479 r32553 1 // License: WTFPL. For details, see LICENSE file. 1 2 package nomore; 2 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import java.io.IOException; 3 7 import java.util.Date; 8 4 9 import javax.swing.JOptionPane; 10 5 11 import org.openstreetmap.josm.Main; 6 12 import org.openstreetmap.josm.plugins.Plugin; 7 13 import org.openstreetmap.josm.plugins.PluginInformation; 8 import static org.openstreetmap.josm.tools.I18n.tr;9 14 10 15 /** … … 15 20 public class NoMorePlugin extends Plugin { 16 21 22 /** 23 * Constructs a new {@code NoMorePlugin}. 24 * @param info plugin information 25 */ 17 26 public NoMorePlugin(PluginInformation info) { 18 27 super(info); … … 23 32 boolean sameHash = Main.pref.getLong("nomoremapping.hash", 0) == lastHash; 24 33 long today = new Date().getTime() / 1000; 25 if ( startDate == 0 || !sameHash) {34 if (startDate == 0 || !sameHash) { 26 35 startDate = today; 27 36 Main.pref.putLong("nomoremapping.date", startDate); … … 30 39 long days = Math.max(today - startDate, 0) / (60*60*24); 31 40 String message; 32 if ( days == 0)41 if (days == 0) 33 42 message = "Make it one!"; 34 else if ( days < 7)43 else if (days < 7) 35 44 message = "Keep going!"; 36 else if ( days < 31)45 else if (days < 31) 37 46 message = "You're good. Keep on!"; 38 47 else … … 42 51 try { 43 52 prefs = Main.pref.getPreferenceFile().getCanonicalPath(); 44 } catch ( Exception e) {53 } catch (IOException e) { 45 54 prefs = Main.pref.getPreferenceFile().getAbsolutePath(); 46 55 }
Note:
See TracChangeset
for help on using the changeset viewer.