summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2009-12-25 21:03:28 +0100
committerPixel <pixel@nobis-crew.org>2009-12-25 21:03:28 +0100
commitc267d9769c2bf5fd56684b51b7e90f1d7093614c (patch)
tree87c8e0a3878aee884a8df1a9c066d3d70b4ff963
parent4a5125c1ccb121bfe739c26926fe8ed7de634d32 (diff)
Switching template generation to a more generic system.
-rw-r--r--dalos-luafilter.lua7
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