Modify

Opened 13 years ago

Closed 13 years ago

#6974 closed defect (fixed)

Ability to add custom search from search dialog

Reported by: akks Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: search, custom, toolbar Cc:

Description

I suggest a simple patch that modifies search dialog (Ctrl-F).
The checkbox is added to use selected search expression as a temporary 'custom search button' on toolbar.
I am not sure if we need saving this button in preferences.

It is an easy solution for cases like http://josm.openstreetmap.de/ticket/6779 - preferences are too far for average user ( for me too :) ).

If something should be improved in this patch, I can do it (or someone else).

Attachments (2)

addButton.patch (2.8 KB ) - added by akks 13 years ago.
customSearchActionPermanent.patch (2.8 KB ) - added by akks 13 years ago.

Download all attachments as: .zip

Change History (18)

by akks, 13 years ago

Attachment: addButton.patch added

comment:1 by akks, 13 years ago

No comments => no chance for this patch?

comment:2 by stoecker, 13 years ago

Hmm, my comment must have been lost: The button is really temporary - As soon as you open prefs and save it is lost. This is a very unexpected behaviour.

comment:3 by akks, 13 years ago

There is no big problem in saving these buttons, but how to clear them?
Make another window for editing search buttons?

By the way - is it possible to add simple context menu for toolbar buttons like "remove from panel"?

Last edited 13 years ago by akks (previous) (diff)

in reply to:  3 ; comment:4 by bastiK, 13 years ago

Replying to akks:

By the way - is it possible to add simple context menu for toolbar buttons like "remove from panel"?

Sounds reasonable - that's how it works in the Opera Browser.

in reply to:  4 comment:5 by akks, 13 years ago

Replying to bastiK:

Replying to akks:

By the way - is it possible to add simple context menu for toolbar buttons like "remove from panel"?

Sounds reasonable - that's how it works in the Opera Browser.

I have made a patch to add toolbar context menu and "show preferences" for now and posted it in corresponding ticket:

http://josm.openstreetmap.de/ticket/6953

There is unsolved problem - I do not know, how to show specific tab of preferences, not the first [without big refactoring].

Please have a look at it if you have some time.

If this patch will be applied, we can add custom search buttons permanently (I'll rewrite the SearchAction patch).

Version 2, edited 13 years ago by akks (previous) (next) (diff)

comment:6 by akks, 13 years ago

In reworked version of the patch custom search buttons are saved in preferences (ToolbarPreferences classes are used).

To remove them from toolbar, user should go to toolbar preferences or use context menu proposed in ticket:6953.

comment:7 by akks, 13 years ago

Summary: [PATCH] Ability to add custom search from search dialog[PATCH][v2] Ability to add custom search from search dialog

comment:8 by stoecker, 13 years ago

Resolution: fixed
Status: newclosed

In [4587/josm]:

fix #6974 - patch by akks - Ability to add custom search from search dialog

comment:9 by akks, 13 years ago

Thank you for really fast inclusion of the patches! :)

comment:10 by bastiK, 13 years ago

Resolution: fixed
Status: closedreopened

The toolbar button is added at the left. This is unexpected.

comment:11 by bastiK, 13 years ago

Also, it kills my toolbar:

  • add button
  • show tooltip for button

-> all buttons below tooltip are gone

next restart: only the search custom search button is there

comment:12 by bastiK, 13 years ago

Summary: [PATCH][v2] Ability to add custom search from search dialogAbility to add custom search from search dialog
Type: enhancementdefect

comment:13 by akks, 13 years ago

VERY strange! I can not reproduce it... (if "Show tooltip" means hold the mouse on the button).
(I am on Windows XP...)

Maybe, you are experimenting with preferences code?
Does it happen with clean preferences and josm-latest?

The adding code is

Collection<String> t = new LinkedList<String>(Main.pref.getCollection("toolbar"));
            if (t!=null) {
                // add custom search button to toolbar preferences
                if (!t.contains(res)) t.add(res);
                Main.pref.putCollection("toolbar", t);
                Main.toolbar.refreshToolbarControl();
            }
Last edited 13 years ago by akks (previous) (diff)

comment:14 by bastiK, 13 years ago

In [4613/josm]:

see #6974 - fix problem caused by preference rework

in reply to:  13 comment:15 by bastiK, 13 years ago

Replying to akks:

VERY strange! I can not reproduce it... (if "Show tooltip" means hold the mouse on the button).

Yes, apparently, it did not repaint properly after removing all the buttons.

Maybe, you are experimenting with preferences code?

You are exactly right. (Except I'm not experimenting, but it's supposed to work. :) )

comment:16 by bastiK, 13 years ago

Resolution: fixed
Status: reopenedclosed

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.