Add warning prompt to mass_storage
parent
42e2a5e9c2
commit
f969b16afc
|
@ -11,12 +11,18 @@ import ugfx, tilda, ugfx_helper, dialogs, app, time
|
||||||
ugfx_helper.init()
|
ugfx_helper.init()
|
||||||
ugfx.clear()
|
ugfx.clear()
|
||||||
|
|
||||||
print("enabling USB storage...")
|
user_agreed = dialogs.prompt_boolean("Note: enabling mass storage is slightly risky, as the badge may end up factory "
|
||||||
tilda.storage_enable_usb()
|
"resetting even if you safely eject it. Do you want to continue?")
|
||||||
time.sleep(1)
|
|
||||||
print("DONE")
|
if user_agreed:
|
||||||
with dialogs.WaitingMessage(title="Mass Storage Enabled", text="You can now use the badge like a USB key.\nPlease safely eject afterwards. This app will close automatically."):
|
print("enabling USB storage...")
|
||||||
print("Waiting for USB mass storage to be unmounted...")
|
tilda.storage_enable_usb()
|
||||||
tilda.storage_disable_usb()
|
time.sleep(1)
|
||||||
print("DONE")
|
print("DONE")
|
||||||
|
with dialogs.WaitingMessage(title="Mass Storage Enabled", text="You can now use the badge like a USB key.\nPlease safely eject afterwards. This app will close automatically."):
|
||||||
|
print("Waiting for USB mass storage to be unmounted...")
|
||||||
|
tilda.storage_disable_usb()
|
||||||
|
print("DONE")
|
||||||
|
app.restart_to_default()
|
||||||
|
else:
|
||||||
app.restart_to_default()
|
app.restart_to_default()
|
||||||
|
|
Loading…
Reference in New Issue