-
#include <boost/python.hpp>
-#include <QApplication>
-#include <QPushButton>
-#include "alg/mussa.hpp"
-#include "qui/MussaWindow.hpp"
-
-struct gui {
- QApplication *app;
- QPushButton *b;
- MussaWindow *mw;
-
- gui() : b(0), mw(0) {
- char *argv[] = {"mussagl"};
- int argc = 1;
- app = new QApplication(argc, (char **)argv);
- Q_INIT_RESOURCE(icons);
- }
-
- void button() {
- b = new QPushButton("hi");
- b->show();
- }
-
- void mussa() {
- Mussa *analysis = new Mussa();
- mw = new MussaWindow(analysis);
- mw->show();
- }
+#include "qui/threading/GuiProxy.hpp"
- int run() {
- return app->exec();
- }
-};
+using namespace boost::python;
-void export_mussa_window()
+void export_gui_proxy()
{
- /*
- class_<MussaWindow>("MussaWindow", init<Mussa *, QObject *>)
- .def("show", &MussaWindow::show)
- ;
- */
- boost::python::class_<gui>("gui")
- .def("button", &gui::button)
- .def("mussa", &gui::mussa)
- .def("run", &gui::run)
- ;
+ def("MussaWindow", &MussaWindowProxy,
+ "Create mussa window, DO NOT access the mussa analysis after passing it to this function "
+ "the mussa analysis object is NOT thread safe.");
}