Author Topic: Restart 'Code::Block'  (Read 4784 times)

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 539
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Restart 'Code::Block'
« on: January 16, 2025, 07:01:48 pm »
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 :
Code
'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-13609, plugins-sdk-2.25.0 : Collector-2.4.0, AddOnForQt-4.0.0
1- Win7 Business Pack1 64bits : wx-3.2.6, gcc-14.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.6;gtk3, gcc-13.3.0,
=> !! The messages are translated by 'Deepl'

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6070
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Restart 'Code::Block'
« Reply #1 on: January 17, 2025, 05:30:13 am »
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.

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 539
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: Restart 'Code::Block'
« Reply #2 on: January 17, 2025, 09:02:43 am »
@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-13609, plugins-sdk-2.25.0 : Collector-2.4.0, AddOnForQt-4.0.0
1- Win7 Business Pack1 64bits : wx-3.2.6, gcc-14.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.6;gtk3, gcc-13.3.0,
=> !! The messages are translated by 'Deepl'

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 539
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: Restart 'Code::Block'
« Reply #3 on: January 18, 2025, 06:58:41 pm »
@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-13609, plugins-sdk-2.25.0 : Collector-2.4.0, AddOnForQt-4.0.0
1- Win7 Business Pack1 64bits : wx-3.2.6, gcc-14.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.6;gtk3, gcc-13.3.0,
=> !! The messages are translated by 'Deepl'

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7721
    • My Best Post
Re: Restart 'Code::Block'
« Reply #4 on: January 18, 2025, 08:47:08 pm »
Link found using search and wiki https://forums.codeblocks.org/index.php/topic,10360.0.html
I have never used the util.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 539
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: Restart 'Code::Block'
« Reply #5 on: January 19, 2025, 02:00:00 am »
@stahta01
Thanks, i'm going to analyze the information.
CB-13609, plugins-sdk-2.25.0 : Collector-2.4.0, AddOnForQt-4.0.0
1- Win7 Business Pack1 64bits : wx-3.2.6, gcc-14.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.6;gtk3, gcc-13.3.0,
=> !! The messages are translated by 'Deepl'