Code::Blocks

User forums => Using Code::Blocks => Topic started by: zlieb on December 25, 2009, 09:41:27 pm

Title: is there a way of associating a workspace to a given project?
Post by: zlieb on December 25, 2009, 09:41:27 pm

for example, if you open a given project file that it opens the similarly named workspace?  This is (I think) the default behaviour in VS2008 -- when I have a project and a solution in the same directory that references it, and I double click the project, it opens the appopriate solution (VS's version of a workspace).   At the moment, my when I double click the codeblocks project, it doesn't load any workspace (but creates a new, empty workspace).   my main problem is, it's very easy to trip up workspaces, to open multiple projects into a workspace, etc, and it seems a bit problematic for our end users --   if there was a way of somehow automating the relationship of a project to it's workspace, that would be great.

I know projects can belong to multiple workspaces, so this is not a totally cut and dry thing --  but I think the VS solution, which searches the same directory for a solution that references the project, seems pretty reasonable as it leads to alot less confusion.

thanks!
zach
Title: Re: is there a way of associating a workspace to a given project?
Post by: jens on December 25, 2009, 10:15:37 pm
Where is the problem with double-clicking the workspace-file ?
Title: Re: is there a way of associating a workspace to a given project?
Post by: stahta01 on December 26, 2009, 01:14:50 am
Where is the problem with double-clicking the workspace-file ?

By default windows does not show the file extension.
I call this the stupid windows give me a virus mode.

Edit: To disable the above

In a Computer window
Tools -> Folder Options
Tab View
Uncheck Option: Hide Extensions for Known File Types.

Tim S.
Title: Re: is there a way of associating a workspace to a given project?
Post by: jens on December 27, 2009, 11:53:19 am
Where is the problem with double-clicking the workspace-file ?

By default windows does not show the file extension.
But the shown icon is (should be) different.

I call this the stupid windows give me a virus mode.

Edit: To disable the above

In a Computer window
Tools -> Folder Options
Tab View
Uncheck Option: Hide Extensions for Known File Types.

Tim S.

That's one of the first things I do on all my new windows installs.
Title: Re: is there a way of associating a workspace to a given project?
Post by: zlieb on December 27, 2009, 02:39:58 pm

Where is the problem with double-clicking the workspace-file ?

the problem is not with double clicking the workspace file (which I don't have a problem with), the problem is that there is no association (or implied association) from a project to a given workspace, which can lead to novices  making mistakes with a library of code that I make (openframeworks.cc).   Also, since the "adding a project" to a workspace is as simple as opening the project, it's *very* easy in CB to mistakenly add a project to a workspace it shouldn't be in.   

Having used xcode's project dependencies and VS solutions, I find CB's workspaces to be the most problematic for beginners.

I noticed that VS has a very nice behavior, which is to scan the folder of the given selected project for solutions (ie, workspaces) that reference that project and open them, and I wondered if CB had that behavior, or if it was one you could consider adding.

give it a try -- I think it greatly improves the overall usage of these kinds of files.

thanks
zach

Title: Re: is there a way of associating a workspace to a given project?
Post by: Seronis on January 08, 2010, 04:20:28 am
Where is the problem with double-clicking the workspace-file ?
the problem is not with double clicking the workspace file (which I don't have a problem with), the problem is that there is no association (or implied association) from a project to a given workspace...

I would really get annoyed at your suggested behaviour personally as I have a lot of projects that are included in many workspaces.  A workspace is a collection of projects.  Those projects are NOT required to be unique to that workspace so having a project know (or care) about what workspace it has been used in seems like a bad idea.  Let the new people click the appropriate file or in the case of a complex project they should RTFM anyways and find out what they are supposed to open.

edit:  ok on 2nd thought opening a workspace in the exact same location with the exact same name would be somewhat reasonable but id personally still want to be able to disable that option completely if i choose (which i would).