Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: dje on June 29, 2007, 12:00:41 am

Title: ThreadSearch 0.7 release
Post by: dje on June 29, 2007, 12:00:41 am
Hi all !

I'm proud to release ThreadSearch plugin 0.7  :D

Features :

Why ?

What's new ?
New features :

Bug fixes :

Installation :

Build
Extract the source code (http://www.esnips.com/doc/551dc7ae-c182-4e74-a49d-8bc4c474895e/ThreadSearchSourceCode0.7) 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.

EDIT: this is the dedicated wiki page (http://wiki.codeblocks.org/index.php?title=ThreadSearchManual)

Feel free to send feedbacks !  :)

Dje

Title: Re: ThreadSearch 0.7 release
Post by: rickg22 on June 29, 2007, 12:39:41 am
It'd be better if you left the image files in a zip, as the other plugins have their images etc. in their own zip files.
Title: Re: ThreadSearch 0.7 release
Post by: MortenMacFly on June 29, 2007, 11:28:03 am
I'm proud to release ThreadSearch plugin 0.7  :D
Nicely done, looks great.

Hence I have found a serious bug that will for sure give you some headache:
- enable toolbar and view of the plugin
- go to "manage plugins"
- disable plugin
- enable plugin
Result:
- C::B toolbar is completely messed up and cannot be used anymore
- starting from now closing C::B result is a crash

Notice: This is advanced stuff. Besides from that it works great - have searched the whole C::B workspace - no issues.

With regards, Morten.
Title: Re: ThreadSearch 0.7 release
Post by: tiwag on June 29, 2007, 12:59:56 pm
... I have found a serious bug that will for sure give you some headache:
- enable toolbar and view of the plugin
- go to "manage plugins"
- disable plugin
- enable plugin
Result:
- C::B toolbar is completely messed up and cannot be used anymore
- starting from now closing C::B result is a crash
...

better you let it enabled  :P  :P
Title: Re: ThreadSearch 0.7 release
Post by: dje on June 29, 2007, 02:12:01 pm
I confirm the bug at least on Windows.
The RPT gives interessant details.

There will probably be a 0.10 release soon...

Thanks for feedback !

Dje
Title: Re: ThreadSearch 0.7 release
Post by: dje on June 29, 2007, 03:52:38 pm
Hi Rick !

It'd be better if you left the image files in a zip, as the other plugins have their images etc. in their own zip files.

I did not really know how to proceed. I first thought about including them in manifest/.cbplugin. I was told it should be like that but not implemented.

As I saw 16x16 in C::B toolbar management and my code use 2 existing C::B icons, I chose to put them there.
If it is better to place them in an images\ThreadSearch directory, I'll do it next on next release.

Dje
Title: Re: ThreadSearch 0.7 release
Post by: dmoore on June 29, 2007, 04:12:04 pm
dje: I want to implement a "search directory" context menu action in your plugin (it will respond to right clicks on directories in the File Explorer in my Interpreted Languages plugin). I have most of the code in place, BUT your ThreadSearchView doesn't publicly expose a means to set the FindData in the view. If you can expose this functionality I will send you a complete patch.

besides the missing member declarations/event handling gunk, adding the feature is as simple as adding some extra code to BuildModuleMenu:

Code
void ThreadSearch::BuildModuleMenu(const ModuleType type, wxMenu* pMenu, const FileTreeData* data)
{
...
    if ( (type == mtEditorManager) && (m_CtxMenuIntegration == true) )
...
    if(type==mtUnknown) //Assuming file explorer -- fileexplorer fills the filetreedata with ftdkFile or ftdkFolder as "kind", the folder is the full path of the entry
    if(data)
    {
            size_t sep_pos=pMenu->GetMenuItemCount();
            size_t added=0;
            if(data->GetKind()==FileTreeData::ftdkFile)  //right clicked on file in file explorer
            {
                wxFileName f(data->GetFolder());
                wxString filename=f.GetFullPath();
                //**** Could do a search within a file here...****
            }
            if(data->GetKind()==FileTreeData::ftdkFolder) //right clicked on folder in file explorer
            {
                wxFileName f(data->GetFolder());
                wxString filename=f.GetFullPath();
                wxString sText = wxT("Search Directory...");
                m_SearchDirectory=filename;
pMenuItem = pMenu->Append(idMenuDirThreadSearch, sText);
                pMenuItem->Enable(!m_pThreadSearchView->IsSearchRunning());
                added++;
            }
            if(added>0)
                pMenu->InsertSeparator(sep_pos);
    }

and an event handler:

Code
void ThreadSearch::OnMnuDirThreadSearch(wxCommandEvent &event)
{
if ( !IsAttached() )
return;

    ThreadSearchFindData findData=m_FindData; //****Alternative pull findData from the actual logpanel****
    findData.SetScope(ScopeDirectoryFiles);
    findData.SetSearchPath(m_SearchDirectory);
    findData.SetRecursiveSearch(true);

//**** Need to update the Log Panel with the contents of findData****

    AddAndShowThreadSearchLogPanel(true);
}

the ****'s denote the incomplete code
Title: Re: ThreadSearch 0.7 release
Post by: dmoore on June 29, 2007, 04:21:34 pm
Hi Rick !

It'd be better if you left the image files in a zip, as the other plugins have their images etc. in their own zip files.

I did not really know how to proceed. I first thought about including them in manifest/.cbplugin. I was told it should be like that but not implemented.

As I saw 16x16 in C::B toolbar management and my code use 2 existing C::B icons, I chose to put them there.
If it is better to place them in an images\ThreadSearch directory, I'll do it next on next release.

Dje

take a look at the post build steps of most contrib plugins (there's a zip command) (or alternatively look at my win32 InterpretedLangs project file from my cbilplugins project on berlios)

you should use the #cb global variable to setup the paths to your project includes, libraries and other dependencies. remove the path specifiers in the link libraries put the paths in library search paths.

You shouldn't need separate build and debug targets if youre build is set up to output your dll and zip files to the devel directory (this is where the debug build of codeblocks goes). when you run update.bat your files will be included in the stripped binaries in the output folder.

MortenMacFly had other good advice for me in this post: http://forums.codeblocks.org/index.php/topic,6297.msg48251.html#msg48251
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 29, 2007, 04:32:37 pm
It'd be better if you left the image files in a zip, as the other plugins have their images etc. in their own zip files.

To my knowledge, there is currently no way that .cbplugin images get copied to the necessary CB share directories.

So leaving the images in the zip file will not work.

However, since I was also working on the problem for another plugin, I'll also write it so images can be loaded from /share/codeblocks/<plugin>.zip by the plugin itself and make a call to cbLoadBitmap() if necessary.

I'll use ThreadSearch a the guinea pig if that's ok with dje.


Title: Re: ThreadSearch 0.7 release
Post by: dmoore on June 29, 2007, 04:49:17 pm
To my knowledge, there is currently no way that .cbplugin images get copied to the necessary CB share directories.

So leaving the images in the zip file will not work.

Pecan: can you explain this in more detail? I have an xrc toolbar in my Python plugin that loads a bunch of images. those images are all stored in the PyPlugin.zip along with the xrc file and the manifest and it *appears* to work fine.... So you must be talking about a different case?
Title: Re: ThreadSearch 0.7 release
Post by: dje on June 29, 2007, 05:00:24 pm
Hi !

@dmoore, I'll have a look this WE, I find your idea very interesting (ThreadSearch external calls).
For now, Search in dir is possible, not search in file.

For the near future:

@Pecan
Quote
I'll use ThreadSearch a the guinea pig if that's ok with dje
Shame on my English  :oops:
I don't understand what you mean

Dje
Title: Re: ThreadSearch 0.7 release
Post by: MortenMacFly on June 29, 2007, 05:06:15 pm
Quote
I'll use ThreadSearch a the guinea pig if that's ok with dje
I don't understand what you mean
Me not, too. WiKiPedia has a lot of different meanings for that but I'd say none of them really matches... Hehe...:
http://en.wikipedia.org/wiki/Guinea_pig_%28disambiguation%29

Edit: Ah:
# (idiomatic) A person who volunteers for an experiment or to try anything new; an experimental subject (from the use of the rodent in laboratory experiments).
e.g. "Would you like to be the guinea pig for our new product concept?"

Title: Re: ThreadSearch 0.7 release
Post by: dmoore on June 29, 2007, 05:11:22 pm
@dmoore, I'll have a look this WE, I find your idea very interesting (ThreadSearch external calls).
For now, Search in dir is possible, not search in file.

thanks for taking the time. the nice thing is that I don't need to do anything on my end that's specific to ThreadSearch (i.e. the fileexplorer will add whatever items that any plugin wants to put into the fileexplorer context menu). the plugin architecture takes care of the communication between the two plugins, so you don't have to worry about messy #includes.

I realize that search in file isn't possible, but just left it in to show the possibilities (I did take out the more complex multiple file/directory targets, which sends a list of a space separated files and directories that the user selected before right clicking)

btw, it could have been something I did wrong, but I was getting a crash on exit (even without starting up a threadsearch)
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 29, 2007, 05:31:14 pm
To my knowledge, there is currently no way that .cbplugin images get copied to the necessary CB share directories.

So leaving the images in the zip file will not work.

Pecan: can you explain this in more detail? I have an xrc toolbar in my Python plugin that loads a bunch of images. those images are all stored in the PyPlugin.zip along with the xrc file and the manifest and it *appears* to work fine.... So you must be talking about a different case?

You have an .xrc that gets loaded with LoadResources(), I guess, which in turn loads the .png from the resource .zip.

However, ThreadSearch has no .xrc, but a bunch of .png's .
So they're being  loaded via cbLoadBitmap() or new() etc.

That's ok when they're already extracted in  .../images/16x16 etc, but if they're in the .zip with no xrc, some routine has to go extract them.

I was thinking that the easiest solution is simply to glom onto the CB plugin .zip extraction routine, modify it, & use it locally to grab the needed .png when needed.
Title: Re: ThreadSearch 0.7 release
Post by: dmoore on June 29, 2007, 07:25:12 pm
hmm...  it would be possible to specify a sequence of wxBitMaps in an XRC file as follows:

Code
<resource>
    <object class="wxBitmap" name="img1">images/image1.png</object>
    <object class="wxBitmap" name="img2">images/image2.png</object> 
etc...
</resource>

zip the XRC in with the images and manifest (using the relative paths for the images as in the xrc). Then after you call

Code
Manager::LoadResource(_T("myplugin.zip");

you can access your images with

Code
    wxBitmap bmp;
    // typedef
    bmp = wxXmlResource::Get()->LoadBitmap(_T("img1"));
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 29, 2007, 07:37:16 pm
Is there a way to get rid of that little window on the left?

It's too small for me (old eyes), and it just gets in the way of my reading the search results.

Title: Re: ThreadSearch 0.7 release
Post by: dje on June 29, 2007, 07:49:42 pm
Is there a way to get rid of that little window on the left?

Not for now. The minimum width is 25px.
I put it on my to-do list, if I can hide widgets and directories items, I should succeed in hiding editor !  :D

Dje
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 29, 2007, 09:52:42 pm
hmm...  it would be possible to specify a sequence of wxBitMaps in an XRC file as follows:

Code
<resource>
    <object class="wxBitmap" name="img1">images/image1.png</object>
    <object class="wxBitmap" name="img2">images/image2.png</object> 
etc...
</resource>

zip the XRC in with the images and manifest (using the relative paths for the images as in the xrc). Then after you call

Code
Manager::LoadResource(_T("myplugin.zip");

you can access your images with

Code
    wxBitmap bmp;
    // typedef
    bmp = wxXmlResource::Get()->LoadBitmap(_T("img1"));

After three hours of trying. I think I'll give this one up.
It doesn't complain, but it doesn't load the images either.

ThreadImages.xrc
Code
<?xml version="1.0" encoding="utf-8"?>
<resource>
    <object class="wxBitmap" name="findf"><bitmap>findf.png</bitmap></object>
    <object class="wxBitmap" name="findfdisabled"><bitmap>findfdisabled.png</bitmap></object>
    <object class="wxBitmap" name="options"><bitmap>options.png</bitmap></object>
    <object class="wxBitmap" name="optionsdisabled"><bitmap>optionsdisabled.png</bitmap></object>
    <object class="wxBitmap" name="stop"><bitmap>stop.png</bitmap></object>
    <object class="wxBitmap" name="stopdisabled"><bitmap>stopdisabled.png</bitmap></object>
    <object class="wxBitmap" name="ThreadSearch"><bitmap>ThreadSearch.png</bitmap></object>
    <object class="wxBitmap" name="ThreadSearchoff"><bitmap>ThreadSearch-off.png</bitmap></object>
</resource>

Files in ThreadSearch.zip
Code
findf.png
findfdisabled.png
manifest.xml
options.png
optionsdisabled.png
stop.png
stopdisabled.png
ThreadImages.xrc
ThreadSearch.png
ThreadSearch-off.png
Code
    if (!Manager::LoadResource(_T("ThreadSearch.zip")))
    {
        NotifyMissingFile(_T("ThreadSearch.zip"));
    }

......
    wxBitmap bmp = wxXmlResource::Get()->LoadBitmap(_T("findf"));
wxBitmapButton* pBtnSearch = new wxBitmapButton(toolBar, idBtnSearch, bmp);


It just seems to do nothing. Even when I change the name of the .png to one that doesn't exist, it doesn't even error out.

It always just shows the button without the bitmap.
Title: Re: ThreadSearch 0.7 release
Post by: dmoore on June 29, 2007, 10:18:34 pm
Pecan: strange that it doesn't work... I assume you tried without enclosing the filename in <bitmap></bitmap>

EDIT: seems to be working fine for me when I exclude the <bitmap> tokens
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 29, 2007, 10:32:45 pm
Edit: I seem to have it working now. But I have no idea how I did it; or what was wrong before.


Pecan: strange that it doesn't work... I assume you tried without enclosing the filename in <bitmap></bitmap>

EDIT: seems to be working fine for me when I exclude the <bitmap> tokens

Nope. Can't get it to work with or without the <bitmap></bitmap> tokens.

What system are you on. I'm on XpSp2 wx284


If you have it working, could you give us a patch?
Title: Re: ThreadSearch 0.7 release
Post by: dmoore on June 29, 2007, 10:57:03 pm
running same as you. full source attached



[attachment deleted by admin]
Title: Re: ThreadSearch 0.7 release
Post by: dmoore on June 29, 2007, 10:58:48 pm
dje: this really is a nicely done plugin. any thoughts on allowing user to have the threadsearchview in a dockable instead of the messages window? (no reason not to allow the user to choose)

and... when do we get replace in files?  :lol:
Title: Re: ThreadSearch 0.7 release
Post by: dmoore on June 29, 2007, 11:07:31 pm
one thing to be careful of is polluting the xrc namespace. because the names are shared application wide it probably makes sense to preface all names with an abbreviated version of the plugin name. so "findf" would be "threadsearch_findf" (or tsrch_findf)
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 29, 2007, 11:09:10 pm
Here's an interesting bug in CB.

When I change the LoadResource() name to a non-existing file here's what you get:

(http://img503.imageshack.us/img503/5628/184af9.png)

a one-letter file name from NotifyMissingFile.
Title: Re: ThreadSearch 0.7 release
Post by: dje on June 30, 2007, 12:41:21 am
dje: this really is a nicely done plugin
Thank you  :D  Nice to write it !

any thoughts on allowing user to have the threadsearchview in a dockable instead of the messages window? (no reason not to allow the user to choose)
I think it is possible, we'll just need a 25'' screen to display the configuration panel  :)

and... when do we get replace in files?  :lol:
I already thought about it but for now, it remains a thought...

So, now:

You will have noticed it is not a numbered list, it is a random list  :)

I keep in mind the replace idea but I don't put it in the to do list before thinking about it a little more...


Dje
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 30, 2007, 01:02:09 am
I notice when I try to paste a search string into the search window, it pastes it into the editor instead.

What's that all about?
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 30, 2007, 01:12:26 am
Here are the diffs that allow the .zip to contain all the .png files.
Thank you dmoore

ThreadSearch.cpp
Code
c:\Usr\Proj\ThreadSearch>C:\Usr\bin\GnuWin32\bin\diff.exe -u --strip-trailing-cr E:\User\Downloads\_Pending\cbPlugins\temp\ThreadSearch\ThreadSearch.cpp ThreadSearch.cpp      
--- E:\User\Downloads\_Pending\cbPlugins\temp\ThreadSearch\ThreadSearch.cpp 2007-06-28 21:12:28.000000000 -0500
+++ ThreadSearch.cpp 2007-06-29 18:08:03.953125000 -0500
@@ -250,8 +250,7 @@
  {
  // set log image
  wxBitmap bmp;
- wxString prefix = ConfigManager::GetDataFolder() + _T("/images/16x16/");
- bmp = cbLoadBitmap(prefix + _T("filefind.png"), wxBITMAP_TYPE_PNG);
+        bmp = wxXmlResource::Get()->LoadBitmap(_T("findf"));
 
  m_ThreadSearchId = pMsgMan->AddLog(m_pThreadSearchView, _T("Thread search"), bmp);
  }
@@ -501,13 +500,12 @@
  m_pToolbar = toolBar;
  m_pThreadSearchView->SetToolBar(toolBar);
 
- wxString prefix = ConfigManager::GetDataFolder() + _T("/images/16x16/");
  wxComboBox*     pCboSearchExpr = new wxComboBox    (toolBar, idCboSearchExpr, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN);
- wxBitmapButton* pBtnSearch     = new wxBitmapButton(toolBar, idBtnSearch, wxBitmap(prefix + wxT("findf.png"), wxBITMAP_TYPE_PNG));
- wxBitmapButton* pBtnOptions    = new wxBitmapButton(toolBar, idBtnOptions, wxBitmap(prefix + wxT("options.png"), wxBITMAP_TYPE_PNG));
+ wxBitmapButton* pBtnSearch     = new wxBitmapButton(toolBar, idBtnSearch, wxXmlResource::Get()->LoadBitmap(_T("findf")));
+ wxBitmapButton* pBtnOptions    = new wxBitmapButton(toolBar, idBtnOptions, wxXmlResource::Get()->LoadBitmap(_T("options")));
 
- pBtnSearch->SetBitmapDisabled(wxBitmap(prefix + wxT("findfdisabled.png"), wxBITMAP_TYPE_PNG));
- pBtnOptions->SetBitmapDisabled(wxBitmap(prefix + wxT("optionsdisabled.png"), wxBITMAP_TYPE_PNG));
+ pBtnSearch->SetBitmapDisabled(wxXmlResource::Get()->LoadBitmap(_T("findfdisabled")));
+ pBtnOptions->SetBitmapDisabled(wxXmlResource::Get()->LoadBitmap(_T("optionsdisabled")));
 
  toolBar->AddControl(pCboSearchExpr);
  toolBar->AddControl(pBtnSearch);


ThreadSearchView.cpp
Code
c:\Usr\Proj\ThreadSearch>C:\Usr\bin\GnuWin32\bin\diff.exe -u --strip-trailing-cr E:\User\Downloads\_Pending\cbPlugins\temp\ThreadSearch\ThreadSearchView.cpp ThreadSearchView.cpp      
--- E:\User\Downloads\_Pending\cbPlugins\temp\ThreadSearch\ThreadSearchView.cpp 2007-06-28 21:46:04.000000000 -0500
+++ ThreadSearchView.cpp 2007-06-29 18:47:14.171875000 -0500
@@ -8,6 +8,8 @@
  * License:   GPL
  **************************************************************/
 
+#include <wx/xrc/xmlres.h>
+
 #include "messagemanager.h"
 #include "configmanager.h"
 #include "configurationpanel.h"
@@ -924,13 +926,13 @@
 
  wxString prefix = ConfigManager::GetDataFolder() + _T("/images/16x16/");
 
- wxString searchButtonPathsEnabled[]  = {prefix + wxT("findf.png"),
- prefix + wxT("stop.png") ,
- wxEmptyString};
-
- wxString searchButtonPathsDisabled[] = {prefix + wxT("findfdisabled.png"),
- prefix + wxT("stopdisabled.png") ,
- wxEmptyString};
+ wxString searchButtonPathsEnabled[]  = {wxT("findf"),
+ wxT("stop") ,
+ wxEmptyString};
+
+ wxString searchButtonPathsDisabled[] = {wxT("findfdisabled"),
+ wxT("stopdisabled") ,
+ wxEmptyString};
 
  // Gets toolbar search button pointer
  wxBitmapButton* pToolBarSearchBtn = static_cast<wxBitmapButton*>(m_pToolBar->FindControl(idBtnSearch));
@@ -939,8 +941,8 @@
  if ( label != skip )
  {
  m_pBtnSearch->SetLabel(searchButtonLabels[label]);
- pToolBarSearchBtn->SetBitmapLabel   (wxBitmap(searchButtonPathsEnabled [label], wxBITMAP_TYPE_PNG));
- pToolBarSearchBtn->SetBitmapDisabled(wxBitmap(searchButtonPathsDisabled[label], wxBITMAP_TYPE_PNG));
+ pToolBarSearchBtn->SetBitmapLabel   (wxXmlResource::Get()->LoadBitmap(searchButtonPathsEnabled [label]));
+ pToolBarSearchBtn->SetBitmapDisabled(wxXmlResource::Get()->LoadBitmap(searchButtonPathsDisabled [label]));
  }
 
  // Sets enable state


ThreadImages.xrc to be put in ThreadSearch.zip
Code
<?xml version="1.0" encoding="utf-8"?>
<resource>
    <object class="wxBitmap" name="findf">findf.png</object>
    <object class="wxBitmap" name="findfdisabled">findfdisabled.png</object>
    <object class="wxBitmap" name="options">options.png</object>
    <object class="wxBitmap" name="optionsdisabled">optionsdisabled.png</object>
    <object class="wxBitmap" name="stop">stop.png</object>
    <object class="wxBitmap" name="stopdisabled">stopdisabled.png</object>
    <object class="wxBitmap" name="ThreadSearch">ThreadSearch.png</object>
    <object class="wxBitmap" name="ThreadSearchoff">ThreadSearch-off.png</object>
</resource>


Contents of ThreadSearch.zip
Code
findf.png
findfdisabled.png
options.png
optionsdisabled.png
stop.png
stopdisabled.png
ThreadSearch.png
ThreadSearch-off.png
manifest.xml
ThreadImages.xrc

Post Build Step
Code
zip -j9 .\ThreadSearch.zip manifest.xml *.png ThreadImages.xrc
zip -j9 ThreadSearch.cbplugin .\bin\debug\ThreadSearch.dll .\ThreadSearch.zip

Title: Re: ThreadSearch 0.7 release
Post by: dje on June 30, 2007, 03:34:42 pm
Hi all !

So, now:
  • Morten's bug fix (crash on plugin disable).

The naughty bug is FIXED  :D :D :D :D :D

I had misunderstood a part of plugins management.
I tought that disable = uninstall without removing dll/zip but in fact, a plugin instance exists even it plugin is disabled.

The following OnRelease method solves the problem on XP. It see no reason why it could be different on Linux but it is not tested yet.

Code
void ThreadSearch::OnRelease(bool appShutDown)
{
// do de-initialization for your plugin
// if appShutDown is false, the plugin is unloaded because Code::Blocks is being shut down,
// which means you must not use any of the SDK Managers
// NOTE: after this function, the inherited member variable
// m_IsAttached will be FALSE...

// Removes Thread search menu item from the View menu
RemoveMenuItems();

m_pToolbar = NULL;

// Saves configuration to default.conf
SaveConfig(m_ThreadSearchId != -1);

wxASSERT(m_pThreadSearchView != NULL);
if ( m_ThreadSearchId != -1 )
{
// As id is != from -1, ThreadSearchView is managed by MessageManager
// We remove it from the notebook
MessageManager* pMsgMan = Manager::Get()->GetMessageManager();
wxASSERT(pMsgMan != NULL);
pMsgMan->RemoveLog(m_pThreadSearchView);
m_ThreadSearchId = -1;
}

m_pThreadSearchView->Destroy();
m_pThreadSearchView = NULL;
}

Thanks to Pecan and Dmoore for pngs embedding code, i'll have a look at it.

I confirm the paste bug. The same happens with copy from the preview editor.
It does not work anymore with keyboard shortcuts but works with contextual menus.

EDIT: Paste works with default target (nightly build environment) but not with DevDebug target (debug development environment).
EDIT: Copy from preview editor does not works (whereas it did).

This is a regression but I don't see at first glance where it comes from.

Dje
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 30, 2007, 04:13:20 pm
I notice when I try to paste a search string into the search window, it pastes it into the editor instead.

What's that all about?


Found it. CodeBlocks main.cpp UpdateUI is enabling Edit/Paste for the editors only.
So when you paste into the search combo box, it ends up in the editor.
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 30, 2007, 05:34:18 pm


I confirm the paste bug. The same happens with copy from the preview editor.
It does not work anymore with keyboard shortcuts but works with contextual menus.

EDIT: Paste works with default target (nightly build environment) but not with DevDebug target (debug development environment).
EDIT: Copy from preview editor does not works (whereas it did).

This is a regression but I don't see at first glance where it comes from.

I've found the cause of the copy/paste bug. And am working up a fix for it now.

It's a bug in the way CB main.cpp handles the clipboard/copy/paste events. It always thinks the paste is for the current editor even when the editor DOES NOT have the focus.

Edit: I've tested the work-around and will paste a diff.
Title: Re: ThreadSearch 0.7 release
Post by: dje on June 30, 2007, 06:13:27 pm
@Pecan
Nice work  :)
What would be a developer without copy/paste ??

Little parenthesis
I was playing with code snippets when I found a bug :

There must be an error because I can't use code snippets any more both in nightlies and SVN environments.

I'll reset my default.conf and see if it is systematic and if I can reduce number of steps.

Dje



[attachment deleted by admin]
Title: Re: ThreadSearch 0.7 release
Post by: dmoore on June 30, 2007, 06:14:47 pm


I confirm the paste bug. The same happens with copy from the preview editor.
It does not work anymore with keyboard shortcuts but works with contextual menus.

EDIT: Paste works with default target (nightly build environment) but not with DevDebug target (debug development environment).
EDIT: Copy from preview editor does not works (whereas it did).

This is a regression but I don't see at first glance where it comes from.

I've found the casue of the copy/paste bug. And am working up a fix for it now.

It's a bug in the way CB main.cpp handles the clipboard/copy/paste events. It always thinks the paste is for the current editor even when the editor DOES NOT have the focus.

Edit: I've tested the work-around and will paste a diff.


I've been wondering about this too. I'll make good use of your patch too, rest assured
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 30, 2007, 06:19:52 pm
@Pecan
Nice work  :)
What would be a developer without copy/paste ??

Little parenthesis
I was playing with code snippets when I found a bug :
  • I created a snippet (test was its name  :))
  • I clicked on its properties
  • I chose a link target to a cpp file
  • I opened it
  • I right click on the root/settings
  • I selected the external option and validated
  • I reopen the snippet to see if there was a difference
  • I clicked on View/Code snippets twice
  • I systematically have the snapshot error

There must be an error because I can't use code snippets any more both in nightlies and SVN environments.

I'll reset my default.conf and see if it is systematic and if I can reduce number of steps.

Dje



CodeSnippets does not keep data in .conf. It's in codesnippets.ini in the data folder.

Would you translate that whole error message for me please.
Also, show me what's in codesnippets.ini

What OS and wxWidgets version?

Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 30, 2007, 06:43:59 pm
Here are the diffs to work around the copy/paste bug in CB main.cpp and allow correct pasting in ThreadSearch.

However, it still will not allow the CB menu, menu hotkeys, or the toolbar icons to be used for copy paste because main.cpp is disabling those in its UpdateUI routine if the focus is not on an editor.

It will, however, allow Ctrl-C and Ctrl-V to work correctly.

ThreadSearchView.h
Code
c:\Usr\Proj\ThreadSearch\ThreadSearch7>C:\Usr\bin\GnuWin32\bin\diff.exe -u --strip-trailing-cr ThreadSearchView.h ..      
--- ThreadSearchView.h 2007-06-26 10:02:52.000000000 -0500
+++ ../ThreadSearchView.h 2007-06-30 11:27:19.390625000 -0500
@@ -40,6 +40,8 @@
 class ThreadSearchThread;
 
 class ThreadSearchView: public MessageLog {
+
+    friend class ThreadSearch;
 public:
     // begin wxGlade: ThreadSearchView::ids
     // end wxGlade

ThreadSearch.H
Code
c:\Usr\Proj\ThreadSearch\ThreadSearch7>C:\Usr\bin\GnuWin32\bin\diff.exe -u --strip-trailing-cr ThreadSearch.h ..      
--- ThreadSearch.h 2007-06-28 20:30:16.000000000 -0500
+++ ../ThreadSearch.h 2007-06-30 11:11:56.515625000 -0500
@@ -233,6 +233,8 @@
    * the 'Find implementation' item if possible
    */
  int GetInsertionMenuIndex(const wxMenu* const pCtxMenu);
+    void OnEditPaste(wxCommandEvent& event);
+
 
  // Member variables
  wxString             m_SearchedWord;              // Word under cursor on right click
@@ -247,6 +249,8 @@
     bool                 m_ShowDirControls;           // True if user wants to display directory specific controls
     bool                 m_DisplayLogHeaders;
     bool                 m_DrawLogLines;
+    bool                 b_OnReleased;
+    wxComboBox*          m_pCboSearchExpr;
 
  DECLARE_EVENT_TABLE();
 };

ThreadSearch.cpp
Code
c:\Usr\Proj\ThreadSearch\ThreadSearch7>C:\Usr\bin\GnuWin32\bin\diff.exe -u --strip-trailing-cr ThreadSearch.cpp ..
--- ThreadSearch.cpp 2007-06-28 21:12:28.000000000 -0500
+++ ../ThreadSearch.cpp 2007-06-30 12:13:47.640625000 -0500
@@ -18,6 +18,7 @@
 #include <configurationpanel.h>
 #include <editor_hooks.h>
 #include <wx/wxFlatNotebook/wxFlatNotebook.h>
+#include <wx/clipbrd.h>

 #include "ThreadSearch.h"
 #include "ThreadSearchConfPanel.h"
@@ -32,6 +33,7 @@
  PluginRegistrant<ThreadSearch> reg(_T("ThreadSearch"));
 }

+int idEditPaste = XRCID("idEditPaste");

 // events handling
 BEGIN_EVENT_TABLE(ThreadSearch, cbPlugin)
@@ -44,6 +46,8 @@
  EVT_BUTTON    (idBtnOptions,             ThreadSearch::OnBtnOptionsClick)
  EVT_BUTTON    (idBtnSearch,              ThreadSearch::OnBtnSearchClick)
     EVT_TEXT_ENTER(idCboSearchExpr,          ThreadSearch::OnCboSearchExprEnter)
+    EVT_TEXT      (idCboSearchExpr,          ThreadSearch::OnCboSearchExprEnter)
+    EVT_MENU      (idEditPaste,              ThreadSearch::OnEditPaste)
 END_EVENT_TABLE()

 // constructor
@@ -57,7 +61,8 @@
    m_ShowSearchControls(true),
    m_ShowDirControls(false),
    m_DisplayLogHeaders(true),
-   m_DrawLogLines(false)
+   m_DrawLogLines(false),
+   m_pCboSearchExpr(0)
 {
  // Make sure our resources are available.
  // In the generated boilerplate code we have no resources but when
@@ -99,6 +104,8 @@

  // Shows/Hides search widgets on the Messages notebook ThreadSearch panel
  m_pThreadSearchView->ShowSearchControls(m_ShowSearchControls);
+
+ b_OnReleased = false;
 }

 void ThreadSearch::OnRelease(bool appShutDown)
@@ -109,6 +116,12 @@
  // NOTE: after this function, the inherited member variable
  // m_IsAttached will be FALSE...

+ // --------------------------------------------------------------
+ // Carefull! This routine can be entered consecutive times
+ // --------------------------------------------------------------
+ if ( b_OnReleased ) return;
+    b_OnReleased = true;
+
  // Removes Thread search menu item from the View menu
  RemoveMenuItems();

@@ -594,7 +606,8 @@
  // Runs a multi threaded search with combo text
  wxComboBox* pCboBox = static_cast<wxComboBox*>(m_pToolbar->FindControl(idCboSearchExpr));
  wxASSERT(pCboBox != NULL);
- RunThreadSearch(pCboBox->GetValue());
+ if ( event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER )
+        RunThreadSearch(pCboBox->GetValue());
 }


