Author Topic: ThreadSearch plugin 0.6 release  (Read 10894 times)

Offline dje

  • Lives here!
  • ****
  • Posts: 683
ThreadSearch plugin 0.6 release
« on: April 23, 2007, 09:24:29 pm »
Hi all !

I took time but I'm proud to release ThreadSearch plugin 0.6  :D
It runs finally both on Windows AND Linux (I can not test on other OSs but sources are available  :))
Stability is improved a lot.

The "ThreadSearch" plugin offers the following features:
  • multi-threaded "Search in files"
  • preview of the results (left single click on log window)
  • file open (left double click on log window)
  • check boxes instead of radio boxes to allow searches with both project and directories for example.
  • contextual menu "Find occurrences" to start a search in files with the word under cursor (can be activated or not)

Why ?
  • I am working on very big projects (700 Mo of cpp, h files) and text searches take up to 5 minutes. It is very frustrating being blocked because of the search. It is now possible to continue editing code during searches.
  • I do not like leaving the editor position to browse 'Search in files' resuts. There is now the 'Code preview' to do this with possibility to open the file at the right position.

I massively rewrote the code to solve major problems, ie application hanging on cancel, crash and GUI problems on Linux.
I rewrote my own search classes to avoid the use of GUI items in the worker thread and I use a shared queue in the main thread to cancel quickly a search.
@eranif thanks for your proposition, but I had already rewritten the code when you posted it
Hi dje!,

I recently developed a search thread that supports the following:
- match case
- match whole word
- regular expression
- file extensions
- events and easy interface with the main thread

Source code (5 sources + 1 sample):
http://www.eistware.com/st/SearchThread.zip

What's new:
  • Runs on Linux
  • GUI correction on Linux (preview window took more place than available in the notebook page)
  • Bug correction by Jamie : the file was not reloaded in the preview window when externally modified
  • No crash on very long search (form the root of wxWidgets for example)
  • Application does not hang any more on find Cancel
  • Added the possibility to hide/show columns header in list control to spare space
  • Added the possibility to draw lines to separate columns in list control
  • Minor bugs corrections

Limitations :
  • On Windows, I put the full path of the files in a small column because tooltips gives it. It does not work on Linux (no tooltip).
  • For sure, when user choose to hide list control column headers, colums cannot be resized.

Installation :
To build the plugin, extract the source code in src\plugins\contrib\ThreadSearch, open the CodeBlocks project and build it. The .cbplugin is generated in src\plugins\contrib\ThreadSearch and is ready for install.

Thanks to Pecan to inform me on wxListCtrl problems on Linux. Now my code runs on Linux (at least on Ubuntu  :))
Thanks to Jamie for code propositions/corrections.
Thanks to users for suggestions and congratulations. They are really appreciated !
I'll write a status concerning future evolutions.

Dje

« Last Edit: April 24, 2007, 08:28:39 pm by dje »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: ThreadSearch plugin 0.6 release
« Reply #1 on: April 24, 2007, 11:23:22 pm »
Just for the record: Where are the sources again? As usual the binary is not compatible with my version of C::B... :-( I guess I missed something...?!
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #2 on: April 25, 2007, 08:23:50 am »
Oups, I forgot the sources link  :oops:

It still GPLed !
ThreadSearch 0.6 sources

Quote
As usual the binary is not compatible with my version of C::B...
The same problem remains... Binary is provided for latest nightly but does not work with debugging environment.
I began working on it but it is not finished. A new target has appeared in the project for debug.
You have to link with the debug static lib instead of the dlls.

Sorry,

Dje
« Last Edit: April 25, 2007, 08:28:08 am by dje »

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #3 on: April 26, 2007, 01:48:47 pm »
Hi all !

Quote
News: Better no news than bad news   :wink:

No feedback... Does it mean that everything is OK both on Windows and Linux, that this plugin is not interesting or that the weather is too beautiful for developping ?

Dje

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: ThreadSearch plugin 0.6 release
« Reply #4 on: April 26, 2007, 02:06:26 pm »
No feedback... Does it mean that everything is OK [...]
Ooops - sorry, I missed that you had posted the sources... compiling now... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: ThreadSearch plugin 0.6 release
« Reply #5 on: April 26, 2007, 10:27:32 pm »
No feedback... Does it mean that everything is OK [...]
Ooops - sorry, I missed that you had posted the sources... compiling now... ;-)
Reporting back. After having used this plugin "the whole day" - at least for all searched I did - I have to say: Seems to work just fine! The only minor issue I had in the beginning was the following:
I had the ThreadSearch-tab open, but not active. Thus when I selected ThreadSearch from the menu it was hidden! If the tab is visible but *not* active (behind e.g. the build tab) then the menu should better just bring it to front instead of making it invisible. It's misleading otherwise.
Besides that thingy - no other bug to report... sorry! ;-)
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #6 on: April 26, 2007, 10:44:24 pm »
I know that point...

