| 967 | } |
| 968 | |
| 969 | void LuaExportFilter::ProcessSubs(AssFile *subs, wxWindow *export_dialog) |
| 970 | { |
| 971 | LuaStackcheck stackcheck(L); |
| 972 | |
| 973 | GetFeatureFunction("run"); |
| 974 | stackcheck.check_stack(1); |
| 975 | |
| 976 | // The entire point of an export filter is to modify the file, but |
| 977 | // setting undo points makes no sense |
| 978 | auto subsobj = new LuaAssFile(L, subs, true); |
| 979 | assert(lua_isuserdata(L, -1)); |
| 980 | stackcheck.check_stack(2); |
| 981 | |
| 982 | // config |
| 983 | if (has_config && config_dialog) { |
| 984 | int results_produced = config_dialog->LuaReadBack(L); |
| 985 | assert(results_produced == 1); |
| 986 | (void) results_produced; // avoid warning on release builds |
| 987 | // TODO, write back stored options here |
| 988 | } else { |
| 989 | // no config so put an empty table instead |
| 990 | lua_newtable(L); |
| 991 | } |
| 992 | assert(lua_istable(L, -1)); |
| 993 | stackcheck.check_stack(3); |
| 994 | |
| 995 | try { |
| 996 | LuaThreadedCall(L, 2, 0, GetName(), export_dialog, false); |
| 997 | stackcheck.check_stack(0); |
| 998 | subsobj->ProcessingComplete(); |
| 999 | } |
| 1000 | catch (agi::UserCancelException const&) { |
| 1001 | subsobj->Cancel(); |
| 1002 | throw; |
| 1003 | } |
| 1004 | } |
| 1005 | |
| 1006 | std::unique_ptr<ScriptDialog> LuaExportFilter::GenerateConfigDialog(wxWindow *parent, agi::Context *c) |
| 1007 | { |
no test coverage detected