Author Topic: About the project explorer sidebar  (Read 18785 times)

Offline vanxining

  • Single posting newcomer
  • *
  • Posts: 6
About the project explorer sidebar
« 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:

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.
« Last Edit: February 25, 2011, 05:26:55 pm by vanxining »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11715
    • Travis build status
Re: About the project explorer sidebar
« Reply #1 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...
(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!]

Offline vanxining

  • Single posting newcomer
  • *
  • Posts: 6
Re: About the project explorer sidebar
« Reply #2 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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11715
    • Travis build status
Re: About the project explorer sidebar
« Reply #3 on: February 25, 2011, 07:16:52 pm »
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!]

Offline vanxining

  • Single posting newcomer
  • *
  • Posts: 6
Re: About the project explorer sidebar
« Reply #4 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: :)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6507
    • My Best Post
Re: About the project explorer sidebar
« Reply #5 on: February 26, 2011, 05:23:59 am »
Try checking "Display Folders as on Disk" under "Project Tree"

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: About the project explorer sidebar
« Reply #6 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)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11715
    • Travis build status
Re: About the project explorer sidebar
« Reply #7 on: February 26, 2011, 08:42:33 pm »
dmoore: have you tested it with something like:
Code: [Select]
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!]

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: About the project explorer sidebar
« Reply #8 on: February 26, 2011, 09:17:11 pm »
dmoore: have you tested it with something like:
Code: [Select]
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.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: About the project explorer sidebar
« Reply #9 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9488
Re: About the project explorer sidebar
« Reply #10 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...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9488
Re: About the project explorer sidebar
« Reply #11 on: February 27, 2011, 05:39:59 pm »
...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: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: About the project explorer sidebar
« Reply #12 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.


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9488
Re: About the project explorer sidebar
« Reply #13 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. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: About the project explorer sidebar
« Reply #14 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: [Select]
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