Changeset 2302 in josm for trunk


Ignore:
Timestamp:
2009-10-24T07:40:15+02:00 (15 years ago)
Author:
Gubaer
Message:

applied #3760: patch by smsm1: Preset menu tooltips just get in the way

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r2133 r2302  
    5151
    5252import org.openstreetmap.josm.Main;
     53import org.openstreetmap.josm.gui.tagging.TaggingPreset;
    5354import org.openstreetmap.josm.tools.GBC;
    5455import org.openstreetmap.josm.tools.ImageProvider;
     
    493494            if (s.equals("|"))
    494495                control.addSeparator();
    495             else
    496                 control.add(getAction(s));
     496            else {
     497                Action a = getAction(s);
     498                JButton b = control.add(a);
     499                String tt = (String) a.getValue(TaggingPreset.OPTIONAL_TOOLTIP_TEXT);
     500                if (tt != null) {
     501                    b.setToolTipText(tt);
     502                }
     503            }
    497504        }
    498505        control.setVisible(control.getComponentCount() != 0);
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r2238 r2302  
    7171    public String name_context;
    7272    public String locale_name;
     73    public final static String OPTIONAL_TOOLTIP_TEXT = "Optional tooltip text";
    7374
    7475    public static abstract class Item {
     
    518519        putValue(Action.NAME, getName());
    519520        putValue("toolbar", "tagging_" + getRawName());
    520         putValue(SHORT_DESCRIPTION, (group != null ?
    521                 tr("Use preset ''{0}'' of group ''{1}''", getLocaleName(), group.getName()) :
    522                     tr("Use preset ''{0}''", getLocaleName())));
    523521    }
    524522
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetMenu.java

    r2208 r2302  
    2121    public void setDisplayName() {
    2222        putValue(Action.NAME, getName());
    23         putValue(SHORT_DESCRIPTION, (group != null ?
    24                 tr("Preset group ''{0}'' of group ''{1}''", getLocaleName(), group.getName()) :
    25                     tr("Preset group ''{0}''", getLocaleName())));
     23        /** Tooltips should be shown for the toolbar buttons, but not in the menu. */
     24        putValue(OPTIONAL_TOOLTIP_TEXT, (group != null ?
     25                tr("Preset group {1} / {0}", getLocaleName(), group.getName()) :
     26                    tr("Preset group {0}", getLocaleName())));
    2627        putValue("toolbar", "tagginggroup_" + getRawName());
    2728    }
Note: See TracChangeset for help on using the changeset viewer.