From dcecacbf52121d6f8adf076d2cebaeec1e141339 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 23 Aug 2012 20:23:19 +0200 Subject: Implement automatic reset/reload when script file changes on disc. --- src/luascript.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/luascript.h') 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 #include #include -#include #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; }; -- cgit v1.2.3