Menu

#1184 Add ability to save and export and import the global variables in the global vaiiable editor

Undefined
fixed
None
Feature_Request
2023-11-10
2022-01-28
No

There is no easy way for non hard core devs IMHO to do the following for global variables:
1) Move the variables from one PC/MAC to another.
2) Backup the global variables as you want to test a new C::B install and then later add the global variables back.

You can manually modify the config or copy/paste the data that you have saved somewhere or potentially use the cb_share_config.exe to save/update the info, but this is time consuming when testing or having to change setups for dev purposes.

Also at the same time as adding the export/import it would be very nice to add a save button as the config is not updated until you cleanly exit C::B, but if C::B crashes due to changes you are working on then you have to enter the variables again. Sometimes you want to change a variable and test it before saving, so auto saving on clicking on the "OK" button is not a good idea as then people will request that the auto save be disabled.

Discussion

  • Andrew Cottrell

    Andrew Cottrell - 2022-01-29

    Example of what the dialog could look like is attached.

     
  • Andrew Cottrell

    Andrew Cottrell - 2022-01-30

    P.O.C updated files are attached.

    This is my global variables used in my local CB source tree build that I have exported and imported using the attached files:

    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <CodeBlocksGlobalVariableExportConfig version="1">
        <default>
            <wxwidgets>
                <BASE>D:\Andrew_Development\Libraries\wxWidgets-3.1.5</BASE>
                <INCLUDE>$(#WXWIDGETS)\include</INCLUDE>
                <LIB>$(#WXWIDGETS)\lib</LIB>
                <WX_CFG>&quot;&quot;</WX_CFG>
                <WX_VERSION>31</WX_VERSION>
                <WX_SUFFIX>u</WX_SUFFIX>
            </wxwidgets>
            <discount>
                <BASE>D:\Andrew_Development\Libraries\discount</BASE>
                <INCLUDE>$(#DISCOUNT)</INCLUDE>
                <LIB>$(#DISCOUNT)</LIB>
            </discount>
            <cb_build>
                <BASE>D:\Andrew_Development\Work_Installers\AC-WindowsInstaller\src</BASE>
                <INCLUDE>$(#CB_BUILD)\include</INCLUDE>
                <CFLAGS>-g -O0 -ggdb</CFLAGS>
                <OSBITS>64</OSBITS>
                <CPP_STD>gnu++17</CPP_STD>
            </cb_build>
            <boost>
                <BASE>D:\Andrew_Development\Libraries\boost</BASE>
                <INCLUDE>$(#BOOST)</INCLUDE>
            </boost>
        </default>
    </CodeBlocksGlobalVariableExportConfig>
    
     

    Last edit: Andrew Cottrell 2022-01-30
  • Morten MacFly

    Morten MacFly - 2022-01-30

    Are you aware that you can save and share/load literally any type of setting using the cb_share_config tool? It ships with C::B. There is no need to integrate this into the core. Because then you should integrate saving dedicated settings in many places which completely clutters such functionality.

     
    • Andrew Cottrell

      Andrew Cottrell - 2022-01-30

      In my request I wrote "or potentially use the cb_share_config.exe to save/update the info".

       
  • Morten MacFly

    Morten MacFly - 2022-01-30
    • status: open --> pending
    • assigned_to: Morten MacFly
     
  • Morten MacFly

    Morten MacFly - 2022-01-30

    My proposal would be to automise the cb_share_config tool using the command line such that you can call it with specific parameters to dump current settings. Then you could embed it a s tool and save whatever you want at any time.

     
    • Andrew Cottrell

      Andrew Cottrell - 2022-01-31

      With my POC and a number of other ticket changes with some that may get rejected I can build CB for either win32 or win64 using a single batch file, currently one config file and manually changing the GCC compiler from C:\mys64\mingw32 to/from C:\mys64\mingw64. Currently I manually change the batch file to swap between either 32 or 64 builds, but this will change in the next day or two as I will parameterize the option.

      The following is the relevant batch file snippets for the build that are used to change between win32 and win64 CB builds:

      @rem set BUILD_BITS=32
      set BUILD_BITS=64
      
      "C:\Program Files\CodeBlocks\codeblocks.exe" -no-dde --multiple-instance --debug-log --verbose --log-to-file --debug-log-to-file --no-splash-screen --variable-set=cb_win%BUILD_BITS% --target=All --build "CodeBlocks_wx31_64.workspace"
      

      NOTES:
      1) The CodeBlocks_wx31_64.workspace dependent project files have been modified for the updated/new global environment variables.
      2) The new "--variable-set" parameter changes the global variable set used by the batch build. I expect that you will reject this, so if you think it will be allowed into the trunk I will create a ticket for it.
      3) I still need to manually change the gcc compiler settings from 32 to 64 bit settings. I know this can be effectively done via the personality parameter, but keeping the two configs in SYNC during the dev/build/change/update process IMHO will not be easy and is prone to problems cropping up. I need to think how this process can be streamlined if possible to ensure that the dev does not go bananas having to keep two config files up to date and in sync.
      4) I have also got wxWidget building via a similar method w.r.t. changing a BUILD_BITS from 32 to 64.
      5) I have been working on removing the batch build GUI dialog, but it is not working yet.
      6) Once all of the bits come together and flow correctly I hope that building a windows CB release can be done via a CI process. So far spent 9 months on this with I guess about 50% of my time spent dealing with trying to get patches into the trunk or updating files that are banked up due to dependent changes that are in tickets that are waiting for someone to look at the patch in the ticket.

       
  • bluehazzard

    bluehazzard - 2022-01-30

    Have a look at this https://github.com/bluehazzard/codeblocks_sf/tree/rework/move_global_var_diag_to_src%2F1

    here i have reimplemented the user var dialog, to add a save button, because i really hate that there is no cancel button in this dialog. I think it is more user friendly to have a "save" and "cancel" button....

    I will make a official ticket an patch after i have removed the auto words in the code

     
  • Miguel Gimenez

    Miguel Gimenez - 2022-01-31

    @bluehazzard, your new xrc file has <minpanesize> property for wxSplitterWindow, it should be changed to <minsize> so the XRC works OK (see wxWidgets XRC specification and commit [r12685]).

    EDIT: used code tags to avoid XML garbage.

     

    Related

    Commit: [r12685]


    Last edit: Miguel Gimenez 2022-01-31
  • Andrew Cottrell

    Andrew Cottrell - 2022-02-24

    Latest patch attached. The patch also includes increasing the number of user variables from 7 to 8 so the GUI looks nicer.

     
  • Morten MacFly

    Morten MacFly - 2022-04-15

    So, to come a step further here:

    I think you are missing that you can easily specify the configuration file you want to use for C::B, thus, you can have many complete different configs for C::B. That also means, you can easily have misc. sets / options for 32 or 64 bit. So this functionality you are seeking is already present.

    Could you clarify again why exactly you want to import/export global var sets (only)? Because (for example) the -m32 an -m64 switch of the compiler could raise other conflicts...?!

    I am asking seriously to understand better what is actually missing that you are trying to solve.

     
    • Andrew Cottrell

      Andrew Cottrell - 2022-07-02

      I can clarify till the cows come home, but have you tried to understand the following:

      1. What the problem is from the initial post?
      2. Have you looked at the changes to see if they resolve the problem in the initial post?
      3. If you have a problem with the problem in the initial post then have you though about what the issue is and what you can do to understand what the issue is before responding?
       
  • Miguel Gimenez

    Miguel Gimenez - 2023-11-10
    • status: pending --> fixed
     

Log in to post a comment.

MongoDB Logo MongoDB