@@ -648,3 +661,75 @@

  return wordFound;
 }
+// ----------------------------------------------------------------------------
+void ThreadSearch::OnEditPaste(wxCommandEvent& event)
+// ----------------------------------------------------------------------------
+{
+    // Process clipboard data only if we have the focus
+
+    // ----------------------------------------------------------------
+    // NB:  A bug in CB main.cpp causes a ctrl-v to always paste into the
+    //      current editor. Here, we'll make checks to see if the paste
+    //      is for our search combo boxes and paste the data there.
+    //      If the focused window is one of ours that shouldn't get pasted
+    //      data, we'll simply ignore it.
+    //      If the window isn't one of ours, we'll event.Skip();
+    // ----------------------------------------------------------------
+
+    if ( !IsAttached() )
+ { event.Skip(); return; }
+
+    if (not m_IsAttached) {event.Skip(); return;}
+
+    wxWindow* pFocused = wxWindow::FindFocus();
+    if (not pFocused) { event.Skip(); return; }
+
+    wxString focusedStr = pFocused->GetName();
+    //DBGLOG(wxT("OnEditPaste:Focused[%p][%s]"), pFocused, focusedStr.c_str());
+
+    // don't allow paste when the following windows have the focus
+    if ( ( pFocused == m_pThreadSearchView->m_pSearchPreview )
+        || ( pFocused == m_pThreadSearchView->m_pListLog ) )
+        { return; }
+    if ( pFocused == m_pThreadSearchView->m_pListLog->GetListControl())
+        return;
+
+    // if the following window have the focus, own the paste.
+    if ( (pFocused != m_pCboSearchExpr)
+        && (pFocused != m_pThreadSearchView->m_pCboSearchExpr) )
+        { event.Skip(); return;}
+
+    if ( not wxTheClipboard->Open() )
+    {
+         //DBGLOG( wxT("ThreadSearch::OnPaste Can't open clipboard.") );
+        event.Skip();
+        return;
+    }
+    // -- Text Processing ----------------------------------------------------
+    if ( not wxTheClipboard->IsSupported(wxDF_TEXT) )
+    {
+        //DBGLOG( wxT("ThreadSearch::OnPaste:No text data on clipboard") );
+        wxTheClipboard->Close();
+        event.Skip();
+        return;
+    }
+
+    wxTextDataObject text;
+    if ( not wxTheClipboard->GetData(text) ) {
+         //DBGLOG( wxT("ThreadSearch::OnPaste:Can't get text from the clipboard") );
+    }
+    else {  // Put text in search wxComboBoxes
+        wxString str = text.GetText();
+        // stuff the search boxes
+        if (pFocused == m_pCboSearchExpr)
+            m_pCboSearchExpr->SetValue(str);
+        if (pFocused == m_pThreadSearchView->m_pCboSearchExpr)
+            m_pThreadSearchView->m_pCboSearchExpr->SetValue(str);
+    }
+
+    wxTheClipboard->Close();
+    // If you Skip(), CB main.cpp will wrongly paste your text into the current editor
+    // because CB main.cpp thinks it owns the clipboard.
+    //- event.Skip();
+    return; //own the event
+}//OnEditPaste
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 30, 2007, 07:34:16 pm
@Pecan
There must be an [CodeSnippets] error because I can't use code snippets any more both in nightlies and SVN environments.

