From 174c17309b2b494af71834ff09e2bf18162627bf Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Tue, 28 Jul 2009 15:39:52 +0000 Subject: [PATCH] Remove progress dialogue and threaded call from Auto4 Lua export filter config dialogue production call. This somewhat breaks an undocumented part of the API but I don't think anything relies on this. Should close #927. Originally committed to SVN as r3307. --- aegisub/src/auto4_lua.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/aegisub/src/auto4_lua.cpp b/aegisub/src/auto4_lua.cpp index 2820c9568..8b7cccc32 100644 --- a/aegisub/src/auto4_lua.cpp +++ b/aegisub/src/auto4_lua.cpp @@ -732,23 +732,16 @@ namespace Automation4 { // stored options lua_newtable(L); // TODO, nothing for now - LuaProgressSink *ps = new LuaProgressSink(L, 0, false); - ps->SetTitle(GetName()); - // do call - LuaThreadedCall call(L, 2, 1); - - ps->ShowModal(); - wxThread::ExitCode code = call.Wait(); - - delete ps; - - - if (!code) { - // The config dialog table should now be on stack as LuaConfigDialog constructor expects - return config_dialog = new LuaConfigDialog(L, false); - } else { + int err = lua_pcall(L, 2, 1, 0); + if (err) { + wxString errmsg(lua_tostring(L, -1), wxConvUTF8); + wxLogWarning(_T("Runtime error in Lua macro validation function:\n%s"), errmsg.c_str()); + lua_pop(L, 1); // remove error message return config_dialog = 0; + } else { + // Create config dialogue from table on top of stack + return config_dialog = new LuaConfigDialog(L, false); } }