News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Restart 'Code::Block'

Started by LETARTARE, January 16, 2025, 07:01:48 PM

Previous topic - Next topic

LETARTARE

I found in 'cb13604' several configuration options that require a reboot.
These are
1- 'Settings->Environment...->General settings' : 2   
   - 'Allow only one running instance (will take place after restart)' 
   - 'Interprocess communication (will take place after restart)'

2- 'Settings->Environment...->View' : 1   
   - 'Internationalization (will take place after restart)'

3 'Settings->Scripting...' : any change

4- in the 'ToDo' plugin from 'settings.xrc'
     - 'Include the Todo list in the messages pane (will take place after restart)'

It would then be useful to automatically restart after user approval

My first concern was to create a 'Files->Quit (Ctrl-Q)' type menu button: 'Files->Restart (Ctrl-R)'.
To do this, modify 'src|resources|main_menu.xrc' by adding the following after the 'Quit' button

Then set up the various elements to execute the methode :
'void MainFrame::OnFileRestart(cb_unused wxCommandEvent& event)' which will close the application and restart it.

Here's a first patch to make it happen

I'll provide the automatic restart soon.
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'

ollydbg

When restart the C::B, I think you need to "remember" the environment or the command line options.

For example, when you start C::B by the "CbLauncher.exe", is has some special command line options, and the codeblocks.exe is a child process of the cblauncher.exe process.

I'm not sure how to handle those.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

LETARTARE

@ollydbg : thanks
Yes, you're right. I've never used this launch.
So I'm waiting for other opinions that can explain.

The proposed solution is based on a traditional launch with or without console mode ('CB' option on construction):
- by command without argument
- from a system-generated icon or manually
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'

LETARTARE

@ollydbg
Can you tell me how to launch 'code::blocks' with 'cblauncher' ?
If we use a launch script, this could solve the problem. In any case, the script would have to be rerun ...

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'

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

LETARTARE

@stahta01
Thanks, i'm going to analyze the information.
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'