I'll reset my default.conf and see if it is systematic and if I can reduce number of steps.

It appears that external CodeSnippets is trying to create the memory mapped file to communicate with CB, and can't allocate the file.

Is your /temp full or unwrittable?
What does "le chemin d'acces specific est introuvable" mean?

Anyway to get it running again, edit your codesnippet.ini and change

WindowState=External

to

WindowState=Floating

or

WindowState=Docked


This does mean I should check the directory for usability before trying to create the memory mapped file.

Thanks for the report.


EDIT: 2007/06/30

My fault. I assumed an absolute temporary dir of "temp". Should have asked the system for the location of the trash directory.
Title: Re: ThreadSearch 0.7 release
Post by: dje on June 30, 2007, 09:47:16 pm
@Pecan
Quote
My fault. I assumed an absolute temporary dir of "temp". Should have asked the system for the location of the trash directory.
I don't know if it is still necessary but this is my codesnippets.ini
Code
ExternalEditor=Enter filename of external editor
SnippetFile=C:\\Documents and Settings\\Jerome\\Application Data\\codeblocks\\codesnippets.xml
ViewSearchBox=1
casesensitive=1
scope=2
SnippetFolder=Enter Snippets storage Folder
MouseDragSensitivity=8
MouseToLineRatio=30
MouseContextDelay=192
WindowState=External
WindowPosition=520 122 300 350
EditDlgXpos=235
EditDlgYpos=122
EditDlgWidth=500
EditDlgHeight=400
EditDlgMaximized=0