I agree with you but I implemented it that way because script console and other are.

The "philosophy" adopted by the view menu seems to be "member of the Messages notebook" and has nothing to do with real visibility of the item.

That is why the item is removed from notebook when not active instead of being activated.

Maybe should I propose two items, one for notebook integration, another one for item activation.
What I don't like is menu overload...

I think there should be a concertation to manage all notebooks pages the same way.

Dje

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: ThreadSearch plugin 0.6 release
« Reply #7 on: April 26, 2007, 10:52:13 pm »
Maybe should I propose two items, one for notebook integration, another one for item activation.
What I don't like is menu overload...
Hmmm... I understand and you're right. The only thing that came into my mind was to use a checked menu item as for the other notebook pages instead. Thus it would be directly visible whether it *is* already visible nut not activated or not...?! What do you think? This would also be conform to the other notebook pages that can be toggled in visibility (e.g. script console...)...
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #8 on: April 27, 2007, 12:48:06 am »
I had open a bug on this point :
bug 5358

It is now corrected and I didn't apply the correction to behave the same way.
Shame on me !!  :oops:

It will be fixed on next release.

I am working for now on the evolutions required by wxWidgets 2.8.3 (at least one change).

I'll probably release two binaries for both wxWidgets versions.

Dje

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: ThreadSearch plugin 0.6 release
« Reply #9 on: June 07, 2007, 11:09:22 pm »
Hi dje,

I have tried to build Thread Search from sources with wxWidgets 2.8.4 and get a lot of errors during compilation. Is there a new version available that works with wxWidgets 2.8.4?

Bye,

Mario

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #10 on: June 07, 2007, 11:32:12 pm »
Hi Mario !

