Skip to content
This repository was archived by the owner on Oct 28, 2023. It is now read-only.

Commit 568a644

Browse files
committed
Use async dialog API to make uninstalling work
1 parent 30f7bdb commit 568a644

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

esp32/modules/launcher.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ def get_install_path():
7373
install_path = expandhome(install_path)
7474
return install_path
7575

76-
7776
def uninstall_it(pushed):
7877
if (pushed):
7978
selected = options.selected_text()
@@ -82,23 +81,23 @@ def uninstall_it(pushed):
8281
if selected == 'ota_update':
8382
return
8483
options.destroy()
85-
import dialogs
86-
print(selected)
87-
uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % selected)
88-
print(uninstall)
89-
if uninstall:
90-
ugfx.clear(ugfx.BLACK)
91-
ugfx.string_box(0, 25, 296, 25,"Uninstalling:","Roboto_BlackItalic24",ugfx.WHITE, ugfx.justifyCenter)
92-
ugfx.string_box(0, 51, 296, 23, selected, "PermanentMarker22", ugfx.WHITE, ugfx.justifyCenter)
93-
ugfx.flush()
94-
install_path = get_install_path()
95-
for rm_file in os.listdir("%s/%s" % (install_path, selected)):
96-
os.remove("%s/%s/%s" % (install_path, selected, rm_file))
97-
os.rmdir("%s/%s" % (install_path, selected))
98-
badge.eink_busy_wait()
99-
esp.rtcmem_write_string('launcher')
100-
esp.start_sleeping(1)
10184

85+
def perform_uninstall(ok):
86+
if ok:
87+
ugfx.clear(ugfx.BLACK)
88+
ugfx.string_box(0, 25, 296, 25,"Uninstalling:","Roboto_BlackItalic24",ugfx.WHITE, ugfx.justifyCenter)
89+
ugfx.string_box(0, 51, 296, 23, selected, "PermanentMarker22", ugfx.WHITE, ugfx.justifyCenter)
90+
ugfx.flush()
91+
install_path = get_install_path()
92+
for rm_file in os.listdir("%s/%s" % (install_path, selected)):
93+
os.remove("%s/%s/%s" % (install_path, selected, rm_file))
94+
os.rmdir("%s/%s" % (install_path, selected))
95+
badge.eink_busy_wait()
96+
esp.rtcmem_write_string('launcher')
97+
esp.start_sleeping(1)
98+
99+
import dialogs
100+
uninstall = dialogs.prompt_boolean('Are you sure you want to remove %s?' % selected, cb=perform_uninstall)
102101

103102
populate_it()
104103

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy