Changeset 1233 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2009-01-10T18:27:25+01:00 (16 years ago)
Author:
ulfl
Message:

change the settings to load custom mappaint styles and icons. Details at http://wiki.openstreetmap.org/wiki/JOSM/Plugins/MapPaint#Preferences

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r1169 r1233  
    4949
    5050    public static void readFromPreferences() {
     51        String[] a = null;
     52       
    5153        /* don't prefix icon path, as it should be generic */
    5254        String internalicon = "resource://images/styles/standard/;resource://images/styles/";
    5355        String internalfile = "standard=resource://styles/standard/elemstyles.xml";
    5456
    55         iconDirs = Main.pref.get("mappaint.iconpaths");
    56         iconDirs = iconDirs == null || iconDirs.length() == 0 ? internalicon : iconDirs + ";" + internalicon;
     57        iconDirs = Main.pref.get("mappaint.icon.sources");
     58        if(Main.pref.getBoolean("mappaint.icon.enable-defaults", true))
     59            iconDirs = iconDirs == null || iconDirs.length() == 0 ? internalicon : iconDirs + ";" + internalicon;
    5760
    58         String file = Main.pref.get("mappaint.sources");
    59         file = file == null || file.length() == 0 ? internalfile : internalfile + ";" + file;
     61        String file = Main.pref.get("mappaint.style.sources");
     62        if(Main.pref.getBoolean("mappaint.style.enable-defaults", true))
     63            file = (file == null || file.length() == 0) ? internalfile : internalfile + ";" + file;
    6064
    6165        for(String fileset : file.split(";"))
     
    6367            try
    6468            {
    65                 String[] a;
    6669                if(fileset.indexOf("=") >= 0)
    6770                    a = fileset.split("=", 2);
     
    7679            catch (Exception e)
    7780            {
    78                 System.out.println("Mappaint-Style problems: \"" + fileset + "\"");
     81                System.out.println("Mappaint-Style \"" + a[0] + "\" file \"" + a[1] + "\"");
     82                System.out.println("Mappaint-Style problems: " + e);
    7983            }
    8084        }
Note: See TracChangeset for help on using the changeset viewer.