Changeset 1182 in josm


Ignore:
Timestamp:
Dec 27, 2008 12:09:20 AM (4 years ago)
Author:
stoecker
Message:

fixed bug #1889

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JosmAction.java

    r1180 r1182  
    11// License: GPL. Copyright 2007 by Immanuel Scholz and others 
    22package org.openstreetmap.josm.actions; 
     3 
     4import static org.openstreetmap.josm.tools.I18n.tr; 
    35 
    46import java.awt.event.InputEvent; 
     
    2931    public Shortcut getShortcut() { 
    3032        if (sc == null) { 
    31             sc = Shortcut.registerShortcut("core:none", "No Shortcut", 0, Shortcut.GROUP_NONE); 
    32             sc.setAutomatic(); // as this shortcut is shared by all action that don't want to have a shortcut, 
    33                                // we shouldn't allow the user to change it... 
     33            sc = Shortcut.registerShortcut("core:none", tr("No Shortcut"), 0, Shortcut.GROUP_NONE); 
     34            // as this shortcut is shared by all action that don't want to have a shortcut, 
     35            // we shouldn't allow the user to change it... 
     36            // this is handled by special name "core:none" 
    3437        } 
    3538        return sc; 
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r1169 r1182  
    8989 
    9090    @Override public MutableTreeNode description() { 
    91         String text = value == null ? tr( "Remove \"{0}\" for", key) : tr("Set {0}={1} for",key,value); 
     91        String text; 
    9292        if (objects.size() == 1) { 
    9393            NameVisitor v = new NameVisitor(); 
    9494            objects.iterator().next().visit(v); 
    95             text += " "+tr(v.className)+" "+v.name; 
    96         } else 
    97             text += " "+objects.size()+" "+trn("object","objects",objects.size()); 
     95            text = value == null 
     96            ? tr("Remove \"{0}\" for {1} ''{2}''", key, tr(v.className), v.name) 
     97            : tr("Set {0}={1} for {1} ''{2}''",key,value, tr(v.className), v.name); 
     98        } 
     99        else 
     100        { 
     101            text = value == null 
     102            ? tr("Remove \"{0}\" for {1} {2}", key, objects.size(), trn("object","objects",objects.size())) 
     103            : tr("Set {0}={1} for {1} {2}",key,value, objects.size(), trn("object","objects",objects.size())); 
     104        } 
    98105        DefaultMutableTreeNode root = new DefaultMutableTreeNode(new JLabel(text, ImageProvider.get("data", "key"), JLabel.HORIZONTAL)); 
    99106        if (objects.size() == 1) 
  • trunk/src/org/openstreetmap/josm/gui/preferences/prefJPanel.java

    r1169 r1182  
    392392                    tfKey.setSelectedItem(keyList.get(-1)); 
    393393                } 
    394                 if (sc.getAutomatic()) { 
     394                if (sc.isChangeable()) { 
    395395                    panel.cbDefault.setEnabled(false); 
    396396                    panel.cbDisable.setEnabled(false); 
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r1169 r1182  
    101101    } 
    102102 
     103    public boolean isChangeable() { 
     104        return !automatic && !shortText.equals("core:none"); 
     105    } 
     106 
    103107    private boolean getReset() { 
    104108        return reset; 
Note: See TracChangeset for help on using the changeset viewer.