User forums > General (but related to Code::Blocks)

Tools Help

(1/2) > >>

Vampyre_Dark:
I'd like to make a tool that could get me into my project folder quick. I can know how to get into a folder, I just have to type.. explorer ${PROJECT_DIR} as the command line. Problem is my projects look like this

Project Folder
/src
/obj
/folders with data files
Project.exe

So my project folder command brings me into Project Folder/src. Is there any way I can just navigate to just Project Folder?

thomas:
cbProject::GetCommonTopLevelPath()

killerbot:
what should ${PROJECT_DIR} return, the dir where the cbp file is located ??

or is ${PROJECT_DIR} not a variable.

Do I understand it is something you would register in the tools menu ??
Or are you writing code, then you can use Thomas' solution.

thomas:
There is no other solution since the common toplevel path is not available as a variable, and a script would not know about the project structure...

But luckily, it is really easy. Make a plugin of type "Tool" and fill in something like this:

--- Code: ---virtual int Execute()
{
wxString x(_T("explorer ") + Manager::Get()->GetProjectManager()->GetActiveProject()->GetCommonTopLevelPath());
::wxExecute(x);
};
--- End code ---

Compile and run, should do what you want.


EDIT: missing brace

TDragon:
explorer ${PROJECT_DIR}..
?

Works for me.

EDIT: Accidentally threw an unneeded slash in there.

Navigation

[0] Message Index

[#] Next page

Go to full version