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:
- 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.
- 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 , 14 years ago
comment:2 by , 14 years ago
comment:4 by , 14 years ago
comment:5 by , 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 , 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 , 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 , 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 , 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:11 by , 14 years ago
Type: | enhancement → defect |
---|
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 , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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.