Opened 3 years ago
Last modified 3 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:2 by , 3 years ago
A couple of comments from my perspective (feel free to disagree):
- I think that
isDirtyRelation()
should have a default implementation ofisDirtyRelation(false)
. You could go the other way (isDirtyRelation(boolean)
defaults to callingisDirtyRelation()
, 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 , 3 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.
Related to #12410 #12411 #15371 #16112