News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

About the project explorer sidebar

Started by vanxining, February 25, 2011, 05:18:35 PM

Previous topic - Next topic

vanxining

When the files are not in the project's root folder, C::B will display the files like this:

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.

oBFusCATed

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...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

vanxining

Quote from: 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...

It's harder to open levels of folders, and I think the VS style is the best - no full path only the file name.

oBFusCATed

There are virtual folders for such users, not exactly like VS, but something similar
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

vanxining

Quote from: oBFusCATed on February 25, 2011, 07:16:52 PM
There are virtual folders for such users, not exactly like VS, but something similar

The result is the same: :)

stahta01

Try checking "Display Folders as on Disk" under "Project Tree"

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

dmoore

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)
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

oBFusCATed

dmoore: have you tested it with something like:

src/file1.cpp
src/path1/file1.cpp
src/path2/file1.cpp

:lol:

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

dmoore

Quote from: oBFusCATed on February 26, 2011, 08:42:33 PM
dmoore: have you tested it with something like:

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.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

dmoore

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.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

MortenMacFly

Quote from: dmoore on February 26, 2011, 10:42:22 PM
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...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

MortenMacFly

...patch for trunk is here (attached).

Please give it a try!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

dmoore

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?

Quote from: MortenMacFly on February 27, 2011, 10:24:31 AM
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.

Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

MortenMacFly

Quote from: dmoore on February 28, 2011, 02:56:10 AM
You should probably grab the sorting part of my patch.
Yes, I'll take care.

Quote from: dmoore on February 28, 2011, 02:56:10 AM
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...

Quote from: dmoore on February 28, 2011, 02:56:10 AM
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. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

daniloz

@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:

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