diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2012-08-23 20:23:19 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2012-08-23 20:23:19 +0200 |
commit | dcecacbf52121d6f8adf076d2cebaeec1e141339 (patch) | |
tree | 04f36b2a55f221985108c1a3d701b184ac5dc52d /src/luascript.h | |
parent | 1fc6eb2c1a8500602f2c45662dabbf164210a5b3 (diff) |
Implement automatic reset/reload when script file changes on disc.
Diffstat (limited to 'src/luascript.h')
-rw-r--r-- | src/luascript.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/luascript.h b/src/luascript.h index 448fe5e..6516611 100644 --- a/src/luascript.h +++ b/src/luascript.h @@ -34,7 +34,6 @@ #include <string> #include <map> #include <vector> -#include <QFileSystemWatcher> #include "outputwindow.h" @@ -49,25 +48,24 @@ public: std::string msg; }; - LUAScript(OutputWindow *out); + LUAScript(OutputWindow *out, QString file); ~LUAScript(); - virtual const char *name() { return ""; } - void init() throw(Exception); - - void addFile(std::string file); - void addCode(std::string code, std::string codename = ""); + void cleanup(); void run(); void runScript() throw(Exception); - std::string resultString() throw(Exception); - OutputWindow *out; -public slots: - void reload(); + void stopScript(); + + volatile bool lua_stop; + volatile bool lua_stopped; + +signals: + void reset(); protected: lua_State *L; @@ -78,8 +76,9 @@ private: int top; - QFileSystemWatcher watcher; QString file; + + bool running; }; |