From f9a09e6fe4d8bd7743a7530d9ef3e848f5a373fe Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 3 Aug 2015 15:54:48 +0000 Subject: Modify logfile to use common view --- vlc-model.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'vlc-model.lua') diff --git a/vlc-model.lua b/vlc-model.lua index 5a8da68..abad8a9 100644 --- a/vlc-model.lua +++ b/vlc-model.lua @@ -41,16 +41,17 @@ function mymodule.getconfigfile() return modelfunctions.getfiledetails(configfile) end -function mymodule.getlogfile () - local path=logfile - local path2 +function mymodule.get_logfile(self, clientdata) + local retval = cfe({ type="group", value={}, label="Log File Configuration" }) + retval.value.filename = cfe({value=logfile, label="File name"}) + local path if fs.is_file(configfile) then for line in string.gmatch(fs.read_file(configfile) or "", "(.-)\n") do - path2=string.match(line,"^VLC_OPTS.*--logfile%s+(%S+)") or path2 + path=string.match(line,"^VLC_OPTS.*--logfile%s+(%S+)") or path end end - if path2 then path=path2 end - return cfe({ value=path, label="VLC logfile" }) + if path then retval.value.filename.value = path end + return retval end function mymodule.setconfigfile(self, filedetails) -- cgit v1.2.3