How can these be available to the user after the plugin installation?Read this (http://forums.codeblocks.org/index.php/topic,6338.msg48609.html#msg48609).
How can I set the "Make commands" and the "Using Make" attributes of the project using the project and target creation scripts?Use the script counterparts of CompileTargetBase::GetMakeCommandFor and CompileTargetBase::SetMakeCommandFor (they are basically the same both in C++ and scripts).
How can I set "Extended" (you know the ones provided by the plugins) attributes of the project using the project creation scripts?You can't. Not by scripts. These are plugin-specific sections and no generic script interface is provided for it. What are you interested in?
Read this (http://forums.codeblocks.org/index.php/topic,6338.msg48609.html#msg48609).
Use the script counterparts of CompileTargetBase::GetMakeCommandFor and CompileTargetBase::SetMakeCommandFor (they are basically the same both in C++ and scripts).
You can't. Not by scripts. These are plugin-specific sections and no generic script interface is provided for it. What are you interested in?
The first two are native, the third is an "Extended" attribute.
The <Extensions> node in the project file provides a way for plugins to store per-project attributes that are only of interest to the specific plugin.
From what I have understood, you want your plugin to know that a specific project should be "treated" by it. This is a property of your plugin and it shouldn't matter (at runtime) whether it is written inside the <Extensions> node or not. This xml node is useful only when loading a project so your plugin can see that it should "handle" this project in a special way (or whatever it is your plugin is doing).
Anyway, if you prove that reading/writing the <Extensions> node at runtime (i.e. outside project loading/saving scope) is needed/useful, it should be pretty easy to expose such functionality. For a few revisions now this node is being kept in memory throughout the project's lifetime so all it would take is expose it through the SDK API.
What I need is a way to write that xml node from a project creation wizard, I don't actually know what this will mean internally. This project creation wizard will prepare projects that are "handled" by my plugin and I need a way to set the property that tells my plugin when the respective project opens to actually handle it.
project.AddToExtensions(_T("qtworkbench/+enabled:value=true"));
<qtworkbench>
<enabled value="false" />
</qtworkbench>
project.AddToExtensions(_T("qtworkbench/+enabled:price=1"));
<qtworkbench>
<enabled value="false" />
</qtworkbench>
I can't get it to work :(
...
It seems that always the same attribute (named "value") gets set with "false"
You know what comes next don't you? I 'll ask for adding new project wizards automatically ;-)
void QtWorkbench::OnProjectLoadingHook(cbProject* project, TiXmlElement* elem, bool loading)
I 'm on to something. I have this hooked to the project load/unload:Codevoid QtWorkbench::OnProjectLoadingHook(cbProject* project, TiXmlElement* elem, bool loading)
Now when the new project wizard finishes this function get called 3 times and each time it gets called with loading = false :?. This is why I had the strange behavior all the way. When the project gets loaded the plugin checks if it should handle the project and then when the project closes it writes back (depending on the user requests) if it should handle the specific project. Now since the loading never gets the true value my plugin doesn't get the state that it should handle the project and during the project closing it always writes the false value in the project file. What I would expect:
Wizard finishes -> hook gets called with loading = true and nothing else, just resume the typical handling of an open project.