Ignore:
Timestamp:
2012-02-19T15:42:30+01:00 (13 years ago)
Author:
stoecker
Message:

remove nonstandrad shortcut handling

Location:
applications/editors/josm/plugins/turnrestrictions
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/turnrestrictions/build.xml

    r27857 r27876  
    3232    <property name="commit.message" value="Adapt to JOSM core change (DefaultNameFormatter)"/>
    3333    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    34     <property name="plugin.main.version" value="4968"/>
     34    <property name="plugin.main.version" value="4980"/>
    3535    <!--
    3636      ************************************************
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/CreateOrEditTurnRestrictionAction.java

    r23510 r27876  
    44
    55import java.awt.event.ActionEvent;
     6import java.awt.event.KeyEvent;
    67import java.util.Collection;
    7 import java.util.logging.Logger;
    8 
    9 import javax.swing.KeyStroke;
    108
    119import org.openstreetmap.josm.Main;
     
    1311import org.openstreetmap.josm.data.osm.Relation;
    1412import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     13import org.openstreetmap.josm.tools.Shortcut;
    1514import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionEditor;
    1615import org.openstreetmap.josm.plugins.turnrestrictions.editor.TurnRestrictionEditorManager;
     
    2625 */
    2726public class CreateOrEditTurnRestrictionAction extends JosmAction {
    28     static private final Logger logger = Logger.getLogger(CreateOrEditTurnRestrictionAction.class.getName());
    29  
    30     /**
    31      * Installs  global key stroke configured in the preferences.
    32      *
    33      * @param keyStroke the key stroke
    34      */
    35     static public void install(){
    36         String value = Main.pref.get(PreferenceKeys.EDIT_SHORTCUT, "shift ctrl T");
    37         KeyStroke key = KeyStroke.getKeyStroke(value);
    38         if (key == null){
    39             System.out.println(tr("Warning: illegal value ''{0}'' for preference key ''{1}''. Falling back to default value ''shift ctrl T''.", value, PreferenceKeys.EDIT_SHORTCUT));
    40             key = KeyStroke.getKeyStroke("shift ctrl T");
    41         }
    42         Main.registerActionShortcut(getInstance(), key);
    43     }
    44 
    4527    /** the singleton instance of this action */
    4628    private static CreateOrEditTurnRestrictionAction instance;
     
    6345            null,
    6446            tr("Create or edit a turn restriction."),
    65             null, // shortcut is going to be registered later
     47            Shortcut.registerShortcut("tools:extnode", tr("Tool: {0}","Extract node"),
     48                KeyEvent.VK_2, Shortcut.ALT_SHIFT),
    6649            false
    6750        );
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferencesPanel.java

    r23192 r27876  
    3535    private ButtonGroup bgIconSet;
    3636    private JCheckBox cbShowViaListInBasicEditor;
    37     private ShortcutPreferencePanel pnlShortcutPreference;
    3837   
    3938    protected JPanel buildShowViaListInBasicEditorPanel() {
     
    161160        add(new JSeparator(), gc);
    162161        gc.gridy++;
    163         add(pnlShortcutPreference = new ShortcutPreferencePanel(), gc);
    164162       
    165163        // filler - just grab remaining space
     
    184182    public void initFromPreferences(Preferences prefs){
    185183        String set = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a");
    186         set = set.trim().toLowerCase();
    187184        if (! set.equals("set-a") && ! set.equals("set-b")) {
    188185            System.out.println(tr("Warning: the preference with key ''{0}'' has an unsupported value ''{1}''. Assuming the default value ''set-a''.", PreferenceKeys.ROAD_SIGNS, set));
     
    197194        boolean b = prefs.getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false);
    198195        cbShowViaListInBasicEditor.setSelected(b);
    199        
    200         pnlShortcutPreference.initFromPreferences(prefs);
    201196    }
    202197   
     
    207202     */
    208203    public void saveToPreferences(Preferences prefs){
    209         String set = null;
    210         if (rbSetA.isSelected()){
    211             set = "set-a";
    212         } else {
    213             set = "set-b";
    214         }
    215         String oldSet = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a");     
    216         if (!set.equals(oldSet)){
    217             prefs.put(PreferenceKeys.ROAD_SIGNS, set);
    218         }
    219        
    220         boolean newValue = cbShowViaListInBasicEditor.isSelected();
    221         boolean oldValue = prefs.getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false);
    222         if (newValue != oldValue){
    223             prefs.put(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, newValue);
    224         }       
    225        
    226         pnlShortcutPreference.saveToPreferences(prefs);
     204        prefs.put(PreferenceKeys.ROAD_SIGNS, rbSetA.isSelected() ? "set-a" : "set-b");
     205        prefs.put(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, cbShowViaListInBasicEditor.isSelected());
    227206    }
    228207   
Note: See TracChangeset for help on using the changeset viewer.