I started to modify the code, but before add "repeat search", I thought to modify two other steps (agian in the delphi style):I am not much in favour of those two.
1) if search give "0" items found the searched string is not shwn in the tablist and a message is informing the user of failed search.
2) if the search was already done on the word "abc", the old tab is deleted and the new one shown.
Apparentlly I was succesful in doing both the above tasks... I'm testing, then I would like to share with you what I ave done (maybe I did something violating some coding rules in "Lazarus" team).You can submit them, then I will review them.
I am not much in favour of those two.I agree.
In the mean time I have also tried the command:For now you can submit the patch in here in the forum, as attachment.
diff oldSearchfrm.pas newSearchfrm.pas > diffSearchfrm.pas
(did the same for the other file)
it works, in the output file there is the difference, but then ? have I to subscribe to bugtracker ? and submit what ? the two difference files with what name ?
Sorry for these trivial questions, but for me it is a completely new field.No problem at all.
diff oldSearchfrm.pas newSearchfrm.pas > diffSearchfrm.pasNo. You should do :
diff oldSearchfrm.pas newSearchfrm.pas > diffSearchfrm.pasNo. You should do :
$ svn diff > mypatch.diff
You must have Lazarus trunk from SVN server. One patch can have changes for many source files.
If he does not, normal diff takes both files.Any substantial patch should be made against trunk (development version) code. Otherwise the chance for merge conflict is high.
But yes normal diff also benefits from >mypatch.diff
IMHO here is what should happen.+1
There should be a refresh button on the search-result-form. (Or a popup menu to the existing tabs, with a refresh entry / or both).
Then the search should be repeated. And the existing tab re-used in place.
Using the extended notebook (as used by source editor) and allow drag/drop changing the order of tabs.Yes, I have already missed the ability to reorder the tabs. How much work would it be? I guess not much because the component already supports it.
By the first patch here proposed, multiple result (same text and options) not allowed, that is clearer
showresult form now
@Juha: Any idea if that could be simplified?Just leave any options out at least now. It would add complication for very little benefit.
Better and more intuitive would be to support reordering the tabs by user. Is the current PageControl (or something?) easy to replace with the extended notebook? You have best knowledge of it.Its a drop in replacement. Should be possible to use the object-inspectors "change class" feature.
The "Search again" in Paolo's popup menu is good. Even better would be to have it in the tab itself, in addition to the TreeView under the tab.Thats why pdf attachments are not a good idea.
It only compares the SearchText, not the other search criteria. A user would want to search from different directories, using case sensitive/insensitive, regular expression etc., and have their results in separate tabs
The "Search again" in Paolo's popup menu is good. Even better would be to have it in the tab itself, in addition to the TreeView under the tab.this part of my code seems working correctly (I'll post the code asap), but according to your objection the result of "search again" should be on a separate tab or override the current one ? my view it was an override (essentially it was a refresh after changes in the code, if any), but according to your suggestions it should be shown on another tab for possible comparison, right ?
I was a focused on the "search" and not on the "search and compare", could have sense to have a checkbox like "show search result on separate tab", that when enabled the search works as now, when disable only latest search with same search criteria are shown ?
but according to your objection the result of "search again" should be on a separate tab or override the current one ? my view it was an override (essentially it was a refresh after changes in the code, if any), but according to your suggestions it should be shown on another tab for possible comparison, right ?
What about if we put both (see image)Yes, Martin already suggested it. Then search again would open the search dialog with the same settings.
refesh update (the current tab is override by new results)
search again (results shown on separate tab)
I am against that. A local popup menu on a search result tab will affect the selected tab. It is super intuitive.I was a focused on the "search" and not on the "search and compare", could have sense to have a checkbox like "show search result on separate tab", that when enabled the search works as now, when disable only latest search with same search criteria are shown ?See my previous comments, yes such a checkbox would help.
I will see and get some feedback from the rest of the team, as to were it should/could go.
Your function IfAlreadySearched in ide.patch does :QuoteIt only compares the SearchText, not the other search criteria. A user would want to search from different directories, using case sensitive/insensitive, regular expression etc., and have their results in separate tabsthis is partially true, my code leaves separate tabs for example if you enabled or disable "case sensitive" option (see pdf figure (1)), but you are right, it does not recognize some other changed criteria like different path search, thanks to point out this.
I replaced it in r64038.Better and more intuitive would be to support reordering the tabs by user. Is the current PageControl (or something?) easy to replace with the extended notebook? You have best knowledge of it.Its a drop in replacement. Should be possible to use the object-inspectors "change class" feature.
It would then need to handle the OnTabDragDrop event (and maybe other OnTab.... events) to make sure the treeviews are correctly associated (not sure how much work is needed there).
Clearly it does not compare the "Case sensitive" option. Maybe you have a private patch that does it, but you forgot to upload it.
Wow, it was maybe the easiest change in Lazarus code so far. I only set properties TabDragMode and TabDragAcceptMode to dmAutomatic and it works. No event handling was needed.With ctrl key, it shows "copy" cursor.
Please test.
it does in the options comparison !Yes, sorry! The Result was set there based on comparison. My bad.missed something?
result:=(SearchObj.fSearchOptions = FindInFilesDialogSingleton.Options);
With ctrl key, it shows "copy" cursor.That is a small imperfection. For consistency it should copy the tab if Ctrl-Drag is the standard way to do it.