#endif
#include "qui/MussaWindow.hpp"
+#include "qui/threading/ThreadManager.hpp"
+#include "qui/threading/InterpreterThread.hpp"
#include "alg/parse_options.hpp"
#include "mussa_exceptions.hpp"
return 1;
}
+ ThreadManager &thread = ThreadManagerFactory();
try {
#ifdef USE_PYTHON
if (opts.runAsPythonInterpeter) {
- get_py().interpreter();
+ // allow the user to keep the interpreter open even after
+ // closing all the windows
+ app.setQuitOnLastWindowClosed(false);
+ const InterpreterThread *interp = thread.create_interpreter();
+ // quit when the interpreter exits
+ QObject::connect(interp, SIGNAL(finished()),
+ &app, SLOT(quit()));
+ app.exec();
} else
#endif /* USE_PYTHON */
if (opts.useGUI) {