Archived
This forum has been archived. Please start a new discussion on GitHub.
suggestion: Ctrl-C handler optional in Ice::Application
Hi, Ice::Application is very useful and for this reason there've been a few suggestions before on how to make it more flexible. For example, the callback function interruptCallback() was added in 3.2. Thanks for that, and here's another one
Is it possible to make the *installation* of interrupt handler optional? e.g.
Application( bool installCtrlCHandler=true );
Reason: in its current form it's not easy to use it with Qt. We can't block on communicator()->waitForShutdown() in MyApplication::run() because Qt insists on running its event loop in the main thread. So with the Ctrl-C handler installed, one can quit the GUI through the interface but NOT with Ctrl-C inside the terminal -- the expected behavior in Linux.
When buidling a Qt app, one would initialize the modified Ice::Application with a FALSE flag. Hitting Ctrl-C would then kill the GUI, not nicely but, at least, it would work.
We currently fork the standard Ice::Application and do exactly what I described but it's painful to keep this trivial code synched with Ice releases.
Thanks for consideration,
Alex
(By the way, the GUI/Ice example in Connections #12 does not use this class)
Is it possible to make the *installation* of interrupt handler optional? e.g.
Application( bool installCtrlCHandler=true );
Reason: in its current form it's not easy to use it with Qt. We can't block on communicator()->waitForShutdown() in MyApplication::run() because Qt insists on running its event loop in the main thread. So with the Ctrl-C handler installed, one can quit the GUI through the interface but NOT with Ctrl-C inside the terminal -- the expected behavior in Linux.
When buidling a Qt app, one would initialize the modified Ice::Application with a FALSE flag. Hitting Ctrl-C would then kill the GUI, not nicely but, at least, it would work.
We currently fork the standard Ice::Application and do exactly what I described but it's painful to keep this trivial code synched with Ice releases.
Thanks for consideration,
Alex
(By the way, the GUI/Ice example in Connections #12 does not use this class)
0