provide python interpreter for mussa qui via a seperate thread
[mussa.git] / py / MussaWindow.cpp
index 9fe6b77afd69fe2d5eb71b60785ee3fcbf14650a..7d6fa8149c71a06fe5ec03346d66b44f18602799 100644 (file)
@@ -1,49 +1,12 @@
-
 #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.");
 }