Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: dmoore on August 08, 2007, 07:47:24 pm

Title: Shell Extension plugin: win32 plugin binaries
Post by: dmoore on August 08, 2007, 07:47:24 pm
for those who don't have the time or inclination to compile from source I have compiled the ShellExtensions plugin against the August 8th nightly build of C::B (approx rev 4361) for win32. The ~200kb plugin binary should work with any recent version of CB.

What is it?
Think of it as the C::B tools menu on steroids plus a File Explorer:
* The file explorer lets you browse and manage files and directories in your file system in a tree structure from within CB, add mutliple files to projects with just a few clicks, see the state of your version controlled files (supports SVN, mercurial and bazaar), keep track of favorite directories, filter files to match a wildcard list and much more.
* The plugin lets you setup commands which depend on the user selecting a file or directory target (or multiple files or directories). Those commands appear as options in the main menu (under the menu "Extensions" where you will be prompted to choose any file or directory targets) or in context menus when you right click on an open file in the editor pane, right click on a file in the project tree or right click on files or directories in the file explorer. The way commands are displayed in menus can be customized.

Downloads
download 0.2.0 release here (based on CBIL plugin project SVN rev 113):
https://developer.berlios.de/project/showfiles.php?group_id=7745&release_id=13219

or the older 0.1 release here (based on CBIL plugin project SVN rev 93):
http://developer.berlios.de/project/showfiles.php?group_id=7745&release_id=13218

(the primary difference between the two release is improved menu handling, improved implementation of version control decorations, the addition of command import/export and the addition of favorite folders in 0.2)

I may make bug fix releases under the 0.2 version number (if any are reported)

New features will continue to be added in 0.3 and later versions.

Installation

Download and install a recent nightly build. Download a copy of the plugin. Start Code::Blocks. Select Manage Plugins from the Plugin Menu. Press the Install Button and choose the plugin file.

Respond in this thread if you encounter any problems
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dje on August 08, 2007, 11:35:17 pm
Hi Damien !

Very nice, I'll keep it !  :D

Little problem, when I browse my C::B SVN directory with the SVN decorators selected, the standard file icon is used.
I use today's build (SVN 4361)

Thanks,

Dje
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dmoore on August 08, 2007, 11:47:25 pm
Hi dje, thanks for testing

questions: were you seeing the svn decorators working before? is svn in your path?
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: mariocup on August 08, 2007, 11:48:27 pm
Hi damien,

I tested the add favorite feature. I think it would be easier for user to have a icon like the attached one next to the recent list of selected dirs.

If the user clicks on the bookmark icon he sees the list of bookmark and can select the entries. I think it is confusing to see the favorite names in the recent list of selected dirs.

What do you think about that?

BTW: I tested the Windowed Console Notepage. I missed that feature so long. Now I can have a cmd.exe/shell window within codeblocks. This is so cool. :D

[attachment deleted by admin]
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: mariocup on August 08, 2007, 11:49:56 pm
Hi Damien,

the svn decorators and the svn feature e.g. update etc. work perfect. (currently tested under windows)
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dje on August 09, 2007, 12:15:51 am
Damien, I work only with Tortoise SVN on Win XP SP2.
I did not install SVN (no SVN.exe onmy PC). For sure I ca do it !

I tested your plugin before SVN integration.
Could you list the pre-requisites ?
Is it possible to check for required binaries to disable menu options if not found ?
Is it possible to use tortoiseSVN icons ?

Dje
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: mariocup on August 09, 2007, 12:21:27 am
Hi dje,

perhaps there should be a option in the shell extension plugin to configure where the binaries of version control system are located.

I do not know what is the license of the tortoiseSVN icons?

Mario
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dmoore on August 09, 2007, 12:24:18 am
Hi damien,

I tested the add favorite feature. I think it would be easier for user to have a icon like the attached one next to the recent list of selected dirs.

so clicking the icon spawns a context menu? I could do that. The reason i put the favorites on the recent files list was just to minimize the number of controls to reduce cluter. For now you can always put special characters in front of the alias for the favoriate items (e.g. "*" or "+") to make it clear they are favorites and not just recent items. Favorites are always above the recent dirs in the list.

Quote
BTW: I tested the Windowed Console Notepage. I missed that feature so long. Now I can have a cmd.exe/shell window within codeblocks. This is so cool. :D