Note: on my XP, I have neither C:\temp nor C:\tmp directories.
I suppose you know it but if it is not the case... There are TEMP and TMP environment variables on Windows.
Both yield on my PC
Code
C:\DOCUME~1\Jerome\LOCALS~1\Temp

I just replace External by Floating and it works.

Thanks for patch.
Do you think I should apply it or should it be fixed directly in C::B sources ?
Note that I can paste text in your code snippets text control, does the problem concern only combo boxes ?

Dje
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 30, 2007, 10:05:32 pm

Thanks for patch.
Do you think I should apply it or should it be fixed directly in C::B sources ?
Note that I can paste text in your code snippets text control, does the problem concern only combo boxes ?

For the time being, I think you'll have to apply the patch to ThreadSearch.

I submitted a CB patch to correct this situation about a 1 1/2 years ago. But it just ended getting old and finally deleted.


This patch is written so that if the CB situation in main.cpp is ever corrected, this patch will still work anyway.

The problem affects ANY window or plugin that needs the use of copy/paste.

CodeSnippets et.al. have worked around this situation from the begining. I got so used to doing copy/paste this way that I forgot that it was a work-around.

That's why I didn't recognize the problem until tracing through it again. Hacks become algorithms.

 
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on June 30, 2007, 11:35:25 pm
@Pecan
I was playing with code snippets when I found a bug :

