Changeset 4766 in josm for trunk/src


Ignore:
Timestamp:
2012-01-07T15:57:02+01:00 (8 years ago)
Author:
akks
Message:

Fixing shortcut editor problems #7177, #7213 (empty names, incorrect editing after sorting)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java

    r4615 r4766  
    9090
    9191    private static final KeyStroke ENABLE_FILTER_SHORTCUT
    92     = Shortcut.registerShortcut("core_multikey:enableFilter", "", 'E', Shortcut.GROUP_DIRECT, KeyEvent.CTRL_DOWN_MASK + KeyEvent.ALT_DOWN_MASK).getKeyStroke();
     92    = Shortcut.registerShortcut("core_multikey:enableFilter", tr("Multikey: {0}", tr("Enable filter")), 'E', Shortcut.GROUP_DIRECT, KeyEvent.CTRL_DOWN_MASK + KeyEvent.ALT_DOWN_MASK).getKeyStroke();
    9393
    9494    private static final KeyStroke HIDING_FILTER_SHORTCUT
    95     = Shortcut.registerShortcut("core_multikey:hidingFilter", "", 'H', Shortcut.GROUP_DIRECT, KeyEvent.CTRL_DOWN_MASK + KeyEvent.ALT_DOWN_MASK).getKeyStroke();
     95    = Shortcut.registerShortcut("core_multikey:hidingFilter", tr("Multikey: {0}", tr("Hide filter")), 'H', Shortcut.GROUP_DIRECT, KeyEvent.CTRL_DOWN_MASK + KeyEvent.ALT_DOWN_MASK).getKeyStroke();
    9696
    9797
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r4751 r4766  
    445445            putValue(SHORT_DESCRIPTION, tr("Toggle visible state of the selected layer."));
    446446            putValue("help", HelpUtil.ht("/Dialog/LayerList#ShowHideLayer"));
    447             putValue(ACCELERATOR_KEY, Shortcut.registerShortcut("core_multikey:showHideLayer", "", 'S', Shortcut.GROUP_DIRECT, KeyEvent.SHIFT_DOWN_MASK).getKeyStroke());
     447            putValue(ACCELERATOR_KEY, Shortcut.registerShortcut("core_multikey:showHideLayer", tr("Multikey: {0}", tr("Show/hide layer")), 'S', Shortcut.GROUP_DIRECT, KeyEvent.SHIFT_DOWN_MASK).getKeyStroke());
    448448            if (init) {
    449449                updateEnabledState();
     
    632632            putValue(SMALL_ICON, ImageProvider.get("dialogs", "activate"));
    633633            putValue(SHORT_DESCRIPTION, tr("Activate the selected layer"));
    634             putValue(ACCELERATOR_KEY, Shortcut.registerShortcut("core_multikey:activateLayer", "", 'A', Shortcut.GROUP_DIRECT, KeyEvent.SHIFT_DOWN_MASK).getKeyStroke());
     634            putValue(ACCELERATOR_KEY, Shortcut.registerShortcut("core_multikey:activateLayer",  tr("Multikey: {0}", tr("Activate layer")), 'A', Shortcut.GROUP_DIRECT, KeyEvent.SHIFT_DOWN_MASK).getKeyStroke());
    635635            putValue("help", HelpUtil.ht("/Dialog/LayerList#ActivateLayer"));
    636636        }
  • trunk/src/org/openstreetmap/josm/gui/layer/JumpToMarkerActions.java

    r4751 r4766  
    3434
    3535        public JumpToNextMarker(JumpToMarkerLayer layer) {
    36             putValue(ACCELERATOR_KEY, Shortcut.registerShortcut("core_multikey:nextMarker", "", 'J', Shortcut.GROUP_DIRECT, KeyEvent.ALT_DOWN_MASK + KeyEvent.CTRL_DOWN_MASK).getKeyStroke());
     36            putValue(ACCELERATOR_KEY, Shortcut.registerShortcut("core_multikey:nextMarker", tr("Multikey: {0}", tr("Next marker")), 'J', Shortcut.GROUP_DIRECT, KeyEvent.ALT_DOWN_MASK + KeyEvent.CTRL_DOWN_MASK).getKeyStroke());
    3737            putValue(SHORT_DESCRIPTION, tr("Jump to next marker"));
    3838            putValue(NAME, tr("Jump to next marker"));
     
    9090            this.layer = (Layer)layer;
    9191
    92             putValue(ACCELERATOR_KEY, Shortcut.registerShortcut("core_multikey:previousMarker", "", 'P', Shortcut.GROUP_DIRECT, KeyEvent.ALT_DOWN_MASK + KeyEvent.CTRL_DOWN_MASK).getKeyStroke());
     92            putValue(ACCELERATOR_KEY, Shortcut.registerShortcut("core_multikey:previousMarker", tr("Multikey: {0}", tr("Previos marker")), 'P', Shortcut.GROUP_DIRECT, KeyEvent.ALT_DOWN_MASK + KeyEvent.CTRL_DOWN_MASK).getKeyStroke());
    9393            putValue(SHORT_DESCRIPTION, tr("Jump to previous marker"));
    9494            putValue(NAME, tr("Jump to previous marker"));
  • trunk/src/org/openstreetmap/josm/gui/preferences/PrefJPanel.java

    r3719 r4766  
    375375            ListSelectionModel lsm = panel.shortcutTable.getSelectionModel(); // can't use e here
    376376            if (!lsm.isSelectionEmpty()) {
    377                 int row = lsm.getMinSelectionIndex();
     377                int row = panel.shortcutTable.convertRowIndexToModel(lsm.getMinSelectionIndex());
    378378                Shortcut sc = (Shortcut)panel.model.getValueAt(row, -1);
    379379                panel.cbDefault.setSelected(!sc.getAssignedUser());
     
    414414            if (lsm != null && !lsm.isSelectionEmpty()) {
    415415                if (e != null) { // only if we've been called by a user action
    416                     int row = lsm.getMinSelectionIndex();
     416                    int row = panel.shortcutTable.convertRowIndexToModel(lsm.getMinSelectionIndex());
    417417                    Shortcut sc = (Shortcut)panel.model.getValueAt(row, -1);
    418418                    sc.setAssignedUser(!panel.cbDefault.isSelected());
Note: See TracChangeset for help on using the changeset viewer.