I implemented the feature a long time ago but it has been kind of buried until i updated the config panel recently. it has lots of limitations, though: often, especially on win32, you won't be able to redirect input or output to the window for a particular app, so you either won't see anything or the app will get stuck waiting for input. also on windows it will usually take two click to abort an app. One of the cool features of the console notepage is that it can parse some error messages that refer to a line number of a particular file (I only really got it working for python error messages) so you can click on the error to open the file and go to that line number. I'll improve this in future versions.
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dmoore on August 09, 2007, 12:26:43 am
Damien, I work only with Tortoise SVN on Win XP SP2.
I did not install SVN (no SVN.exe onmy PC). For sure I ca do it !

I tested your plugin before SVN integration.
Could you list the pre-requisites ?

in this version you will need SVN.exe and it has to be in the windows path (unfortunately I hard coded the command, but I wouldn't be averse to putting the command in the cb .conf files so it can at least be hand edited). In the future I will let the user configure the location manually.

Quote
Is it possible to check for required binaries to disable menu options if not found ?

that's another option...

Quote
Is it possible to use tortoiseSVN icons ?

the only issue might be licensing.
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dje on August 09, 2007, 12:34:53 am
Tortoise SVN is licensed under GPL.

One thing...
I created a perl association and opened a file in C::B editor.
When I click on Extensions/perl, I am asked for the command target, whereas I thought it would take current file (if association matches). Is it normal ? If yes, could you add an entry for program current item if the current file matches the conditions ?

Dje
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dmoore on August 09, 2007, 12:39:11 am
Tortoise SVN is licensed under GPL.

I'll discuss this idea in more detail with you later, but in principle it should be do-able

Quote
I created a perl association and opened a file in C::B editor.
When I click on Extensions/perl, I am asked for the command target, whereas I thought it would take current file (if association matches). Is it normal ? If yes, could you add an entry for program current item if the current file matches the conditions ?

unfortunately it is normal for now. I'm thinking of changing to the behavior you expect. For now, you can right click in the editor window itself if you want to run that command.
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dje on August 09, 2007, 12:44:39 am
I'm thinking of changing to the behavior you expect.
Cool  8)

For now, you can right click in the editor window itself if you want to run that command.
Nice, I had simply right clicked my file in the browser.

One easy evolution could be to add opened items in the recent files list.

Dje
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: mariocup on August 09, 2007, 07:32:19 am
Hi Damien,

what I am thinking about for bookmarks is something like the attached screenshot.

[attachment deleted by admin]
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dje on August 09, 2007, 07:54:39 am
Hi !

This bookmarks management is will be very nice and useful.

Dje
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dmoore on August 09, 2007, 05:44:09 pm
One easy evolution could be to add opened items in the recent files list.

you mean right clicking in the opened files list? not so easy because as far as I can tell the opened files list doesn't call BuildModuleMenu

This bookmarks management will be very nice and useful.


well it already exists now. you can right click on a directory in the tree and click add to favorites. you can manage the list of favorites with "view->manage favorites" (rather strange location for the option admittedly)

Tortoise SVN is licensed under GPL.
I'll discuss this idea in more detail with you later, but in principle it should be do-able

provided the GPL also applies to the art, then I guess that's fine.
On a more technical note, tortoise SVN uses icon overlays. wxTreeCtrl does not support icon overlays, therefore icons will need to be overlaid by hand. Given that's the case, it might just be easier to come up with new art in the "style" of the tortoiseSVN icons.

what I am thinking about for bookmarks is something like the attached screenshot.

the icons are pretty :). what program is that? I'm still not sure I like the extra clutter of that button (personally, I don't find toolbar style controls particularly helpful even if compact) but let me think about it some more. At the least I'll provide the option to do it the way you suggest...

Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dje on August 09, 2007, 07:02:30 pm
Quote
you mean right clicking in the opened files list? not so easy because as far as I can tell the opened files list doesn't call BuildModuleMenu
Far more simple  :)
When I open a file through the explorer, I think it should be added to the recent files list of the file menu.

Quote
well it already exists now. you can right click on a directory in the tree and click add to favorites. you can manage the list of favorites with "view->manage favorites" (rather strange location for the option admittedly)
Yes, I know it. I think it is better to have to controls : one for history, the second for favorites. It's cleaner.

