Hi,
I would like codeblocks to throw an urgency hint when it completes compilation (for instance Xterm sets the urgency hint on a bell echo -e '\a' ). This way my window manager would make the virtual space blink on codeblocks completion. (Same for windows, codeblocks icon would blink). Maybe it already exists as an option but I couldn't find any. I tried to generate a bell as a postbuild script but codeblocks does not relay the bell. any way I am not too sure how that stuff works but that would sure be neat !
Matt
I think you would need to write simple c++ plugin for this task.
Right.it would possibly be the smallest plugin ever but it would certainly be doable.
Thanks for your answers.
I've followed the tutorial and compiled my first plugin. Could you give me a pointer on how to hook to the compiler completion event please ?
Regards
EDIT: OK I found it. It compiles now I need to install plugin & test
Hi,
I setup a repo here. I use 13.12 SDK with a nightly build so I had some errors when installing the plugin but nothing serious. Here is the code
https://github.com/teto/cbalert
I use http://docs.wxwidgets.org/trunk/classwx_top_level_window.html#a749d23ea08f6273fb93fe2c003b650b3 to notify the user. It seems to me that the event COMPILER_FINISHED isn't tirggered since my log message doesn't appear in codeblocks panel ?
I just did a short test.
I did not use your sources, but hacked the relevant part into the IncrementalSearch-plugin.
The event gets triggered, but wxBell does nothing (on Fedora 20 64Bit).
RequestUserAttention shows a notification (on gnome-shell), but only if C::B is in the background (as documented).
If I find time, I will clone your repo and do another test.
wxBell didn't work here either. I am using i3 (www.i3wm.org) as a WM and urgency hints work with many applications already so it must be my code which is wrong.
Did you test also when the build fails ? I haven't tested when it succeeded , only when it failed.
Thanks for the help.
Your plugin works here also after renaming the lib (removing the lib-prefix and unchecking the autogenerate prefix box).
Without that I was not able to install the plugin.
You might need to start C::B with the -v option to get more useful messages.
Glad it works !
May I inquire which version do you use ? I am using rev9501 and even when the build succeeds and window unfocsed, my workspace doesn't flash as it should. Might be a problem with i3 but would like to test with the same version as you before.
The -v flag showed nothing of interest.
Actual nightly from my repo (9854).
Quote
unchecking the autogenerate prefix box
OMG didn't see that box. was wondering why the lib prefix would reappear again and again after saving the project. So I kept loading an old version of my plugin !
I unchecked the box and it works perfectly :s !
this is one tricky box. I wonder if it is that useful, maybe warn the user when he modifies the output filename.
well thanks for your help, the "new plugin project" wizard is really cool : it makes it easy to create a plugin for CB (at least so simple as mine). good job to the team.
Would it be possible to add this plugin here :
http://wiki.codeblocks.org/index.php?title=Code::Blocks_Plugins
even though it's simple I believe it could interest others (I've seen at least one reference to it on the tracker).