Changeset 1326 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2009-01-23T22:22:10+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r1245 r1326 1 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others 2 2 package org.openstreetmap.josm.data; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 4 6 import java.awt.Color; … … 22 24 import java.util.regex.Pattern; 23 25 26 import javax.swing.JOptionPane; 27 24 28 import org.openstreetmap.josm.Main; 25 29 import org.openstreetmap.josm.actions.AboutAction; … … 298 302 properties.put(line.substring(0,i), line.substring(i+1)); 299 303 } 300 if (!errLines.isEmpty()) { 301 throw new IOException("Malformed config file at lines " + errLines); 302 } 304 if (!errLines.isEmpty()) 305 throw new IOException(tr("Malformed config file at lines {0}", errLines)); 303 306 setSystemProperties(); 307 } 308 309 public void init(Boolean reset) 310 { 311 // get the preferences. 312 File prefDir = getPreferencesDirFile(); 313 if (prefDir.exists()) { 314 if(!prefDir.isDirectory()) { 315 JOptionPane.showMessageDialog(null, tr("Cannot open preferences directory: {0}",Main.pref.getPreferencesDir())); 316 return; 317 } 318 } 319 else 320 prefDir.mkdirs(); 321 322 if (!new File(getPreferencesDir()+"preferences").exists()) 323 resetToDefault(); 324 325 try { 326 if (reset) 327 resetToDefault(); 328 else 329 load(); 330 } catch (final IOException e1) { 331 e1.printStackTrace(); 332 String backup = getPreferencesDir() + "preferences.bak"; 333 JOptionPane.showMessageDialog(null, tr("Preferences file had errors. Making backup of old one to {0}.", backup)); 334 new File(getPreferencesDir() + "preferences").renameTo(new File(backup)); 335 save(); 336 } 304 337 } 305 338 … … 448 481 /* handle space separated stuff - remove in future */ 449 482 else if(s.indexOf(' ') >= 0) 450 return Arrays.asList(s.split(" ,"));483 return Arrays.asList(s.split(" ")); 451 484 else 452 485 return Arrays.asList(s.split(";"));
Note:
See TracChangeset
for help on using the changeset viewer.