#18721 closed enhancement (fixed)
Overwrite key - Windows's layout [patch]
Reported by: | StephaneP | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 20.11 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description (last modified by )
Attachments (4)
Change History (18)
by , 5 years ago
Attachment: | josm_overwrite_.png added |
---|
comment:1 by , 5 years ago
Description: | modified (diff) |
---|
comment:3 by , 4 years ago
Milestone: | → 20.10 |
---|
The whole dialog is a bit confusing because the line "The new key is already used..." belongs to the other dialog when you edit the key of an existing tag to an already existing key. This line doesn't fit well here when you try to add a new tag and the key already exists.
Also it asks to "overwrite" which must be confirmed with "Replace". Using the same word is more intuitive for the user.
I'm working on a patch...
comment:4 by , 4 years ago
Summary: | Overwrite key - Windows's layout → Overwrite key - Windows's layout [patch] |
---|
-
TagEditHelper.java
407 407 private static boolean warnOverwriteKey(String action, String togglePref) { 408 408 return new ExtendedDialog( 409 409 MainApplication.getMainFrame(), 410 tr("Overwrite key"),411 tr(" Replace"), tr("Cancel"))410 tr("Overwrite tag"), 411 tr("Overwrite"), tr("Cancel")) 412 412 .setButtonIcons("ok", "cancel") 413 .setContent(action+'\n'+ tr(" The new key is already used, overwrite values?"))413 .setContent(action+'\n'+ tr("Overwrite?")) 414 414 .setCancelButton(2) 415 415 .toggleEnable(togglePref) 416 416 .showDialog().getValue() == 1; … … 543 543 } else { 544 544 for (OsmPrimitive osm: sel) { 545 545 if (osm.get(newkey) != null) { 546 if (!warnOverwriteKey(tr("You changed the key from ''{0}'' to ''{1}''. ", key, newkey),546 if (!warnOverwriteKey(tr("You changed the key from ''{0}'' to ''{1}''. The new key is already used.", key, newkey), 547 547 "overwriteEditKey")) 548 548 return; 549 549 break; … … 1099 1099 for (OsmPrimitive osm : sel) { 1100 1100 String val = osm.get(key); 1101 1101 if (val != null && !val.equals(value)) { 1102 if (!warnOverwriteKey(tr("You changed the value of ''{0}'' from ''{1}'' to ''{2}''.", key, val, value),1102 if (!warnOverwriteKey(tr("You changed the value of ''{0}''.\nOld and new value are:\n\n{1}\n{2}\n", key, val, value), 1103 1103 "overwriteAddKey")) 1104 1104 return; 1105 1105 break;
comment:5 by , 4 years ago
You changed the value of ''{0}''.\nOld and new value are:\n\n{1}\n{2}\n
This looks worse than before to me.
by , 4 years ago
Attachment: | 18721a.png added |
---|
comment:7 by , 4 years ago
The problem with just adding line breaks without rewording is regarding translation. E.g. in german you would need one more line than in english. I think thats not so optimal either.
You changed the value of
residenital
to
residential
Overwrite?
Du hast den Wert von
residenital
zu
residential
geändert
Überschreiben?
follow-up: 9 comment:8 by , 4 years ago
Another solution:
---
You changed an already existing value. Overwrite?
old: residenital
new: residential
---
Du hast einen bereits vorhandenen Wert geändert. Überschreiben?
alt: residenital
neu: residential
---
the old and new value should be verticaly aligned.
comment:9 by , 4 years ago
Replying to StephaneP:
the old and new value should be verticaly aligned.
Also had this idea, but the vertical alignment is not so trivial for translations.
Maybe use colors instead of words? red:old, new:green?
comment:10 by , 4 years ago
There is another problem. This warning does not check the value. Adding the existing value still triggers this warning but I do not change or replace any existing tag. E.g. have building=yes
and building:part=yes
. Changing building:part
to building
triggers this warning.
follow-up: 12 comment:11 by , 4 years ago
We could also reuse the red/green colouring of the history dialog (Help/Action/ObjectHistory#Overview), potentially displayed as two rows/lines (1st=old, 2nd=new)?
comment:12 by , 4 years ago
Replying to simon04:
We could also reuse the red/green colouring of the history dialog (Help/Action/ObjectHistory#Overview), potentially displayed as two rows/lines (1st=old, 2nd=new)?
Please still prefix it with old & new in that case, if it's not obvious which is which. #colorblind :)
by , 4 years ago
Attachment: | 2020-10-11-215811_297x216_scrot.png added |
---|
actual layout