Modify

Opened 2 years ago

Closed 20 months ago

Last modified 20 months ago

#22623 closed enhancement (fixed)

[PATCH][RFC] BuildingTools: simpler mode switching

Reported by: richlv Owned by: Upliner
Priority: normal Milestone:
Component: Plugin buildings_tools Version: tested
Keywords: Cc:

Description

BuildingTools/BuildingsTools plugin is activated by the "b" shortcut key.
Sometimes, I accidentally switch into the round building mode. As I never recall how to exit it, each time it's an internet search.

The opposite is true - I cannot recall how to switch _to_ the round building mode, thus I never use it.

Perhaps the plugin can be changed to work in a more discoverable way, that would also be more consistent with other JOSM features.
Similar as "a" switches between the angled/free mode, and "s" switches between rectangular/lasso select modes, "b" could switch between the rectangular and round buildings.

Attachments (3)

22623.patch (2.2 KB ) - added by taylor.smock 2 years ago.
22623.2.patch (13.0 KB ) - added by taylor.smock 2 years ago.
Allow toggling between circle and rectangle modes (non-default behavior, requires user to change setting in Set buildings size -> Advanced)
buildings_tools.jar (77.8 KB ) - added by taylor.smock 2 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 by taylor.smock, 2 years ago

We actually have a ticket open from someone who doesn't like the fact that they can switch between rectangular/lasso select modes with s.

Anyway, Data -> Set building shape to <shape> seems fairly obvious to me. It also shows the keyboard shortcut on the right (on Mac, and I think it should do the same for Windows/Linux).

comment:2 by richlv, 2 years ago

What's the reasoning behind not liking that selection method?
It took a little while to get used to it when it was introduced, but now I find it pretty convenient.
Moving it all to menu entries does not seem feasible, as it would be at least 4 new entries for a/s modes only.

Thank you for mentioning the "Data" menu - it somehow did not occur to me that it would be hidden _there_.
I checked "Edit", "Tools" and tried all kinds of clicking on the building button in the vertical toolbar :)

in reply to:  2 comment:3 by taylor.smock, 2 years ago

Replying to richlv:

What's the reasoning behind not liking that selection method?

I think part of it is that there is a shortcut specifically for lasso mode, and they think there should be one specifically for box mode.

It took a little while to get used to it when it was introduced, but now I find it pretty convenient.
Moving it all to menu entries does not seem feasible, as it would be at least 4 new entries for a/s modes only.

Thank you for mentioning the "Data" menu - it somehow did not occur to me that it would be hidden _there_.
I checked "Edit", "Tools" and tried all kinds of clicking on the building button in the vertical toolbar :)

I'm tempted to move it to More Tools (I think we have that as an option), which would make a lot more sense than Data. But its been that way for <some long amount of time>, so I'm kind of leary about changing it.

I'll go ahead and throw together a quick patch for it. I cannot target it for a specific release (since it is a plugin), but hopefully those who care will see this ticket and give feedback...

by taylor.smock, 2 years ago

Attachment: 22623.patch added

comment:4 by taylor.smock, 2 years ago

@richlv: Let me know if the patched plugin makes sense to you.

comment:5 by taylor.smock, 2 years ago

Summary: BuildingTools: simpler mode switching[PATCH][RFC] BuildingTools: simpler mode switching

comment:6 by skyper, 2 years ago

Do not find the plugin under Plugins.
Maybe it would help to document the plugin on this wiki as the wiki pages work as internal help pages, too.

comment:7 by richlv, 2 years ago

Replaced the jarfile in ~/Library/JOSM/plugins , but cannot get 'b' to change modes.

comment:8 by GerdP, 2 years ago

I think the patch only moves the menu entries from "Data" to "More tools", I see no code to change the shortcut.

comment:9 by richlv, 2 years ago

Ah, I see - yes, the menu entry was moved, although my main concern is the inconsistent shortcut behaviour :)

comment:10 by taylor.smock, 2 years ago

That is funny -- it works for me.

Can you start JOSM from the command line, and look for anything that looks like

2023-01-09 05:55:11.602 INFO: Keystroke pressed B is already assigned to org.openstreetmap.josm.plugins.buildings_tools.DrawBuildingAction@a2341c6, will be overridden by org.openstreetmap.josm.plugins.buildings_tools.DrawBuildingAction@5163379c

Speaking of which, it looks like we should look into fixing that. It should still work (since it should be calling the same code, just in a different object).

comment:11 by richlv, 2 years ago

I always struggle with figuring out / recalling how to run from the CLI with webstart...
But with the posted messages, does that mean the cause is known?

in reply to:  9 comment:12 by taylor.smock, 2 years ago

Replying to richlv:

Ah, I see - yes, the menu entry was moved, although my main concern is the inconsistent shortcut behaviour :)

I'm going to assume comment:11 is referring to this as the problem, for which you hope we know the cause.

No, I do not know why you are seeing inconsistent behavior with the modified buildings_tools jar for the shortcut. You haven't changed the shortcut for the action, right?

Last edited 2 years ago by taylor.smock (previous) (diff)

comment:13 by richlv, 2 years ago

Downloaded josm-tested.jar, just to be sure. No messages were printed.
For this action, no shortcuts have been changed.

To clarify, I do not see "b" switching between rectangular and circular buildings even with the test version of the plugin.

comment:14 by taylor.smock, 2 years ago

I've gone ahead and uploaded a rebuilt version of the plugin. Hopefully it was some kind of compile-time issue.

comment:15 by richlv, 2 years ago

Wondering if there might be some misunderstanding still :)
Same behaviour with the latest custom plugin version.

By inconsistency I meant the original behaviour, where s/a shortcuts switch modes, b does not.

GerdP mentioned they do not see any changes to the shortcut code, maybe no behaviour change should be expected for now?

comment:16 by taylor.smock, 2 years ago

Yes, no behavior change should be expected for now.

This ticket has two problems

  • The buildings_tools actions should be more discoverable
    • So they probably shouldn't be in the Data menu, which is what my patch currently fixes. I anticipate that there will be some confusion in the community, so we'll probably want to put it in the wiki:StartupPageSource to avoid getting bug reports about the moved actions. Even though it isn't a JOSM core change.
    • EDIT: This is what the current patch changes.
  • "b" could switch between the rectangular and round buildings
    • The patch doesn't do anything with this yet. It will be a bit more complicated, but still doable.
Last edited 2 years ago by taylor.smock (previous) (diff)

comment:17 by taylor.smock, 2 years ago

Ticket #22676 has been marked as a duplicate of this ticket.

by taylor.smock, 2 years ago

Attachment: 22623.2.patch added

Allow toggling between circle and rectangle modes (non-default behavior, requires user to change setting in Set buildings size -> Advanced)

by taylor.smock, 2 years ago

Attachment: buildings_tools.jar added

comment:18 by taylor.smock, 20 months ago

Resolution: fixed
Status: newclosed

In 36081/osm:

Fix #22623: BuildingTools: simpler mode switching

This additionally moves the building tool from Data to More tools and fixes
some SonarLint issues.

comment:19 by taylor.smock, 20 months ago

@richlv: I won't be building a dist for it right now -- I want to give translators a chance to do some translating.

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.