Changeset 10122 in osm for applications/editors
- Timestamp:
- 2008-08-25T12:10:52+02:00 (16 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 30 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/build.xml
r9949 r10122 14 14 <target name="dist" depends="compile"> 15 15 <mkdir dir="../dist"/> 16 <ant dir="agpifoj" antfile="build.xml" target="dist"/> 16 17 <ant dir="colorscheme" antfile="build.xml" target="dist"/> 17 18 <ant dir="duplicateway" antfile="build.xml" target="dist"/> … … 41 42 42 43 <target name="clean"> 44 <ant dir="agpifoj" antfile="build.xml" target="clean"/> 43 45 <ant dir="colorscheme" antfile="build.xml" target="clean"/> 44 46 <ant dir="duplicateway" antfile="build.xml" target="clean"/> -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java
r9684 r10122 65 65 public OSMValidatorPlugin() 66 66 { 67 PreferenceEditor.importOldPreferences();68 67 initializeTests( getTests() ); 69 68 } … … 82 81 validationDialog = new ValidatorDialog(this); 83 82 newFrame.addToggleDialog(validationDialog); 84 Main.main.addLayer(new ErrorLayer(this)); 83 if(Main.pref.getBoolean(PreferenceEditor.PREF_LAYER, true)) 84 Main.main.addLayer(new ErrorLayer(this)); 85 85 if( Main.pref.hasKey(PreferenceEditor.PREF_DEBUG + ".grid") ) 86 86 Main.main.addLayer(new GridLayer(tr("Grid"))); -
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/PreferenceEditor.java
r9913 r10122 32 32 public static final String PREF_DEBUG = PREFIX + ".debug"; 33 33 34 /** The preferences key for debug preferences */ 35 public static final String PREF_LAYER = PREFIX + ".layer"; 36 34 37 /** The preferences key for enabled tests */ 35 38 public static final String PREF_TESTS = PREFIX + ".tests"; … … 42 45 43 46 private JCheckBox prefUseIgnore; 47 private JCheckBox prefUseLayer; 44 48 45 49 /** The list of all tests */ … … 58 62 prefUseIgnore.setToolTipText(tr("Use the use ignore list to suppress warnings.")); 59 63 testPanel.add(prefUseIgnore, GBC.eol()); 64 65 prefUseLayer = new JCheckBox(tr("Use error layer."), Main.pref.getBoolean(PREF_LAYER, true)); 66 prefUseLayer.setToolTipText(tr("Use the error layer to display problematic elements.")); 67 testPanel.add(prefUseLayer, GBC.eol()); 60 68 61 69 GBC a = GBC.eol().insets(-5,0,0,0); … … 103 111 Main.pref.put( PREF_TESTS_BEFORE_UPLOAD, testsBeforeUpload.toString()); 104 112 Main.pref.put( PREF_USE_IGNORE, prefUseIgnore.isSelected()); 113 Main.pref.put( PREF_LAYER, prefUseLayer.isSelected()); 105 114 } 106 107 /**108 * Import old stored preferences109 */110 public static void importOldPreferences()111 {112 if( !Main.pref.hasKey("tests") || !Pattern.matches("(\\w+=(true|false),?)*", Main.pref.get("tests")) )113 return;114 115 String enabledTests = Main.pref.get("tests");116 Main.pref.put(PREF_TESTS, enabledTests);117 Main.pref.put("tests", null );118 119 StringBuilder testsBeforeUpload = new StringBuilder();120 Map<String, String> oldPrefs = Main.pref.getAllPrefix("tests");121 for( Map.Entry<String, String> pref : oldPrefs.entrySet() )122 {123 String key = pref.getKey();124 String value = pref.getValue();125 if( key.endsWith(".checkBeforeUpload") )126 {127 String testName = key.substring(6, key.length() - 18);128 testsBeforeUpload.append( ',' ).append( testName ).append( '=' ).append( value );129 }130 else131 Main.pref.put( PREFIX + key.substring(5), value );132 Main.pref.put(key, null );133 }134 135 if (testsBeforeUpload.length() > 0 ) testsBeforeUpload = testsBeforeUpload.deleteCharAt(0);136 Main.pref.put( PREF_TESTS_BEFORE_UPLOAD, testsBeforeUpload.toString());137 }138 139 115 }
Note:
See TracChangeset
for help on using the changeset viewer.