Merge pull request #127 from catalin-ursachi/mass-storage-confirm
Add warning prompt to mass_storagemaster
commit
9a30c6667c
|
@ -11,6 +11,10 @@ import ugfx, tilda, ugfx_helper, dialogs, app, time
|
||||||
ugfx_helper.init()
|
ugfx_helper.init()
|
||||||
ugfx.clear()
|
ugfx.clear()
|
||||||
|
|
||||||
|
user_agreed = dialogs.prompt_boolean("Note: enabling mass storage is slightly risky, as the badge may end up factory "
|
||||||
|
"resetting even if you safely eject it. Do you want to continue?")
|
||||||
|
|
||||||
|
if user_agreed:
|
||||||
print("enabling USB storage...")
|
print("enabling USB storage...")
|
||||||
tilda.storage_enable_usb()
|
tilda.storage_enable_usb()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
@ -20,3 +24,5 @@ with dialogs.WaitingMessage(title="Mass Storage Enabled", text="You can now use
|
||||||
tilda.storage_disable_usb()
|
tilda.storage_disable_usb()
|
||||||
print("DONE")
|
print("DONE")
|
||||||
app.restart_to_default()
|
app.restart_to_default()
|
||||||
|
else:
|
||||||
|
app.restart_to_default()
|
||||||
|
|
Loading…
Reference in New Issue