diff options
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r-- | src/mainwindow.cc | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 784bfbb..c8036ca 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -29,11 +29,31 @@ #include "outputwindow.h" -MainWindow::MainWindow(QString program) +#include <QApplication> + +MainWindow::MainWindow(QString p) { + program = p; + + connect(&watcher, SIGNAL(fileChanged(const QString &)), + this, SLOT(reset())); + + watcher.addPath(program); + out = new OutputWindow(); out->show(); - l = new LUAScript(out); - l->addFile(program.toStdString()); + + l = new LUAScript(out, program); + + reset(); +} + +void MainWindow::reset() +{ + printf("Resetting...\n"); + out->stopScript(); + l->stopScript(); + out->reset(); l->start(); + printf("Reset done\n"); } |