self.dynamic = false
end
+-- Define a tab for the section
+function AbstractSection.tab(self, tab, title, desc)
+ self.tabs = self.tabs or { }
+ self.tab_names = self.tab_names or { }
+
+ self.tab_names[#self.tab_names+1] = tab
+ self.tabs[tab] = {
+ title = title,
+ description = desc,
+ childs = { }
+ }
+end
+
-- Appends a new option
function AbstractSection.option(self, class, option, ...)
-- Autodetect from UVL
end
end
+-- Appends a new tabbed option
+function AbstractSection.taboption(self, tab, ...)
+
+ assert(tab and self.tabs and self.tabs[tab],
+ "Cannot assign option to not existing tab %q" % tostring(tab))
+
+ local l = self.tabs[tab].childs
+ local o = AbstractSection.option(self, ...)
+
+ if o then l[#l+1] = o end
+
+ return o
+end
+
+-- Render a single tab
+function AbstractSection.render_tab(self, tab, ...)
+
+ assert(tab and self.tabs and self.tabs[tab],
+ "Cannot render not existing tab %q" % tostring(tab))
+
+ for _, node in ipairs(self.tabs[tab].childs) do
+ node:render(...)
+ end
+end
+
-- Parse optional options
function AbstractSection.parse_optionals(self, section)
if not self.optional then