Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: vanxining on February 25, 2011, 05:18:35 pm

Title: About the project explorer sidebar
Post by: vanxining on February 25, 2011, 05:18:35 pm
When the files are not in the project's root folder, C::B will display the files like this:
(http://i.min.us/ilFPg0.png)
It's painful to explorer the files in my project as the items are too long. On the contrary, VS will display only the file name without the full path.
Er, I known that I have a really bad programming style, but this is really a big problem to me...
Is there a way to fix it for me?
Thanks.
Title: Re: About the project explorer sidebar
Post by: oBFusCATed on February 25, 2011, 05:43:05 pm
Yes, the normal behaviour is http://www.codeblocks.org/images/stories/imagebrowser/scr1.png

Right click on the project and play with the options. Also you should look in Project -> Project tree.
I don't have C::B here, so I can't tell you the name of the option...
Title: Re: About the project explorer sidebar
Post by: vanxining on February 25, 2011, 06:27:22 pm
Yes, the normal behaviour is http://www.codeblocks.org/images/stories/imagebrowser/scr1.png

Right click on the project and play with the options. Also you should look in Project -> Project tree.
I don't have C::B here, so I can't tell you the name of the option...

It's harder to open levels of folders, and I think the VS style is the best - no full path only the file name.
Title: Re: About the project explorer sidebar
Post by: oBFusCATed on February 25, 2011, 07:16:52 pm
There are virtual folders for such users, not exactly like VS, but something similar
Title: Re: About the project explorer sidebar
Post by: vanxining on February 26, 2011, 02:29:28 am
There are virtual folders for such users, not exactly like VS, but something similar

The result is the same: :)
(http://i.min.us/ijCq14.png)
Title: Re: About the project explorer sidebar
Post by: stahta01 on February 26, 2011, 05:23:59 am
Try checking "Display Folders as on Disk" under "Project Tree"

Tim S.
Title: Re: About the project explorer sidebar
Post by: dmoore on February 26, 2011, 07:31:15 pm
This sounds interesting, so I made a patch that will do what you want. It adds the menu option "Project -> Project Tree -> Show Filenames only". Seems to work, but I haven't tested extensively.

The patch was taken from latest svn of the debugger branch (hopefully, would also work on trunk)
Title: Re: About the project explorer sidebar
Post by: oBFusCATed on February 26, 2011, 08:42:33 pm
dmoore: have you tested it with something like:
Code
src/file1.cpp
src/path1/file1.cpp
src/path2/file1.cpp
:lol:

Title: Re: About the project explorer sidebar
Post by: dmoore on February 26, 2011, 09:17:11 pm
dmoore: have you tested it with something like:
Code
src/file1.cpp
src/path1/file1.cpp
src/path2/file1.cpp
:lol:

It "works" (as well as it can). Two identical names appear in the tree each referring to a distinct item. Sort order is weird though.
Title: Re: About the project explorer sidebar
Post by: dmoore on February 26, 2011, 10:42:22 pm
updated patch. sorts by filename instead of full path if "show filename only" is selected.

one feature is still missing: the tree should show a tooltip giving the full path to help user distinguish files with identical names.
Title: Re: About the project explorer sidebar
Post by: MortenMacFly on February 27, 2011, 10:24:31 am
updated patch. sorts by filename instead of full path if "show filename only" is selected.
Hi dmoore,
please don't go for it any further. I have a patch pending for a while now that does that. It works slightly different than your approach, but it recognises / handles virtual folders and alike better.
I'll try to extract a single "stand-alone" patch though, as it is combined with a some other modifications...
Title: Re: About the project explorer sidebar
Post by: MortenMacFly on February 27, 2011, 05:39:59 pm
...patch for trunk is here (attached).

Please give it a try!
Title: Re: About the project explorer sidebar
Post by: dmoore on February 28, 2011, 02:56:10 am
Morten: your patch works as advertised. You should probably grab the sorting part of my patch. It looks weird to have identical names show up in different places on the tree. Also, I didn't see an easy way to provide tooltips that give the full path that works on non MSW. Is there an easy fix?

but it recognises / handles virtual folders and alike better.

I thought my version left them alone the same way your patch does, but I guess I might have missed some important cases. No worries on the wasted duplication of effort.

Title: Re: About the project explorer sidebar
Post by: MortenMacFly on February 28, 2011, 07:40:50 am
You should probably grab the sorting part of my patch.
Yes, I'll take care.

Also, I didn't see an easy way to provide tooltips that give the full path that works on non MSW. Is there an easy fix?
I'll try...

No worries on the wasted duplication of effort.
A pity anyways... There is still something to come like drag/dropping multiple file (e.g. between /into virtual folders). So be careful when touching projectmanager / cbproject. ;-)
Title: Re: About the project explorer sidebar
Post by: daniloz on February 28, 2011, 09:20:59 am
@morten:
After updating to rev.7030, which includes your patch to "* allow to hide the folder name in project tree (in "flat view" mode)", I cannot compile anymore, it seems something (filesSortNameOnly) is still missing...  :shock:
Code
Compiling: sdk\cbproject.cpp
C:\Work\codeblocks_trunk\src\sdk\cbproject.cpp: In member function 'void cbProject::BuildTree(wxTreeCtrl*, const wxTreeItemId&, int, FilesGroupsAndMasks*)':
C:\Work\codeblocks_trunk\src\sdk\cbproject.cpp:845:22: error: 'filesSortNameOnly' was not declared in this scope
Title: Re: About the project explorer sidebar
Post by: MortenMacFly on February 28, 2011, 10:11:16 am
After updating to rev.7030, which includes your patch to "* allow to hide the folder name in project tree (in "flat view" mode)", I cannot compile anymore, it seems something (filesSortNameOnly) is still missing...  :shock:
...try again.
Title: Re: About the project explorer sidebar
Post by: daniloz on February 28, 2011, 10:17:33 am
After updating to rev.7030, which includes your patch to "* allow to hide the folder name in project tree (in "flat view" mode)", I cannot compile anymore, it seems something (filesSortNameOnly) is still missing...  :shock:
...try again.
Working now, thanks !!!!