I am working on toolbar integration for now with wxWidgets 2.8.3 (didn't you ask for this ?  :wink:).
Next release will integrate it and as soon as it works, I'll probably go on 2.8.4

The only change I did is to replace
Code: [Select]
bool show = !m_pSizerSearchDirItems->IsShown(m_pSizerSearchDirItems);by
Code: [Select]
bool show = !m_pPnlDirParams->IsShown();
But I am quite surprised when you speak about "lots of errors" because there was few problems from 2.6.3 to 2.8.3.

Could you send an informative log ?

Dje

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: ThreadSearch plugin 0.6 release
« Reply #11 on: June 08, 2007, 12:14:10 am »
Hi dje,

I changed the source code as you said and removed the event.cpp file from the project and modified the linker settings for wxwidgets 2.8.4.
Now it works fine.

Thanks.

Bye,

Mario

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: ThreadSearch plugin 0.6 release
« Reply #12 on: June 10, 2007, 12:00:59 am »
Hi dje,

as codeblocks will be used more and more for embedded programming the default search mask should be *.cpp, *.c, *.h.

Thanks,

Mario

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #13 on: June 10, 2007, 12:08:41 am »
Quote
as codeblocks will be used more and more for embedded programming the default search mask should be *.cpp, *.c, *.h.
OK, no problem, that's done (heavy workload :lol:).

For now it is *.cpp;*.h and current (modified) mask is saved in default.conf.

Dje

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: ThreadSearch plugin 0.6 release
« Reply #14 on: June 12, 2007, 01:34:58 pm »
I am working on toolbar integration for now with wxWidgets 2.8.3 (didn't you ask for this ?  :wink:).
Next release will integrate it and as soon as it works, I'll probably go on 2.8.4

The only change I did is to replace
Code: [Select]
bool show = !m_pSizerSearchDirItems->IsShown(m_pSizerSearchDirItems);by
Code: [Select]
bool show = !m_pPnlDirParams->IsShown();

first i did the above change

then i removed the files
\wx\include\wx\event.h
\wx\src\common\event.cpp
from the source files in the project settings
they are obviously not neccessary for building the plugin

finally i could build your fine and useful plugin using wxWidgets 2.8.4

i don't know about any problems with toolbar integration
but it seems basically to work fine.


later on i removed the devel target from the ThreadSearch project,
because i think it isn't necessary

following the rule how all other plugins and CB itself is build,
i think it's better to build the ThreadSearch plugin with debug info (using WX release dll)
and the output tree is stripped off the debug info later on during the update process.

thx for this fine plugin,
brgds tiwag

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #15 on: June 12, 2007, 02:07:50 pm »
then i removed the files
\wx\include\wx\event.h
\wx\src\common\event.cpp
from the source files in the project settings
they are obviously not neccessary for building the plugin
As I often needed to browse events implementation, I put these files in my project and forgot to remove them before delivery.
But I did not include them in build and link processes. They will be removed on next release.

i don't know about any problems with toolbar integration
but it seems basically to work fine.
A wxToolBar will be available to use the ThreadSearch plugin with the search combobox and buttons and the options buttons.
User will choose to use either toolbar or current controls of the ThreadSearch panel or both.
Using toolbar and removing current controls will spare space on the panel.

thx for this fine plugin,
Thanks for writing it  :D

Dje

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: ThreadSearch plugin 0.6 release
« Reply #16 on: June 12, 2007, 03:21:33 pm »
Hi Dje,

you should use the great codesnippets browser for accessing files.
Just add  a codesnippet and convert it to a file link (location of file) event.cpp. Then drag the snippet item in the open file list and it will be opened in codeblocks editor, otherwise the codesnippet editor is used. Try this it is really cool. It works also with other files e.g pdf Files.
Add a file link to pdf file and configure the extension *.pdf in the environment settings (extension handling) then a pdf reader will be opened if you drag the file link to the open file list.

Bye,

Mario

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: ThreadSearch plugin 0.6 release
« Reply #17 on: June 12, 2007, 03:51:19 pm »
(see attachment for details).

As the size of attachment is limited to 192K I had to remove the pics and pdf version is to large. Sorry for that.

I would like to provide the pdf version to the codeblocks coummunity, how can I do that.

Bye,

Mario

[attachment deleted by admin]

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: ThreadSearch plugin 0.6 release
« Reply #18 on: June 12, 2007, 04:18:47 pm »
Hi Mario !

When I do
Quote
Just add  a codesnippet and convert it to a file link (location of file) event.cpp.
It overwrites my file !! (SVN 3989)
I can perform what you say by creating a snippet, right click on properties and click on Link target
I had never used this plugin but it is true it seems very interesting (thanks Pecan)

Quote
I would like to provide the pdf version to the codeblocks coummunity, how can I do that.
You should put your file on another server, I use esnips for my deliveries and I am very satisfied (free, easy to use).
I read parts of it and it looks great ! I think you should create a post, as it is quite different from the subject of this one.

Dje

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2180
Re: ThreadSearch plugin 0.6 release
« Reply #19 on: June 12, 2007, 04:39:25 pm »
...
As the size of attachment is limited to 192K I had to remove the pics and pdf version is to large. Sorry for that.

I would like to provide the pdf version to the codeblocks coummunity, how can I do that.
..

Nice Articles, thanks.

You could upload the pdf to http://savefile.com/ or the like and place a link to the pdf in the wiki.

Or, you could just format and place the whole article in the wiki.

Some recent changes to CodeSnippets allow the user to:
  • Drag'n'Drop on Linux just like MSWindows
  • Convert to FileLink directly from the context menu, not just from the properties dialog
  • You do not have to drag edited FileLinks back from CodeBlocks to CodeSnippets, Because both CodeBlocks and CodeSnippets are linking to the same file. Just do a save after editing.
  • You DO have to drag CodeBlocks edited "text only" snippets back to CodeSnippets if you want the text saved. Or just use cut and paste.
  • Dragging WorkSpace, Projects, or filenames from CodeBlocks over the top of a CodeSnippets tree root or category will create a new FileLink to that file. You then just use properties to rename the new snippet.
    Do this drag relatively slowly so CodeSnippets can see the drag exiting the Opened Files/Management window and have time to create a text/file drag list.
    If CodeSnippets is "docked" in CodeBlocks, drag the items entirely out of CodeBlocks (in order to create the drag exit event), then back around into the docked CodeSnippets window.
« Last Edit: June 12, 2007, 04:57:31 pm by Pecan »

Offline mariocup

  • Developer
  • Lives here!
  • *****
  • Posts: 587
Re: ThreadSearch plugin 0.6 release
« Reply #20 on: June 12, 2007, 04:49:48 pm »
Hi Pecan,

i will try to make a final version of the document next week. I want to add some additional documentation like how to write a wizard script. The documentation is written in tex, so I can generate html, pdf, chm or other formats. It seems that wiki has no clear specification so I can not generate wiki code and have to use copy and paste.
As soon it is available I will add it also to wiki, but I think chm and pdf for download is also nice. I will post the download link next week.

Regards,

Mario

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: ThreadSearch plugin 0.6 release
« Reply #21 on: June 13, 2007, 12:17:11 pm »
Hi Pecan,

i will try to make a final version of the document next week. I want to add some additional documentation like how to write a wizard script. The documentation is written in tex, so I can generate html, pdf, chm or other formats. It seems that wiki has no clear specification so I can not generate wiki code and have to use copy and paste.
As soon it is available I will add it also to wiki, but I think chm and pdf for download is also nice. I will post the download link next week.

Regards,

Mario

http://forums.codeblocks.org/index.php/topic,6159.msg47093.html#msg47093
Be patient!
This bug will be fixed soon...