Modify

Opened 2 years ago

Last modified 2 years ago

#21840 new enhancement

[Patch] Automatically refresh relation editor on external changes

Reported by: Woazboat Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: Cc:

Description

Relation data in currently open relation editor windows is automatically reloaded when the relation is modified outside of the relation editor and there are no pending changes in the editor. If the relation has already been modified in the editor by the user and there are pending changes, display a warning notification instead that a conflict resolution will be required.

https://github.com/JOSM/josm/pull/88
https://patch-diff.githubusercontent.com/raw/JOSM/josm/pull/88.patch

Attachments (0)

Change History (3)

comment:1 by Woazboat, 2 years ago

Somewhat related to #12410 #12411

Version 1, edited 2 years ago by Woazboat (previous) (next) (diff)

comment:2 by taylor.smock, 2 years ago

A couple of comments from my perspective (feel free to disagree):

  • I think that isDirtyRelation() should have a default implementation of isDirtyRelation(false). You could go the other way (isDirtyRelation(boolean) defaults to calling isDirtyRelation(), which is probably better from an backward-looking standpoint, but it doesn't look like any plugins in SVN/JOSM GitHub use it).
  • You need to update GenericRelationEditorTest.java with the new method, if you aren't going to add a default implementation for isDirtyRelation(boolean).
  • Tests verifying the correctness of the logic would be nice. Unless we want someone to accidentally break it in the future. For this, you'd probably want to use JOptionPaneSimpleMocker.

comment:3 by Woazboat, 2 years ago

I added the default implementation for isDirtyRelation() and updated the test. Adding a unit test for the new refresh logic would be a bit more involved and also require some refactoring of the existing code as far as I can tell.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to Woazboat.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.