Skip to content

Undo loses current selection #5

@john-h-kastner

Description

@john-h-kastner

Clicking undo while editing a route causes the route to no longer be selected. The is a particular issue in my workflow where I am adding points to a route, make a mistake, undo the mistake, and would then like to continue where I left off without reselecting the route in in the side bar.

Steps to Reproduce

  1. Create a new GPX file
  2. Create some new points
  3. Click "Undo"
  4. Attempt to add more points.
  5. Notice that you cannot do this, and the buttons for doing this have be deactivate.

Proposed Solution

If I comment out the call to setActiveGpx on line 509 fo ActiveGpxObjects.java, I get the behavior I want.

Object currSelection = tree.getLastSelectedPathComponent();
if (currSelection == null) {
setActiveGpx(null);
return;
}

I'm using this fix at any rate, but I think it's not the best way to go. The call to getLastSelectedPathComponent() is coming up null for some reason, and this would ideally be resolved. It is also likely that that setActiveGpx(null) should be called sometimes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions