Opened 16 months ago

Last modified 16 months 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:


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.

Attachments (0)

Change History (3)

comment:1 Changed 16 months ago by Woazboat

Related to #12410 #12411 #15371 #16112

Last edited 16 months ago by Woazboat (previous) (diff)

comment:2 Changed 16 months ago by taylor.smock

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 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 Changed 16 months ago by Woazboat

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
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to Woazboat
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.