Modify

Opened 4 weeks ago

Closed 4 weeks ago

Last modified 4 weeks 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 4 weeks ago.
patch for reverter plugin
17514-v2.patch (3.5 KB) - added by GerdP 4 weeks ago.
17514-core.patch (1.6 KB) - added by GerdP 4 weeks ago.

Download all attachments as: .zip

Change History (17)

Changed 4 weeks ago by GerdP

Attachment: 17514.patch added

patch for reverter plugin

Changed 4 weeks ago by GerdP

Attachment: 17514-v2.patch added

comment:1 Changed 4 weeks ago by GerdP

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

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

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

comment:4 Changed 4 weeks ago by Don-vip

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

Changed 4 weeks ago by GerdP

Attachment: 17514-core.patch added

comment:5 in reply to:  4 Changed 4 weeks ago by GerdP

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

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

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

comment:8 Changed 4 weeks ago by GerdP

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

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

Last edited 4 weeks ago by GerdP (previous) (diff)

comment:11 Changed 4 weeks ago by GerdP

In 14930/josm:

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

comment:12 Changed 4 weeks ago by GerdP

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

comment:13 Changed 4 weeks ago by Klumbumbus

Milestone: 19.03

comment:14 in reply to:  11 Changed 4 weeks ago by Klumbumbus

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.

Add Comment


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

 
Note: See TracTickets for help on using tickets.