Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
External application end event
LETARTARE:
1- The only event that handles the termination of an executable in 'CB' is
--- Quote ---'cbEVT_PIPEDPROCESS_TERMINATED'.
--- End quote ---
2- in 'ToolsManager::Execute(...)' then you have to use the option
--- Quote ---'LAUNCH_VISIBLE' to use a 'PipedProcess'
--- End quote ---
3- then the event ending is reserved for the parent in
--- Code: ---'PipedProcess::OnTerminate(...)'
--- End code ---
by
--- Code: ---'wxPostEvent(m_Parent, event)'
--- End code ---
4- I then added
--- Code: ---'Manager::Get()->ProcessEvent(event)'
--- End code ---
and I can get this event from a 'CB' plugin.
But I don't know if there are side effects, and if this modification is possible in 'CB' !
What do you think?
Pecan:
--- Quote from: LETARTARE on May 25, 2022, 01:53:05 pm ---Is there an event that signals to 'CB' the end of an external application launched from the 'Tools' menu?
explanation : I launch 'Poedit' from the 'Tools' menu and I would like to be warned in 'CB' of its closing.
--- End quote ---
You could run your own wrapper program from the tools menu that wxExecutes then waits for the poedit process. Just the fact that it returned means that poedit ended.
It also gives you control over return codes from poedit and the ability to start/stop subsequent programs.
LETARTARE:
@Pecan :Thanks
I will try this track.
BlueHazzard:
Also, do the files exists, or are they generated by po edit?
I would need some event handling about changes in files. And i am willing to work on this...
LETARTARE:
In the 1st solution I had added
--- Quote --- 'Manager::Get()->ProcessEvent(event)'
--- End quote ---
to
--- Quote ---'PipedProcess::OnTerminate(...)'
--- End quote ---
In a 2nd solution I added
--- Quote ---'Manager::Get()->ProcessEvent(event)'
--- End quote ---
at the end of
--- Quote ---'ToolsManager::OnToolTerminated(CodeBlocksEvent& event)'
--- End quote ---
Both work well for me.
In the plugin 'CB' I proposed in 'https://github.com/LETARTARE/CB_Collector' :
1- I generated the file 'project_name.po' in the 'CB' editor,
2- I call by program the menu 'Tools->Poedit' with parameter 'project_name.po'
3- from 'Poedit, I translate strings then i create 'project_name.mo' and quit
4- on return,
- if I have translated strings, I get a warning from 'CB' to reload 'project_name.po' which has been
modified : I reload
- otherwise nothing to do
5- I want to be notified when 'Poedit' is closed to copy the file ''project_name.po'' to another directory
Actually, I use 'cbEVT_EDITOR_MODIFIED' but it is not satisfactory.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version