Concerning icons, it doesn't matter. I was surprised to select SVN Decorators and see nothing in my C::B project, even an advertisement.
I did not find the problem immediatly because SVN is used through TortoiseSVN.

Really good works !

Dje
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dje on August 09, 2007, 07:11:57 pm
Features propositions:
- navigation keys to go back and forward in navigation history
- When you select a favorite directory, it is set as root. I'd like to use backspace or left key on the root to be able to switch back to "standard" disk tree and go back into parent folder.
- could you handle relative paths in the path text control ?

Dje
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dmoore on August 09, 2007, 08:08:33 pm
- navigation keys to go back and forward in navigation history

yes, but just like having a favorites button it means more space is taken up by navigation controls.

Quote
- When you select a favorite directory, it is set as root. I'd like to use backspace or left key on the root to be able to switch back to "standard" disk tree and go back into parent folder.

yes. I just need to figure out how to intercept keystrokes correctly.

Quote
- could you handle relative paths in the path text control ?

yes, I will definitely implement this.

Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dje on August 09, 2007, 08:41:46 pm
3 propositions, 3 yes ! Nice to deal with you  :wink:

Concerning space, you could propose as an option the buttons display.
I think they could be added on the Wildcard row, which is, to my mind, less useful than path text control.
Another option could be a toolbar.

Dje
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dje on August 09, 2007, 09:04:35 pm
Bug ?

When I double click on a file, I get the "What to do ?" window.
When I click on enter with the same file selected, I get the following message in the Code::Blocks log :
Quote
ERROR: Could not open file ''.
The registered handler (Files extension handler) could not open it.

Win XP SP2
SVN 4361

Dje
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dmoore on August 09, 2007, 09:07:48 pm
interesting. what sort of file was it?
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dmoore on August 09, 2007, 09:10:30 pm
looks like it affects all files. definitely a bug.

EDIT: I think I made the mistake of assuming the event.GetItem() would always contain the selected item, but it looks like this is only true for double clicking, not pressing enter on win32 (works on Linux, though)
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dje on August 09, 2007, 09:25:25 pm
I use GetItem in a tree control on my PC and it works on my wxTreeEvent with my SP2.

Dje
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: mariocup on August 10, 2007, 09:30:25 am
Hi Damien,

the screenshot is one of my favorite programs Krusader (krusader.sf.net).
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: mariocup on August 19, 2007, 10:36:52 pm
Hi Damien,

I thought about how to manage the favorites and an idea come to my mind. What would be nice to manage favorites like virtual folders/categories. For examples you have a category documentation and under this category you have different favorites e.g. d:\documents\, n:\doc and network shares. This could be something like a bookmark manager in web browser. Just think about it. :D
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: mariocup on October 05, 2007, 11:53:00 pm
Hi Damien,

as I am using your file explorer every day I have a feature request. :D
If I mark one file in the file explorer and open the context menu I get Open in CB Editor, but if I mark several files I do not get this context menu entry. I would be nice to open several files with just one click to enchance working.

Bye
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dmoore on October 06, 2007, 06:12:26 pm
yes, I'll put it on my todo list. I haven't had a lot of time to work on the plugin lately and recently lost my development machine (motherboard failure). I'll get to this sometime in the next few weeks, though...

the biggest weakness with the plugin right now is the polling for files on the main thread (this is especially slow when polling for file states in directories under version control). I've sketched out some prototype code to do the file listening in a background thread and hopefully get an opportunity to implement that soon.

also here's an extension to try: when you want to use the native file explorer to browse a folder that is listed in the tree add an extension "Explore" that spawns the command "explorer $dir" (for windows explorer, substitute your favourite File Manager...)
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: roshi on December 11, 2008, 05:12:41 am
Hi,
is this thing or something similar available for the linux build?

Thanks
Title: Re: Shell Extension plugin: win32 plugin binaries
Post by: dmoore on December 11, 2008, 03:09:50 pm
it works on linux but you have to compile from source (available from the project svn - link to project in my sig). It's slightly painful to build because I haven't created makefiles (I have supplied ShellExtensions-unix.cbp project files but that assumes you have compiled CB itself from source from within CB using the supplied codeblocks-unix.cbp files). makefile patches welcome!