Merge pull request #65 from bell07/pr_removable_labels

removable-app: automatically adjust labels if disk formatted
This commit is contained in:
Gerold55 2017-12-20 08:38:25 -05:00 committed by GitHub
commit e2fdd8fced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,11 +50,14 @@ laptop.register_app("removable", {
idata.label = "" -- reset label on wipe
elseif fields.format == "data" then
idata.meta:set_string("os_format", "data")
idata.label = "Data "..idata.def.description
elseif fields.format == "backup" then
idata.meta:set_string("os_format", "backup")
idata.meta:set_string("backup_data", mtos.meta:get_string('laptop_appdata'))
idata.label = "Backup of "..mtos.hwdef.description.." from "..os.date('%x')
elseif fields.format == "OldOS" then
idata.meta:set_string("os_format", "boot")
idata.label = "OldOS Boot Disk"
end
elseif fields.restore then
mtos.meta:set_string('laptop_appdata', idata.meta:get_string("backup_data"))