Modify

Opened 8 months ago

Closed 2 weeks ago

#18721 closed enhancement (fixed)

Overwrite key - Windows's layout [patch]

Reported by: StephaneP Owned by: team
Priority: normal Milestone: 20.10
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 8 months ago.
actual layout
josm_overwrite_new.png (24.2 KB) - added by StephaneP 8 months ago.
new_layout
18721a.png (20.1 KB) - added by Klumbumbus 4 weeks ago.
2020-10-11-215811_297x216_scrot.png (5.3 KB) - added by simon04 2 weeks ago.

Download all attachments as: .zip

Change History (17)

Changed 8 months ago by StephaneP

Attachment: josm_overwrite_.png added

actual layout

Changed 8 months ago by StephaneP

Attachment: josm_overwrite_new.png added

new_layout

comment:1 Changed 8 months ago by StephaneP

Description: modified (diff)

comment:2 Changed 4 weeks ago by Klumbumbus

In 17061/josm:

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

comment:3 Changed 4 weeks ago by Klumbumbus

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 Changed 4 weeks ago by Klumbumbus

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 Changed 4 weeks ago by stoecker

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 weeks ago by stoecker (previous) (diff)

Changed 4 weeks ago by Klumbumbus

Attachment: 18721a.png added

comment:6 Changed 4 weeks ago by Klumbumbus

This is with the patch:

comment:7 Changed 4 weeks ago by Klumbumbus

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 weeks ago by Klumbumbus (previous) (diff)

comment:8 Changed 4 weeks ago by StephaneP

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 in reply to:  8 Changed 4 weeks ago by stoecker

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 Changed 4 weeks ago by skyper

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 Changed 2 weeks ago by 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)?

comment:12 in reply to:  11 Changed 2 weeks ago by anonymous

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 Changed 2 weeks ago by simon04

Resolution: fixed
Status: newclosed

In 17168/josm:

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

Changed 2 weeks ago by simon04

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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.