Author Topic: newb question about scripting and GetConfigManager()  (Read 4754 times)

eyeofhell

  • Guest
newb question about scripting and GetConfigManager()
« on: May 02, 2008, 05:13:06 pm »
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

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: newb question about scripting and GetConfigManager()
« Reply #1 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. :)
Be a part of the solution, not a part of the problem.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: newb question about scripting and GetConfigManager()
« Reply #2 on: May 02, 2008, 10:32:19 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

  • Guest
Re: newb question about scripting and GetConfigManager()
« Reply #3 on: May 03, 2008, 12:56:40 am »
And is it any way to change other settings from script ?

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 563
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: newb question about scripting and GetConfigManager()
« Reply #4 on: February 02, 2012, 12:20:31 pm »
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-13670, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-4.1.5
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-14.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3, gcc-13.3.0,
=> !! The messages are translated by 'Deepl'