Skip to content

Commit

Permalink
Add some more keyboard shortcuts and update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpoole committed Jan 12, 2024
1 parent 9fde3fa commit 8d3e420
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 19 deletions.
17 changes: 16 additions & 1 deletion documentation/docs/help/en/Adding way nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,25 @@ The complete way can be moved without leaving this mode.

Tapping the icon once will undo the last addition of a node.

### ![Preset](../images/tag_menu_preset.png) Add preset
### ![Snap](../images/snap_on.png) ![Snap](../images/snap_off.png) Snap

When the snap function is active, newly created nodes near to other nodes and ways will snap on to these automatically creating connections. It the checkbox is not checked
nodes will be created without merging with other objects. You can toggle this while you are drawing a way.

Note: when the checkbox is not checked you need to manually close closed ways, for example a building outline.

#### ![Preset](../images/tag_menu_preset.png) Add preset

Create the current new object, launch the [property editor](../en/Property%20editor.md) and immediately display the preset tab. In multi-pane mode this will simply start the property editor.

### ![Follow](../images/follow.png) Follow way

If two consecutive nodes overlap with nodes of an existing way you can follow the existing way to one of its nodes after clicking the button.

### ![Address](../images/address.png) Add address tags

Adds address tags with prediction. If the way is closed this will add the predicted address tags and start the [property editor](../en/Property%20editor.md). If the way is not closed an address interpolation is created and a dedicated editor is started.

### ![Help](../images/menu_help.png) Help

Start the Vespucci Help browser.
10 changes: 10 additions & 0 deletions documentation/docs/help/en/Keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ The alphabetic menu shortcuts should be usable with `<Ctrl>` + letter.
__m__ Merge (if possible)

__s__ Square / straighten (if possible)

### Path creation

__u__ Undo

__f__ Follow way (if possible)

__e__ Finish way and start the property editor

__a__ Finish way and if a closed way start the property editor with address prediction, if an open way start the address interpolation modal

### Property editor

Expand Down
12 changes: 8 additions & 4 deletions documentation/docs/help/en/Simple actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ nodes will be created without merging with other objects. You can toggle this wh

Note: when the checkbox is not checked you need to manually close closed ways, for example a building outline.

#### ![Address](../images/address.png) Add address tags

Adds address tags with prediction. If the way is closed this will add the predicted address tags and start the [property editor](../en/Property%20editor.md). If the way is not closed an address interpolation is created and a dedicated editor is started.

#### ![Preset](../images/tag_menu_preset.png) Add preset

Create the current new object, launch the [property editor](../en/Property%20editor.md) and immediately display the preset tab. In multi-pane mode this will simply start the property editor.

### ![Follow](../images/follow.png) Follow way

If two consecutive nodes overlap with nodes of an existing way you can follow the existing way to one of its nodes after clicking the button.

#### ![Address](../images/address.png) Add address tags

Adds address tags with prediction. If the way is closed this will add the predicted address tags and start the [property editor](../en/Property%20editor.md). If the way is not closed an address interpolation is created and a dedicated editor is started.

### Add map note

Create a new OSM map note at the tapped position, starting the note editor.
Expand Down
Binary file added documentation/docs/help/images/follow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion src/main/assets/help/en/Adding way nodes.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ <h1>Adding way nodes</h1>
<h2>Further actions</h2>
<h3><img src="../images/undolist_undo.png" alt="Undo" /> Undo</h3>
<p>Tapping the icon once will undo the last addition of a node.</p>
<h3><img src="../images/tag_menu_preset.png" alt="Preset" /> Add preset</h3>
<h3><img src="../images/snap_on.png" alt="Snap" /> <img src="../images/snap_off.png" alt="Snap" /> Snap</h3>
<p>When the snap function is active, newly created nodes near to other nodes and ways will snap on to these automatically creating connections. It the checkbox is not checked nodes will be created without merging with other objects. You can toggle this while you are drawing a way.</p>
<p>Note: when the checkbox is not checked you need to manually close closed ways, for example a building outline.</p>
<h4><img src="../images/tag_menu_preset.png" alt="Preset" /> Add preset</h4>
<p>Create the current new object, launch the <a href="../en/Property%20editor.md">property editor</a> and immediately display the preset tab. In multi-pane mode this will simply start the property editor.</p>
<h3><img src="../images/follow.png" alt="Follow" /> Follow way</h3>
<p>If two consecutive nodes overlap with nodes of an existing way you can follow the existing way to one of its nodes after clicking the button.</p>
<h3><img src="../images/address.png" alt="Address" /> Add address tags</h3>
<p>Adds address tags with prediction. If the way is closed this will add the predicted address tags and start the <a href="../en/Property%20editor.md">property editor</a>. If the way is not closed an address interpolation is created and a dedicated editor is started.</p>
<h3><img src="../images/menu_help.png" alt="Help" /> Help</h3>
<p>Start the Vespucci Help browser.</p>

