News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

How to set a global variable configuration set as the active one at C::B start

Started by gd_on, May 23, 2024, 11:51:15 AM

Previous topic - Next topic

gd_on

I have several global variable configuration set, for example : default, set_1, set_2, ...
When I open codeblocks, look at Global Variables... I see, for example that set_1 is Active, the one selected in the scroll-down menu.
I do some work with that set_1, then choose the set_2, clic on the Save button at the bottom, do some work with set_2, always inside codeblocks. Then I close codeblocks.
When I reopen codeblocks, and look at the global variable config, I see it's still set_1 which is selected.
How to make codeblocks to keep my set_2 config as the active set after a restart. I can modify default.conf manually, of course.
I thought that the Save button at the bottom of the global variable configuration display box was for that purpose, but it's not the case apparently.
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.2, Msys2 Compilers 16.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Miguel Gimenez

Looks like swapping these two lines from uservardlgs.cpp:473 should do the trick

    m_UserVarMgr->Save();
    m_UserVarMgr->SetActiveSetName(m_CurrentSetName);

but I cannot check right now

gd_on

Effectively, with this line switch, it works as I thought it should...
Nevertheless, there is another Save() at line 471, a more global one I suppose. What does it save ?
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.2, Msys2 Compilers 16.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Miguel Gimenez

Fixed in r13524, thank you for testing.

The other Save() just collects the members of the current variable, removing the empty ones.