diff options
-rw-r--r-- | dalos-luafilter.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/dalos-luafilter.lua b/dalos-luafilter.lua index c0b307e..0d83fb4 100644 --- a/dalos-luafilter.lua +++ b/dalos-luafilter.lua @@ -104,12 +104,16 @@ end self.extra.code = data.template.code end, + gen_template = function (self) + return { code = self.extra.close } + end, + configure = function (self) local okay = false local text = iup.text { multiline = "Yes", font = "Courier", expand = "Yes", value = self.extra.code } local bok = iup.button { title = "Ok", action = function () okay = true return iup.CLOSE end } local bimport = iup.button { title = "Import", action = function() self:load_template() return iup.CLOSE end } - local bexport = iup.button { title = "Export", action = function() self:save_template{ code = self.extra.code } end } + local bexport = iup.button { title = "Export", action = function() self:save_template(self:gen_template()) end } local bcancel = iup.button { title = "Cancel", action = function () okay = false return iup.CLOSE end } local dlg = iup.dialog { iup.vbox { text, iup.hbox { bok, bimport, bexport, iup.fill{}, bcancel, normalizesize = "Horizontal" } }, title = "Code for " .. self.name, size = "600x300" } local r = dlg:popup() @@ -148,6 +152,7 @@ end obj.load_code = dalosp.luafilter.load_code obj.run_in_localenv = dalosp.luafilter.run_in_localenv obj.load_template = dalosp.luafilter.load_template + obj.gen_template = dalosp.luafilter.gen_template obj:load_code(extra.code) return obj |