Ignore:
Timestamp:
2008-12-22T16:31:49+01:00 (16 years ago)
Author:
stoecker
Message:

fixed shortcut loading. Close #1769

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r1102 r1157  
    328328    // this is used to register a shortcut that was read from the preferences
    329329    private static void registerShortcut(Shortcut sc) {
    330         registerShortcut(sc.getShortText(), sc.getLongText(), sc.getRequestedKey(), sc.getRequestedGroup(), sc.getAssignedModifier(), sc);
     330        // put a user configured shortcut in as-is -- unless there's a conflict
     331        if(sc.getAssignedUser() && findShortcut(sc.getAssignedKey(),
     332        sc.getAssignedModifier()) == null)
     333            shortcuts.put(sc.getShortText(), sc);
     334        else
     335            registerShortcut(sc.getShortText(), sc.getLongText(), sc.getRequestedKey(),
     336            sc.getRequestedGroup(), sc.getAssignedModifier(), sc);
    331337    }
    332338
     
    394400                defaultModifier = modifier;
    395401        }
    396         else if (defaultModifier == null) { // garbage in, no shortcurt out
     402        else if (defaultModifier == null) { // garbage in, no shortcut out
    397403            defaultModifier = groups.get(GROUP_NONE + GROUPS_DEFAULT);
    398404        }
     
    428434            potentialShortcut = new Shortcut(shortText, longText, requestedKey, requestedGroup, requestedKey, defaultModifier, true, false);
    429435        }
     436
    430437        shortcuts.put(shortText, potentialShortcut);
    431438        return potentialShortcut;
Note: See TracChangeset for help on using the changeset viewer.