News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

newb question about scripting and GetConfigManager()

Started by eyeofhell, May 02, 2008, 05:13:06 PM

Previous topic - Next topic

eyeofhell

Hello. I'm new to cb and interested to change a few settings from a script.

AFAIK, GetConfigManager().Read() and GetConfigManager().Write() allows to change cb settings loaded from default.conf XML.

Unfortunately, i can't find enough documentation in help, sources and this forum search :(

I have tried the code from one of the wizards, changing my startup.script to the following:

local n = GetConfigManager().Read(_T("/wx_project_wizard/dll"), 47);
local s = _T( "val: " ) + n;
Log( s );

that work fine, displaying value of '1' (not a default 47 i have specified).

But i can't find a way to read values outside of 'wx_project_wizard' XML branch :(. If i change code to the following:

local n = GetConfigManager().Read(_T("/astyle/STYLE"), 47);
local s = _T( "val: " ) + n;
Log( s );

it will display 47, that means that value is not read :(.

How i can write a script that will read and write any value from cb settings? For example, i'm interested in /CodeBlocksConfig/editor/colour_sets/default/cc/editor/keywords/SET1

Biplab

Actually GetConfigManager() returns all the settings under scripts section. That's the reason it returns garbage for other settings. :)
Be a part of the solution, not a part of the problem.

mandrav

Quote from: Biplab on May 02, 2008, 07:09:09 PM
Actually GetConfigManager() returns all the settings under scripts section. That's the reason it returns garbage for other settings. :)

And is actually a conscious design decision which is not going to change.
Be patient!
This bug will be fixed soon...

eyeofhell

And is it any way to change other settings from script ?

LETARTARE

With the help of a script  plugin , I try to retrieve the installation path of an executable installed in "Tool".
But 'GetManager (). Read ()' seems to give only the default.

Mandrav indicates that it will not change.

And just to read. NO?
CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'