Changeset 8877 in josm


Ignore:
Timestamp:
2015-10-14T23:48:08+02:00 (4 years ago)
Author:
simon04
Message:

fix #11926 - Presets: option to disable alphabetic sorting for a single key

Specify the values_sort="false" attribute for the <combo> of
<multiselect>.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/defaultpresets.xml

    r8872 r8877  
    1818    <chunk id="surface_smoothness">
    1919        <reference ref="surface" />
    20         <combo key="smoothness" text="Smoothness" values_searchable="true">
     20        <combo key="smoothness" text="Smoothness" values_searchable="true" values_sort="false">
    2121            <list_entry value="excellent" short_description="Thin Rollers: rollerblade, skateboard" />
    2222            <list_entry value="good" short_description="Thin Wheels: racing bike" />
  • trunk/data/tagging-preset.xsd

    r8872 r8877  
    205205                <attribute name="values_context" type="string" />
    206206                <attribute name="values_no_i18n" type="boolean" />
     207                <attribute name="values_sort" type="boolean" />
    207208                <attribute name="display_values" type="string" />
    208209                <attribute name="values_searchable" type="boolean" />
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java

    r8872 r8877  
    9999    /** Disabled internationalisation for value to avoid mistakes, see #11696 */
    100100    public boolean values_no_i18n;
     101    /** Whether to sort the values, defaults to true. */
     102    public boolean values_sort = true;
    101103    public String display_values;
    102104    /** The localized version of {@link #display_values}. */
     
    425427        }
    426428
    427         if (Main.pref.getBoolean("taggingpreset.sortvalues", true)) {
     429        if (Main.pref.getBoolean("taggingpreset.sortvalues", true) && values_sort) {
    428430            Collections.sort(entries);
    429431        }
Note: See TracChangeset for help on using the changeset viewer.