Expand Down
5 changes: 5 additions & 0 deletions src/main/assets/help/en/Keyboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ <h3>Way selected</h3>
<h3>Multi-select</h3>
<p><strong>m</strong> Merge (if possible)</p>
<p><strong>s</strong> Square / straighten (if possible)</p>
<h3>Path creation</h3>
<p><strong>u</strong> Undo</p>
<p><strong>f</strong> Follow way (if possible)</p>
<p><strong>e</strong> Finish way and start the property editor</p>
<p><strong>a</strong> Finish way and if a closed way start the property editor with address prediction, if an open way start the address interpolation modal</p>
<h3>Property editor</h3>
<p><strong>c</strong> Copy</p>
<p><strong>x</strong> Cut</p>
Expand Down
6 changes: 4 additions & 2 deletions src/main/assets/help/en/Simple actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ <h3>Add way</h3>
<h4><img src="../images/snap_on.png" alt="Snap" /> <img src="../images/snap_off.png" alt="Snap" /> Snap</h4>
<p>When the snap function is active, newly created nodes near to other nodes and ways will snap on to these automatically creating connections. It the checkbox is not checked nodes will be created without merging with other objects. You can toggle this while you are drawing a way.</p>
<p>Note: when the checkbox is not checked you need to manually close closed ways, for example a building outline.</p>
<h4><img src="../images/address.png" alt="Address" /> Add address tags</h4>
<p>Adds address tags with prediction. If the way is closed this will add the predicted address tags and start the <a href="../en/Property%20editor.md">property editor</a>. If the way is not closed an address interpolation is created and a dedicated editor is started.</p>
<h4><img src="../images/tag_menu_preset.png" alt="Preset" /> Add preset</h4>
<p>Create the current new object, launch the <a href="../en/Property%20editor.md">property editor</a> and immediately display the preset tab. In multi-pane mode this will simply start the property editor.</p>
<h3><img src="../images/follow.png" alt="Follow" /> Follow way</h3>
<p>If two consecutive nodes overlap with nodes of an existing way you can follow the existing way to one of its nodes after clicking the button.</p>
<h4><img src="../images/address.png" alt="Address" /> Add address tags</h4>
<p>Adds address tags with prediction. If the way is closed this will add the predicted address tags and start the <a href="../en/Property%20editor.md">property editor</a>. If the way is not closed an address interpolation is created and a dedicated editor is started.</p>
<h3>Add map note</h3>
<p>Create a new OSM map note at the tapped position, starting the note editor.</p>
<h3>Add node</h3>
Expand Down
Binary file added src/main/assets/help/images/follow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -447,17 +447,7 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
return true;
case MENUITEM_NEWWAY_PRESET:
case MENUITEM_ADDRESS:
Way lastSelectedWay = logic.getSelectedWay();
if (lastSelectedWay != null) {
dontTag = true;
main.startSupportActionMode(new WaySelectionActionModeCallback(manager, lastSelectedWay));
if (itemId == MENUITEM_ADDRESS && !lastSelectedWay.isClosed()) {
AddressInterpolationDialog.showDialog(main, lastSelectedWay);
} else {
// show preset screen
main.performTagEdit(lastSelectedWay, null, itemId == MENUITEM_ADDRESS, itemId == MENUITEM_NEWWAY_PRESET);
}
}
handleTagEdit(itemId);
return true;
default:
Log.e(DEBUG_TAG, "Unknown menu item");
Expand All @@ -466,6 +456,25 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
return false;
}

/**
* Finish creating the way and start either the property editor or the address interpolation dialog
*
* @param itemId either MENUITEM_ADDRESS or MENUITEM_NEWWAY_PRESET to determine the behaviour
*/
private void handleTagEdit(final int itemId) {
Way lastSelectedWay = logic.getSelectedWay();
if (lastSelectedWay != null) {
dontTag = true;
main.startSupportActionMode(new WaySelectionActionModeCallback(manager, lastSelectedWay));
if (itemId == MENUITEM_ADDRESS && !lastSelectedWay.isClosed()) {
AddressInterpolationDialog.showDialog(main, lastSelectedWay);
} else {
// show preset screen
main.performTagEdit(lastSelectedWay, null, itemId == MENUITEM_ADDRESS, itemId == MENUITEM_NEWWAY_PRESET);
}
}
}

/**
* Setup follow way selection
*/
Expand Down Expand Up @@ -620,6 +629,18 @@ public boolean processShortcut(Character c) {
handleFollow();
return true;
}
if (c == Util.getShortCut(main, R.string.shortcut_tagedit)) {
handleTagEdit(MENUITEM_NEWWAY_PRESET);
return true;
}
if (c == Util.getShortCut(main, R.string.shortcut_tagedit)) {
handleTagEdit(MENUITEM_NEWWAY_PRESET);
return true;
}
if (c == Util.getShortCut(main, R.string.shortcut_address)) {
handleTagEdit(MENUITEM_ADDRESS);
return true;
}
return super.processShortcut(c);
}

Expand Down
1 change: 1 addition & 0 deletions src/main/res/values/shortcuts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
<string name="shortcut_square">s</string>
<string name="shortcut_remove">r</string>
<string name="shortcut_follow">f</string>
<string name="shortcut_address">a</string>
</resources>

0 comments on commit 8d3e420

Please sign in to comment.