Modify

Opened 14 years ago

Closed 14 years ago

#4546 closed defect (fixed)

Possibility to add custom search requests as toolbar buttons

Reported by: Komzpa Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: search Cc:

Description

A feature that allows calling some number of searches from a toolbar would be nice.

Sample usecases:

  1. User adds a toolbar button that searches for "child parent selected | parent selected". Wherever user wants to quickly select multipolygon with all the members, user presses that toolbar button.
  1. Fixing an import. User downloads an area, clicks a button that searches for "user:WHOEVER_IMPORTED -modified" and considers what else needs fixing.

Attachments (0)

Change History (12)

comment:1 by Ldp, 14 years ago

This is notably different from the search history. The search history doesn't survive a restart, and requires searches to be reentered after such a restart. The position of a certain search in the search history drop down isn't fixed, and can drop off if a mapper executes other searches. This could conveniently be addressed by allowing a mapper to move his (complex) searches into toolbar buttons.

comment:2 by Ldp, 14 years ago

#3952 is about searches not remembered across JOSM restarts. If I could bookmark favourite searches, I wouldn't mind that much about #3952 anymore.

comment:3 by malenki, 14 years ago

A good suggestion, I second this.

comment:4 by jttt, 14 years ago

(In [3175]) Allow to set parameters for actions on toolbar. Used by SearchAction to set searching expression (see #4546)

comment:5 by jttt, 14 years ago

This is now possible, but I'm keeping the ticket open because the implementation is not too good.

To add predefined search to toolbar, go to Preferences - Toolbar and add Search action. In bottom part of dialog, you can set search expression. Empty expression will show search dialog, non empty will perform search directly. You can add multiple searches to the toolbar (but they will all look the same).

Search expression can look like this: ACR test. A means result will be added to selection (possible values: R=replace, A=add to selection, D=remove from selection, S=in selection). C means case sensitive search and R is regexp search.

comment:6 by avarab@…, 14 years ago

Nice basic implementation. Maybe this should be closed and #4113 kept open.

I think the logical next step is to support search presets as I originally filed a bug for. That would make it easy to distribute searches via some XML file (e.g. for many people working on an import) and you could add toolbar buttons just like you can with presets now.

comment:7 by Ldp, 14 years ago

Excellent, very handy enhancement!

Showing the entered search expression as tooltip would be handy, as would the general possibility of entering your own label/image for a toolbar button.

And I notice that when I enter the search expression in the settings, it won't set it to that value unless I press <enter> in the text field. Could be some (Windows) JAVA-ism?

comment:8 by fsteggink, 14 years ago

I also like this addition. It could become better if it would be possible to use macros / multiple queries. For example, during the 3dShapes import it is necessary to remove duplicate nodes. In order to make sure that only the 3dShapes nodes are merged, the following sequence needs to be entered (with dup nodes selected): A parent selected; A parent selected; S source=3dShapes
The semicolon doesn't work, but is used for illustrative purposes and as a suggestion.

comment:9 by fsteggink, 14 years ago

Another idea for enhancement: it should be possible to edit the search string in a textbox, which appears by right-clicking the tool button.

comment:10 by anonymous, 14 years ago

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

comment:11 by Ldp, 14 years ago

Type: enhancementdefect

The toolbar searches seem to be broken currently.

Add Edit->Search as a toolbar button, configure a search expression (for example "R highway=residential") Click on the added search toolbar button. A "Preset" popup opens where you can scroll through a list of presets. The configured search expression does not run.

The preferences file does have "dialogs/search(searchExpression=R highway\=residential)".

Open the Preferences again: The "Search" entry is now showing as "Search preset" and the search expression field is gone. The preferences file now contains "dialogs/search".

comment:12 by stoecker, 14 years ago

Resolution: fixed
Status: newclosed

(In [3546]) fix #4546 - search dialog toolbar arguments broken

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.