Fixed: SVN 4200
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on July 01, 2007, 02:02:13 am
Diffs to record and restore the position of the splitter sash accross CB runs.

ThreadSearchView.h
Code
--- ThreadSearchview.h	2007-06-26 10:02:52.000000000 -0500
+++ ../ThreadSearchview.h 2007-06-30 19:11:38.718750000 -0500
@@ -87,6 +87,7 @@
  /** Sets the splitter window sash position.
    */
  void SetSashPosition(int position, const bool redraw = true) {m_pSplitter->SetSashPosition(position, redraw);}
+ int  GetSashPosition() { return m_pSplitter->GetSashPosition(); }


  /** PostThreadSearchEvent


ThreadSearch.h
Code
--- ThreadSearch.h	2007-06-28 20:30:16.000000000 -0500
+++ ../ThreadSearch.h 2007-06-30 19:11:34.703125000 -0500
@@ -248,6 +249,9 @@
     bool                 m_ShowDirControls;           // True if user wants to display directory specific controls
     bool                 m_DisplayLogHeaders;
     bool                 m_DrawLogLines;
     bool                 b_OnReleased;
     wxComboBox*          m_pCboSearchExpr;
+    int                  m_SplitterPosn;               // position of splitter from config

  DECLARE_EVENT_TABLE();
 };


ThreadSearch.cpp
Code
--- ThreadSearch.cpp	2007-06-28 21:12:28.000000000 -0500
+++ ../ThreadSearch.cpp 2007-06-30 19:11:57.968750000 -0500
@@ -102,8 +103,14 @@
  m_pThreadSearchView->SetSashPosition(x/2);
  m_pThreadSearchView->SetListColumns();

+    // Set the splitter posn from the config
+    if (m_SplitterPosn)
+        m_pThreadSearchView->SetSashPosition(m_SplitterPosn);
+
  // Shows/Hides search widgets on the Messages notebook ThreadSearch panel
  m_pThreadSearchView->ShowSearchControls(m_ShowSearchControls);

  b_OnReleased = false;
 }

 void ThreadSearch::OnRelease(bool appShutDown)
@@ -509,6 +510,9 @@

     m_FindData.SetSearchPath      (pCfg->Read    (wxT("/DirPath"),            wxEmptyString));
     m_FindData.SetSearchMask      (pCfg->Read    (wxT("/Mask"),               wxT("*.cpp;*.c;*.h")));
+
+    m_SplitterPosn               = pCfg->ReadInt(wxT("/SplitterPosn"),       0);
+
 }


@@ -490,6 +509,8 @@

     pCfg->Write(wxT("/DirPath"),            m_FindData.GetSearchPath());
     pCfg->Write(wxT("/Mask"),               m_FindData.GetSearchMask());
+
+    pCfg->Write(wxT("/SplitterPosn"),       m_pThreadSearchView->GetSashPosition() );
 }


Title: Re: ThreadSearch 0.7 release
Post by: Pecan on July 01, 2007, 03:56:14 pm
I've run across a peculiar situation.

The ThreadSearch ToolBar and Log controls had been turned off.

I could find no other way to turn them back on except to edit default.conf.

What am I missing.

Edit: 2007/07/1

I figured it out. I had run  /src/output/codeblocks which did not have ThreadSearch installed.
It evidently saved the default.conf entries as 0.

When I went back to /src/devel/codeblocks, I found no way to turn the ThreadSearch controls back on.


Title: Re: ThreadSearch 0.7 release
Post by: dje on July 01, 2007, 04:02:33 pm
I'll add a confirmation pop-up.

You can reenable it with Settings/Environment... and ThreadSearch on the left column.
It displays then the configuration panel that allows you to display what you want.

Dje
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on July 01, 2007, 07:30:15 pm
I'm having the following problems with the ThreadSearch Toolbar on Linux Ubuntu 7.04 wx263. Anyone else?

(http://img255.imageshack.us/img255/3047/190bg5.png)

(http://img255.imageshack.us/img255/6083/189dw1.png)
Title: Re: ThreadSearch 0.7 release
Post by: dje on July 01, 2007, 07:39:59 pm
I never saw that on my Ubuntu 6.10.
Maybe should I use a "real" size instead of wxDefaultSize...

EDIT : can you undock it and resize it ?

Dje
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on July 01, 2007, 08:49:33 pm
I never saw that on my Ubuntu 6.10.
Maybe should I use a "real" size instead of wxDefaultSize...

EDIT : can you undock it and resize it ?

Dje

Here it is undocked and with the downArrow clicked.

(http://img107.imageshack.us/img107/6126/191vi2.png)

Would you like me to change anything?
 
Title: Re: ThreadSearch 0.7 release
Post by: Pecan on July 01, 2007, 09:37:37 pm
Dje


http://www.savefile.com/files/856233
 (http://www.savefile.com/files/856233)

The above file contains ThreadSearch0.7 source containing the mods I've made along with mods for update.bat, ThreadSearch.cbp and ThreadSearch-unix.cbp



Title: Re: ThreadSearch 0.7 release
Post by: Pecan on July 01, 2007, 11:14:10 pm
I never saw that on my Ubuntu 6.10.
Maybe should I use a "real" size instead of wxDefaultSize...

EDIT : can you undock it and resize it ?

Dje

Here it is undocked and with the downArrow clicked.

(http://img107.imageshack.us/img107/6126/191vi2.png)

Would you like me to change anything?
 

I put a debug statement as follow:
Code
bool ThreadSearch::BuildToolBar(wxToolBar* toolBar)
    ....
toolBar->Realize();
#if wxCHECK_VERSION(2, 8, 0)
toolBar->SetInitialSize();
#else
toolBar->SetBestFittingSize();
#endif

int x, y;
m_pCboSearchExpr->GetSize(&x,&y);
DBGLOG(wxT("ThreadSearch ToolBar Size[%d][%d]"), x, y);
    ....

and got the following result:

[17:03:45.742]: ThreadSearch ToolBar Size[100][25]

Is this a little small for a wxcombo box? I though 25 pixels is almost closed.

Title: Re: ThreadSearch 0.7 release
Post by: dje on July 01, 2007, 11:31:48 pm
Hi !

I wrote a wiki page (http://wiki.codeblocks.org/index.php?title=ThreadSearchManual) for the ThreadSearch plugin.

@Pecan
Thanks for project and for Linux investigation.
I'll try to see on my 6.10 tomorrow.

Bye  :)
Title: Re: ThreadSearch 0.7 release
Post by: dje on July 02, 2007, 11:16:21 am
Hi all !

@dmoore
I realize that search in file isn't possible, but just left it in to show the possibilities (I did take out the more complex multiple file/directory targets, which sends a list of a space separated files and directories that the user selected before right clicking)
It is quite easy to manage a list of items instead of one directory. I'd choose a '*' instead of space for separator because '*' can't be used in paths and avoid problems with 'Program files' or others.

Technically, nothing seems really difficult but:
Once you right-clicked an item, how do you get search text ? Sould it activate window, fill the directory path, check directory search check box and set focus to combo to set the search text ?
I think it would be the best solution, so that user has less to do. Moreover, it let him choose the configuration he wants to use and we do not have to merge FindData with current one (I don't know if I would appreciate to have my settings altered by the file explorer contextual menu call).
What do you think about that ?

btw, it could have been something I did wrong, but I was getting a crash on exit (even without starting up a threadsearch)
I never had this problem. Could you be more precise on context ? Do you have any crash report ?

Dje
Title: Re: ThreadSearch 0.7 release
Post by: dmoore on July 02, 2007, 08:32:22 pm
I realize that search in file isn't possible, but just left it in to show the possibilities (I did take out the more complex multiple file/directory targets, which sends a list of a space separated files and directories that the user selected before right clicking)
It is quite easy to manage a list of items instead of one directory. I'd choose a '*' instead of space for separator because '*' can't be used in paths and avoid problems with 'Program files' or others.

yeah i guess that will save putting the names in quotes. to handle this case, your buildmodulemenu should look like this:
Code
void InterpretedLangs::BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data)
{
...
    if(type==mtUnknown) //Assuming file explorer -- fileexplorer fills the filetreedata with ftdkFile or ftdkFolder as "kind", the folder is the full path of the entry
    {
        if(data && data->GetKind()==FileTreeData::ftdkVirtualGroup) //right clicked on multiple selections in file explorer
       {
            wxString paths=data->GetFolder(); //get folder contains a space separated list of the files/directories
...
}

Quote
Technically, nothing seems really difficult but:
Once you right-clicked an item, how do you get search text ? Sould it activate window, fill the directory path, check directory search check box and set focus to combo to set the search text ?

yes, that is how I would do it.

Quote
btw, it could have been something I did wrong, but I was getting a crash on exit (even without starting up a threadsearch)
I never had this problem. Could you be more precise on context ? Do you have any crash report ?
Dje

hasn't happened since so most likely was something i was doing wrong. If it happens again I'll post the report.
Title: Re: ThreadSearch 0.7 release
Post by: tiwag on July 03, 2007, 10:07:54 pm
since i've updated to ThreadSearch 0.7, the contextmenu item "find occurrences of"
isn't longer grouped with the codecompletion "find declaration / implementation" menu items.

see screenshot

any workaround known?

brgds, tiwag

[attachment deleted by admin]
Title: Re: ThreadSearch 0.7 release
Post by: dje on July 03, 2007, 10:20:00 pm
Hi Biplap !

I saw the problem a couple of time.

When building the plugin menu, I'm looking for the 'Find implementation of' item to insert the find occurrences just after. If not found, it is appended at the end.

Either pattern has changed or plugin method is called after.
I didn't try myself but did you try to unsinstall/reinstall it (or disable/enable it after patch) ?

Dje

Title: Re: ThreadSearch 0.7 release
Post by: tiwag on July 03, 2007, 10:25:41 pm
I didn't try myself but did you try to unsinstall/reinstall it (or disable/enable it after patch) ?
yes i tried that a couple of times, but it didn't change

brgds, tiwag
Title: Re: ThreadSearch 0.7 release
Post by: tiwag on July 04, 2007, 12:20:46 am
found the reason, why it didn't work anymore

the plugins are loaded in the sequence as they are stored on the harddisk.
for some reason the threadsearch.dll was in the sequence before codecompletion.dll,
therefore at the time of loading threadsearch.dll there was no menu item 'Find implementation of'
existing, because codecompletion.dll wasn't loaded and the menu item got appended.

after manually removing and copying the plugins in the desired order, the menu items are grouped again.

suggestion: the plugin management setup should be extended in order to specify the sequence of plugins loading.

brgds, tiwag


[attachment deleted by admin]
Title: Re: ThreadSearch 0.7 release
Post by: pauliusz on July 04, 2007, 12:30:25 am
suggestion: the plugin management setup should be extended in order to specify the sequence of plugins loading.

I don't agree. What will happen if CC plugin will be disabled?
I thing plugins shouldn't depend on other plugins...
Title: Re: ThreadSearch 0.7 release
Post by: tiwag on July 04, 2007, 12:42:48 am
... What will happen if CC plugin will be disabled? ...

nothing bad, all enabled plugins will load in the specified order.

normally there aren't any dependencies between plugins
but in special cases it's better to have the possibility to define the loading sequence
than gambling using the OS's file sequence on the harddisk.  :P

brgds, tiwag
Title: Re: ThreadSearch 0.7 release
Post by: dje on July 04, 2007, 08:25:23 am
Hi all !

Quote
... What will happen if CC plugin will be disabled? ...

nothing bad, all enabled plugins will load in the specified order.
Quote
normally there aren't any dependencies between plugins

All this is true. ThreadSearch is standalone and does not need code completion.
I chose to place the 'Find occurrences' item just below 'Find implementation' because I think it makes sense and would be more pleasant for user.

Quote
suggestion: the plugin management setup should be extended in order to specify the sequence of plugins loading.
I think the wrong side of this idea is the implicit plugin dependency (with knowledge of it).
Another idea is to allow user to reorder contextual menu items in Editor settings  which is 'dependent safe'.

Dje
Title: Re: ThreadSearch 0.7 release
Post by: mariocup on July 04, 2007, 12:01:21 pm
Hi dje,

I am testing Thread-Serach with CB SVN 4216 under linux and have the following strange behaviour.

1. I mark a text in the editor and put the string in the clipboard (Ctrl+C).
2. Then I go to the field for entering the search text in Thread Search Panel or Toolbar (cursor is blinking).
3. If the Ctrl-V shortcut is used, the text will be inserted in the editor instead of the thread search field (although the cursor is still blilnking).


I solved the problem. I forgot to rebuilt the ThreadSearch Plugin. :?

Bye,

Mario
Title: Re: ThreadSearch 0.7 release
Post by: dje on July 04, 2007, 01:27:31 pm
Hi Mario !

It is a known issue that Pecan has solved in this post.
C::B systematically apply paste operation to active editor.

I'll integrate this patch in next release.

Thanks for reporting the bug, better twice than 0  :)

Dje
Title: Re: ThreadSearch 0.7 release
Post by: dmoore on July 05, 2007, 06:26:34 pm
It's a bug in the way CB main.cpp handles the clipboard/copy/paste events. It always thinks the paste is for the current editor even when the editor DOES NOT have the focus.

@Pecan: is there any reason not to post a patch to main.cpp onto berlios to fix this? The main editor window stealing all copy/paste requests is a bug IMO.
Title: Re: ThreadSearch 0.7 release
Post by: MortenMacFly on July 05, 2007, 06:47:57 pm
Another thing I noticed (on Windows):
If I have the ThreadSearch panel active (in foreground) and close C::B it will crash.
BTW: Did I miss a newer version? I saw you fixed quite some bugs but I see 0.7 here, only.
With regards, Morten.
Title: Re: ThreadSearch 0.7 release
Post by: Biplab on July 05, 2007, 07:35:48 pm
Hi Biplap !

I saw the problem a couple of time.

When building the plugin menu, I'm looking for the 'Find implementation of' item to insert the find occurrences just after. If not found, it is appended at the end.

Either pattern has changed or plugin method is called after.
I didn't try myself but did you try to unsinstall/reinstall it (or disable/enable it after patch) ?

Dje

Hi Dje,

I missed this post. So I'm sorry for this late reply. :)

I tested the plugin and in my system it shows the "Find occurrences of .." in correct place.

IMHO, plugin loading should not affect the menu position as the menu is created by BuildModuleMenu() and this is Not called once. The menu will be recreated every time you right click on Editor. So this problem should not arise. It seems that in some rare cases, Code-Completion fails to create it's module menu before ThreadSearch starts its work. :)

I must say this is a useful plugin and thanks for sharing this with us. :)

Best Regards,

Biplab
Title: Re: ThreadSearch 0.7 release
Post by: dje on July 06, 2007, 01:05:01 am
If I have the ThreadSearch panel active (in foreground) and close C::B it will crash.
BTW: Did I miss a newer version? I saw you fixed quite some bugs but I see 0.7 here, only.

Sorry, "real world" catch me back (for a while  :wink:).

As soon as the icons problem is solved in this thread (http://forums.codeblocks.org/index.php/topic,6338.new.html#new) and Pecan provides makefile.am (thanks !), I'll put the 0.8 on SVN with fixes.

Concerning the crash, I can't reproduce it. Do you crash the nightly or SVN ? Which control is focused ? Is it XP SP2 ? wxWidgets 2.6.3 or you switched to 2.8.4 ?


Quote
I must say this is a useful plugin and thanks for sharing this with us.
Would be stupid not to do it  :P

For 'Find occurrences' position, I don't see any other way to proceed...

Dje
Title: Re: ThreadSearch 0.7 release
Post by: MortenMacFly on July 06, 2007, 07:14:22 am
Concerning the crash, I can't reproduce it. Do you crash the nightly or SVN ? Which control is focused ? Is it XP SP2 ? wxWidgets 2.6.3 or you switched to 2.8.4 ?
- SVN trunk (r4229)
- the search box in the "log" panel is focussed (ThreadSearchView IMHO)
- Windows XP SP2
- wxWidgets 2.6.4
I will attach a crash log in a minute... stay tuned...
With regards, Morten.

Edit: Have attached the crash report. The strange thing is: I cannot pinpoint the line in the ThreadSearch plugin, although I haven't stripped symbols or something... really strange...

[attachment deleted by admin]
Title: Re: ThreadSearch 0.7 release
Post by: MortenMacFly on July 06, 2007, 12:39:47 pm
Edit: The strange thing is: I cannot pinpoint the line in the ThreadSearch plugin, although I haven't stripped symbols or something... really strange...
Alright - false alarm. The root was another plugin which got fixed in the meanwhile. ThreadSearch is just fine now.
So just forget about the noise... :oops:
Title: Re: ThreadSearch 0.7 release
Post by: sps on July 06, 2007, 01:25:59 pm
Great work! dje.

I loved this plugin. I used 0.6 version as well but 0.7 is really stable.
Title: Re: ThreadSearch 0.7 release
Post by: dje on July 06, 2007, 01:58:23 pm
Great work! dje.

I loved this plugin. I used 0.6 version as well but 0.7 is really stable.
Thanks !  :D Nice to read it !
Title: Re: ThreadSearch 0.7 release
Post by: mariocup on July 08, 2007, 12:08:04 am
Hi dje,

as thread search supports the preview of search results it would be cool to have the same functionality for search and replace. So thread search can help to refactor the names of variables showing the preview and have a dialog to confirm the replace action.

Title: Re: ThreadSearch 0.7 release
Post by: Pecan on July 08, 2007, 10:44:40 pm
Here is the best I can do for a Makefile.am .

However, when I add it to the CB automake system, the compiles for the contribs are no longer invoked. Even with --enable-contribs . So I guess I'm not pointing to it correctly.

It does create a Makefile.in and a Makefile. The Makefile works and the .libs is created when I force the Makefile to run.

Someone else will have to figure out how to correctly plug it into the CB automake system.

Code

INCLUDES = $(WX_CXXFLAGS) \
        $(WX_GTK2_CFLAGS) \
-I$(top_srcdir)/src/include \
-I$(top_srcdir)/src/include/wxscintilla/include \
        -I$(top_srcdir)/src/include/wxFlatNotebook/include

libdir = $(pkgdatadir)/plugins

lib_LTLIBRARIES = libThreadSearch.la

libThreadSearch_la_LDFLAGS = -module -version-info 0:1:0 -shared -no-undefined -avoid-version

libThreadSearch_la_LIBADD = $(PLUGIN_WX_LIBS) ../../../sdk/libcodeblocks.la

libThreadSearch_la_SOURCES = DirectoryParamsPanel.cpp \
SearchInPanel.cpp \
TextFileSearcher.cpp \
TextFileSearcherRegEx.cpp \
TextFileSearcherText.cpp \
ThreadSearch.cpp \
ThreadSearchConfPanel.cpp \
ThreadSearchDefaultPanel.cpp \
ThreadSearchEvent.cpp \
ThreadSearchFindData.cpp \
ThreadSearchThread.cpp \
ThreadSearchTrace.cpp \
ThreadSearchView.cpp

noinst_HEADERS =  DirectoryParamsPanel.h \
SearchInPanel.h \
TextFileSearcher.h \
TextFileSearcherRegEx.h \
TextFileSearcherText.h \
ThreadSearch.h \
ThreadSearchConfPanel.h \
ThreadSearchControlIds.h \
ThreadSearchDefaultPanel.h \
ThreadSearchEvent.h \
ThreadSearchFindData.h \
ThreadSearchThread.h \
ThreadSearchTrace.h \
ThreadSearchView.h

pkgdatadir = $(datadir)/@PACKAGE@/images/settings

dist_pkgdata_DATA = ThreadSearch.png \
ThreadSearch-off.png

EXTRA_DIST = manifest.xml

ThreadSearch.zip:
PWD=`pwd` cd $(srcdir) && zip $(PWD)/ThreadSearch.zip manifest.xml *.png *.xrc > /dev/null

install-data-local: ThreadSearch.zip
$(mkinstalldirs) $(DESTDIR)$(datadir)/@PACKAGE@/; \
if test -f $(srcdir)/ThreadSearch.zip; then p=$(srcdir)/ThreadSearch.zip; else p=ThreadSearch.zip; fi; \
$(INSTALL_DATA) $$p $(DESTDIR)$(datadir)/@PACKAGE@/ThreadSearch.zip

Title: Re: ThreadSearch 0.7 release
Post by: MortenMacFly on July 09, 2007, 09:24:15 am
Someone else will have to figure out how to correctly plug it into the CB automake system.
Did you forget to register this plugin inside configure.in (it's makefiles), maybe?!
Title: Re: ThreadSearch 0.7 release
Post by: mariocup on July 27, 2007, 11:54:51 pm
Hi dje,

I noticed that in the threadsearch toolbar the tool tips are missing.
Title: Re: ThreadSearch 0.7 release
Post by: dje on July 28, 2007, 12:30:48 am
Hi Mario !

Good time to say it, ThreadSearch 0.8 will soon be released.
Thanks,

Dje

Title: Re: ThreadSearch 0.7 release
Post by: tiwag on September 04, 2007, 04:14:05 pm
Good time to say it, ThreadSearch 0.8 will soon be released.

did i overlook sthg ? where can i dl the actual sources ?

thx & brgds
tiwag
Title: Re: ThreadSearch 0.7 release
Post by: dje on September 04, 2007, 04:41:21 pm
Hi Tiwag !

You missed nothing but...
I created 3 partitions my PC :
- Linux (Ubuntu 7.04)
- XP
- FAT32 to share

It will be a 1.0 release.
XP is Ok.
I have a problem I can' t solve for now on Ubuntu 7.04 (missing symbols); it is described at this post (http://forums.codeblocks.org/index.php/topic,6843.msg52404.html#msg52404) but I have no answer.

Once it is solved, there one "identified not solved" linux problem remaining.

As soon as all is OK, I release it and put it on SVN.
I have to synchronise with Lieven to see how to integrate it in the nightlies build process.

Dje
Title: Re: ThreadSearch 0.7 release
Post by: tiwag on September 04, 2007, 06:08:27 pm
Hi Tiwag !

You missed nothing but...
I created 3 partitions my PC :
- Linux (Ubuntu 7.04)
- XP
- FAT32 to share

It will be a 1.0 release.
XP is Ok.
I have a problem I can' t solve for now on Ubuntu 7.04 (missing symbols); it is described at this post (http://forums.codeblocks.org/index.php/topic,6843.msg52404.html#msg52404) but I have no answer.

Once it is solved, there one "identified not solved" linux problem remaining.

As soon as all is OK, I release it and put it on SVN.
I have to synchronise with Lieven to see how to integrate it in the nightlies build process.

Dje


Hi dje

thanks !

maybe you can upload the win32 version in the meantime,
threadsearch 0.7 doesn't build with recent svn CB version.

brgds,
tiwag
Title: Re: ThreadSearch 0.7 release
Post by: JGM on September 04, 2007, 08:33:58 pm
threadsearch 0.7 doesn't build with recent svn CB version.

Yep, I want to use it, but can't compile it. This useful plugin should be added to the contribs when the 0.8 is released.

There should be a section with all the plugins that exist organized by categories, like xoops does with the modules   :). Also some developing rules to maintain a standard in the development of plugins (i think  :roll:).
Title: Re: ThreadSearch 0.7 release
Post by: MortenMacFly on November 12, 2007, 12:54:07 pm
Oh well... after the latest changes in the SDK this one seems pretty broken, unfortunately... :-(
Title: Re: ThreadSearch 0.7 release
Post by: mandrav on November 12, 2007, 01:18:14 pm
Oh well... after the latest changes in the SDK this one seems pretty broken, unfortunately... :-(

Fear not. We 're here to help with the transition :).
Title: Re: ThreadSearch 0.7 release
Post by: dje on November 12, 2007, 01:56:48 pm
Hi Morten !

My answer on the last ThreadSearch thread (http://forums.codeblocks.org/index.php/topic,6931.msg55430.html#msg55430)

Dje