|
|
|
@ -457,7 +457,7 @@ settings.MassStorageSettings = SettingsScreen:new { |
|
|
|
|
|
|
|
|
|
local busy_text = self.content:Label { |
|
|
|
|
w = lvgl.PCT(100), |
|
|
|
|
text = "USB is currently busy. Do not unplug or remove the SD card.", |
|
|
|
|
text = "", |
|
|
|
|
long_mode = lvgl.LABEL.LONG_WRAP, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -470,7 +470,7 @@ settings.MassStorageSettings = SettingsScreen:new { |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
enable_sw:onevent(lvgl.EVENT.VALUE_CHANGED, function() |
|
|
|
|
if not usb.msc_busy:get() then |
|
|
|
|
if not usb.msc_busy:get() and not database.updating:get() then |
|
|
|
|
usb.msc_enabled:set(enable_sw:enabled()) |
|
|
|
|
end |
|
|
|
|
bind_switch() |
|
|
|
@ -484,6 +484,19 @@ settings.MassStorageSettings = SettingsScreen:new { |
|
|
|
|
else |
|
|
|
|
busy_text:add_flag(lvgl.FLAG.HIDDEN) |
|
|
|
|
end |
|
|
|
|
end), |
|
|
|
|
database.updating:bind(function(updating) |
|
|
|
|
if updating then |
|
|
|
|
busy_text:clear_flag(lvgl.FLAG.HIDDEN) |
|
|
|
|
busy_text:set { |
|
|
|
|
text = "Your database is currently updating. Please wait." |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
busy_text:add_flag(lvgl.FLAG.HIDDEN) |
|
|
|
|
busy_text:set { |
|
|
|
|
text = "USB is currently busy. Do not unplug or remove the SD card." |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
end) |
|
|
|
|
} |
|
|
|
|
end, |
|
|
|
|