Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
New scripts through plugin installation
mandrav:
--- Quote from: yop on August 06, 2007, 01:06:14 pm ---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.
--- End quote ---
OK, now I get what you want :).
Let me think about it for a while and get back to you.
mandrav:
Update your C::B working copy and look for cbProject::AddToExtensions() [documented].
You should use it inside your script's SetupProject(theproject)...
yop:
I can't get it to work :(
In the script I have
--- Code: ---project.AddToExtensions(_T("qtworkbench/+enabled:value=true"));
--- End code ---
and I get in the cbp file
--- Code: ---<qtworkbench>
<enabled value="false" />
</qtworkbench>
--- End code ---
then I changed in the script to set a different attribute (just for testing) and I got the exact same results:
--- Code: ---project.AddToExtensions(_T("qtworkbench/+enabled:price=1"));
--- End code ---
output:
--- Code: ---<qtworkbench>
<enabled value="false" />
</qtworkbench>
--- End code ---
It seems that always the same attribute (named "value") gets set with "false"
mandrav:
--- Quote from: yop on October 03, 2007, 12:55:41 am ---I can't get it to work :(
...
It seems that always the same attribute (named "value") gets set with "false"
--- End quote ---
Works For Me (tm) ;)
Seriously, I just tried it and it worked fine. Have a look at the code if you want. It's in cbproject.cpp, line 1978. You will see that there is no hardcoded "value" or "false" there (why would there be?).
My guess is that the script you 're editing is NOT the one actually ran by the wizard. Are you sure you 're editing the correct script?
yop:
I 'll check again, probably I did something wrong. The strange thing is that I never AFAIR set this thing to false either editing the correct script or not. Where on earth could it get it? Anyway I 'll check again...
As a side note many congratulations on the scripting facilities. They are impresive :-)
You know what comes next don't you? I 'll ask for adding new project wizards automatically ;-)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version