Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Plugins saving extra project settings?
(1/1)
Kazade:
I'm working on my unit testing plugin and it's going pretty well, but I've hit a small roadblock (well... two.. actually three) that I need some help with....
Basically, a project can have unit testing enabled or disabled. When you enable unit testing on a project, you get a new virtual folder called "Tests" and you get a load of funky menu items in the project manager (run all tests, add test etc.). Disabling unit testing on a project removes the "Tests" folder and will remove any test source files and build targets that were added to the project. At the moment I'm classing a project as having unit testing enabled if it has a "Tests" virtual folder... it works, but it's not very robust (if a project already has a custom Tests virtual folder everything will break). So my questions:
1. Can I save a "unit_testing_enabled" flag in the project file somehow - if so, can someone point me in the right direction?
2. Is there any way to specify a new build target type? (I noticed that the current list is an enum.. so I'm pretty sure I can't extend it - I can work around it if it's not possible)
3. When I remove the "Tests" folder using project->VirtualFolderDeleted() the folder is deleted (because it's not contained in the GetVirtualFolders() list) *but* it's still displayed in the tree view. How do I refresh the tree to reflect the change?
MortenMacFly:
--- Quote from: Kazade on February 17, 2009, 11:37:57 am ---1. Can I save a "unit_testing_enabled" flag in the project file somehow - if so, can someone point me in the right direction?
--- End quote ---
Yes - have a look at e.g. the wxSmith/envvars plugin how to do so.
--- Quote from: Kazade on February 17, 2009, 11:37:57 am ---2. Is there any way to specify a new build target type? (I noticed that the current list is an enum.. so I'm pretty sure I can't extend it - I can work around it if it's not possible)
--- End quote ---
No, this would require a modification in the core. The question is if you really need that taken into account that you can save your settings in an own node.
--- Quote from: Kazade on February 17, 2009, 11:37:57 am ---3. When I remove the "Tests" folder using project->VirtualFolderDeleted() the folder is deleted (because it's not contained in the GetVirtualFolders() list) *but* it's still displayed in the tree view. How do I refresh the tree to reflect the change?
--- End quote ---
You need to refresh the tree view, too. Hence I don't remember the name of the method atm... (no sources here, sorry...)
Just for the record: Do you have plans to release this plugin?
Kazade:
--- Quote from: MortenMacFly on February 17, 2009, 08:12:08 pm ---
--- Quote from: Kazade on February 17, 2009, 11:37:57 am ---1. Can I save a "unit_testing_enabled" flag in the project file somehow - if so, can someone point me in the right direction?
--- End quote ---
Yes - have a look at e.g. the wxSmith/envvars plugin how to do so.
--- End quote ---
Cool, I'll take a look thanks!
--- Quote from: MortenMacFly on February 17, 2009, 08:12:08 pm ---
--- Quote from: Kazade on February 17, 2009, 11:37:57 am ---2. Is there any way to specify a new build target type? (I noticed that the current list is an enum.. so I'm pretty sure I can't extend it - I can work around it if it's not possible)
--- End quote ---
No, this would require a modification in the core. The question is if you really need that taken into account that you can save your settings in an own node.
--- End quote ---
OK, thought that would be the case.
--- Quote from: MortenMacFly on February 17, 2009, 08:12:08 pm ---
--- Quote from: Kazade on February 17, 2009, 11:37:57 am ---3. When I remove the "Tests" folder using project->VirtualFolderDeleted() the folder is deleted (because it's not contained in the GetVirtualFolders() list) *but* it's still displayed in the tree view. How do I refresh the tree to reflect the change?
--- End quote ---
You need to refresh the tree view, too. Hence I don't remember the name of the method atm... (no sources here, sorry...)
--- End quote ---
Found it. ProjectManager->RebuildTree(); It's working perfectly now ;) Although it's strange that I don't need to call it after adding a virtual folder, only removing it.
--- Quote from: MortenMacFly on February 17, 2009, 08:12:08 pm ---Just for the record: Do you have plans to release this plugin?
--- End quote ---
Yes definitely, as soon as it does something useful. :)
Navigation
[0] Message Index
Go to full version