Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#17514 closed enhancement (fixed)

Allow to paste full changeset URL in fields where a changeset id is expected

Reported by: GerdP Owned by: Upliner
Priority: normal Milestone: 19.03
Component: Plugin reverter Version:
Keywords: Cc:

Description

When you have a full URL like https://www.openstreetmap.org/changeset/68423696 in the clipboard
and open the reverter dialog (Ctrl+Shift+T) the dialog will show an empty field.
If the clipboard contains a number, e.g. 68423696 the dialog will show that number.
The dialog should be able to extract the changeset id from a full URL or a list of URLs separated by space.

Similar problem is in the Changeset Manager dialog, but it doesn't even try to automatically evaluate the clipboard.

Attachments (3)

17514.patch (1.1 KB ) - added by GerdP 5 years ago.
patch for reverter plugin
17514-v2.patch (3.5 KB ) - added by GerdP 5 years ago.
17514-core.patch (1.6 KB ) - added by GerdP 5 years ago.

Download all attachments as: .zip

Change History (17)

by GerdP, 5 years ago

Attachment: 17514.patch added

patch for reverter plugin

by GerdP, 5 years ago

Attachment: 17514-v2.patch added

comment:1 by GerdP, 5 years ago

Please review: Version 2 of the patch also changes the tooltip texts and adds some Javadoc.
I am not sure if the usage I18N.tr() is OK?

comment:2 by stoecker, 5 years ago

No. You never append tr() strings or modify them in any way. If you want to include something, then add {0} and pass it as argument.

Never make assumptions about the structure in other languages. Other languages may have such texts at the beginning, in the middle, with quotes around or whatever.

comment:3 by GerdP, 5 years ago

reverter fixed with [o34938:34939]
Hope I got the I18N usage right now. Working now on a patch for the core.

comment:4 by Don-vip, 5 years ago

typo: The current value is not a a list of valid changeset IDs

by GerdP, 5 years ago

Attachment: 17514-core.patch added

in reply to:  4 comment:5 by GerdP, 5 years ago

Replying to Don-vip:

typo: The current value is not a a list of valid changeset IDs

Oops. Should I just remove the duplicated a or should I change it to
The current input is not a list of valid changeset IDs?

comment:6 by GerdP, 5 years ago

There is a problem with the ChangesetCacheManager and the automatic evaluation of the clipboard. This works only when the ChangesetCacheManager is used for the first time. Working on that as well...

comment:7 by stoecker, 5 years ago

It's {0}, not {0], but you're still making assumptions.

If you have, like here, strings which seem to have something in common, do NOT extract the common part. Simply make two strings, each one correct and leave the duplicated parts duplicate. With such "optimizations" you don't make life easier for translators, but harder.

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

comment:8 by GerdP, 5 years ago

OK, how do I write this long string?

                feedbackInvalid(tr("The current input is not a list of valid changeset IDs. Please enter one or more integer values > 0 or full changeset URLs."));

so that I don't get a checktyle warning "line too long"?

comment:9 by GerdP, 5 years ago

From the javadoc I learn this should work:

                feedbackInvalid(tr("The current input is not a list of valid changeset IDs. "
                        + "Please enter one or more integer values > 0 or full changeset URLs."));

comment:10 by GerdP, 5 years ago

see [o34941:34942]

Last edited 5 years ago by GerdP (previous) (diff)

comment:11 by GerdP, 5 years ago

In 14930/josm:

see #17514: Allow to paste full changeset URL where changeset id is expected

comment:12 by GerdP, 5 years ago

Resolution: fixed
Status: newclosed

I'll open a new ticket for the problem mentioned in comment:6. It is also a memory leak and I don't want to fix that before 19.3 is released. See #17517

Last edited 5 years ago by GerdP (previous) (diff)

comment:13 by Klumbumbus, 5 years ago

Milestone: 19.03

in reply to:  11 comment:14 by Klumbumbus, 5 years ago

Replying to GerdP:

In 14930/josm:

see #17514: Allow to paste full changeset URL where changeset id is expected

It would be good if you could document such enhancements in the wiki. This way chances are higher that some users actually discover and use these features.
In this case it's just an addition of a part of a sentence: wiki:/Help/Dialog/ChangesetManager#QueryanddownloadachangesetbyitsuniqueID.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Upliner.
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.