Changeset 6824 in josm for trunk/src


Ignore:
Timestamp:
2014-02-07T11:42:34+01:00 (6 years ago)
Author:
simon04
Message:

Presets XML: add preset_name_label attribute to <item> to automatically add "Edit [preset name]" at the beginning the dialog

This reduces the i18n preset strings by ≈500.

Location:
trunk/src/org/openstreetmap/josm/gui/tagging
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r6795 r6824  
    7474    public String name_context;
    7575    public String locale_name;
     76    public boolean preset_name_label;
    7677    public final static String OPTIONAL_TOOLTIP_TEXT = "Optional tooltip text";
    7778
     
    216217            }
    217218            p.add(pp, GBC.eol());
     219        }
     220        if (preset_name_label) {
     221            TaggingPresetItems.Label.addLabel(p,/*I18n: {0} is preset name */tr("Edit {0}", getName()));
    218222        }
    219223
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java

    r6798 r6824  
    354354        public boolean addToPanel(JPanel p, Collection<OsmPrimitive> sel, boolean presetInitiallyMatches) {
    355355            initializeLocaleText(null);
    356             p.add(new JLabel(locale_text), GBC.eol());
     356            addLabel(p, locale_text);
    357357            return false;
     358        }
     359
     360        public static void addLabel(JPanel p, String label) {
     361            p.add(new JLabel(label), GBC.eol());
    358362        }
    359363    }
Note: See TracChangeset for help on using the changeset viewer.