Changeset 3864 in josm


Ignore:
Timestamp:
2011-02-07T10:34:07+01:00 (10 years ago)
Author:
bastiK
Message:

change in build: do not copy elemstyles.xml to data folder, but distribute the entire styles folder like it is done with 'images' and 'data' (toplevel) folders

Location:
trunk
Files:
3 added
1 deleted
2 edited
1 copied
5 moved

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r3856 r3864  
    8383                <copy file="LICENSE" todir="build"/>
    8484
    85                 <!-- styles -->
    86                 <copy file="styles/standard/elemstyles.xml" todir="build/data"/>
    87 
    8885                <!-- create josm-custom.jar -->
    8986                <delete file="dist/josm-custom.jar"/>
     
    9794                        <zipfileset dir="images" prefix="images" />
    9895                        <zipfileset dir="data" prefix="data" />
     96                        <zipfileset dir="styles" prefix="styles" />
    9997                        <zipfileset dir="src/org/openstreetmap/gui/jmapviewer/images" prefix="org/openstreetmap/gui/jmapviewer/images" />
    10098
  • trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java

    r3855 r3864  
    173173
    174174        @Override
     175        public List<SourceEntry> get() {
     176            List<SourceEntry> ls = super.get();
     177            if (adapt_elemstyles_xml(ls)) {
     178                put(ls);
     179            }
     180            return ls;
     181        }
     182
     183        /**
     184         * The internal path of elemstyles.xml has changed, this
     185         * can be removed when a few months have passed.
     186         */
     187        private boolean adapt_elemstyles_xml(List<SourceEntry> ls) {
     188            boolean changed = false;
     189            for (SourceEntry se : ls) {
     190                if (se.url.equals("resource://data/elemstyles.xml")) {
     191                    se.url = "resource://styles/standard/elemstyles.xml";
     192                    changed = true;
     193                }
     194            }
     195            return changed;
     196        }
     197
     198        @Override
    175199        public Collection<ExtendedSourceEntry> getDefault() {
    176             ExtendedSourceEntry i = new ExtendedSourceEntry("elemstyles.xml", "resource://data/elemstyles.xml");
     200            ExtendedSourceEntry i = new ExtendedSourceEntry("elemstyles.xml", "resource://styles/standard/elemstyles.xml");
    177201            i.name = "standard";
    178202            i.shortdescription = tr("Internal Style");
Note: See TracChangeset for help on using the changeset viewer.