Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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 StephaneP)

Hi!

Sometimes, it's difficult to compare the values when you overwrite a key. It could easier to read if the new values are display below the original. (Some carrier return to add)

Actual layout
actual layout

Example for a new layout
new_layout

Attachments (4)

josm_overwrite_.png (15.2 KB ) - added by StephaneP 4 years ago.
actual layout
josm_overwrite_new.png (24.2 KB ) - added by StephaneP 4 years ago.
new_layout
18721a.png (20.1 KB ) - added by Klumbumbus 4 years ago.
2020-10-11-215811_297x216_scrot.png (5.3 KB ) - added by simon04 4 years ago.

Download all attachments as: .zip

Change History (18)

by StephaneP, 4 years ago

Attachment: josm_overwrite_.png added

actual layout

by StephaneP, 4 years ago

Attachment: josm_overwrite_new.png added

new_layout

comment:1 by StephaneP, 4 years ago

Description: modified (diff)

comment:2 by Klumbumbus, 4 years ago

In 17061/josm:

see #18721 - Use better icon for replace value dialog, "purge" didn't fit well here.

comment:3 by Klumbumbus, 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 Klumbumbus, 4 years ago

Summary: Overwrite key - Windows's layoutOverwrite key - Windows's layout [patch]
  • TagEditHelper.java

     
    407407    private static boolean warnOverwriteKey(String action, String togglePref) {
    408408        return new ExtendedDialog(
    409409                MainApplication.getMainFrame(),
    410                 tr("Overwrite key"),
    411                 tr("Replace"), tr("Cancel"))
     410                tr("Overwrite tag"),
     411                tr("Overwrite"), tr("Cancel"))
    412412            .setButtonIcons("ok", "cancel")
    413             .setContent(action+'\n'+ tr("The new key is already used, overwrite values?"))
     413            .setContent(action+'\n'+ tr("Overwrite?"))
    414414            .setCancelButton(2)
    415415            .toggleEnable(togglePref)
    416416            .showDialog().getValue() == 1;
     
    543543            } else {
    544544                for (OsmPrimitive osm: sel) {
    545545                    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),
    547547                                "overwriteEditKey"))
    548548                            return;
    549549                        break;
     
    10991099            for (OsmPrimitive osm : sel) {
    11001100                String val = osm.get(key);
    11011101                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),
    11031103                            "overwriteAddKey"))
    11041104                        return;
    11051105                    break;

comment:5 by stoecker, 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.

Last edited 4 years ago by stoecker (previous) (diff)

by Klumbumbus, 4 years ago

Attachment: 18721a.png added

comment:6 by Klumbumbus, 4 years ago

This is with the patch:

comment:7 by Klumbumbus, 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?

Last edited 4 years ago by Klumbumbus (previous) (diff)

comment:8 by StephaneP, 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.

in reply to:  8 comment:9 by stoecker, 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 skyper, 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.

comment:11 by simon04, 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)?

in reply to:  11 comment:12 by anonymous, 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 :)

comment:13 by simon04, 4 years ago

Resolution: fixed
Status: newclosed

In 17168/josm:

fix #18721 - PropertiesDialog: improve "overwrite key" dialog (based on patch by StephaneP)

by simon04, 4 years ago

comment:14 by Don-vip, 4 years ago

Milestone: 20.1020.11

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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