@@ -73,7 +73,6 @@ def get_install_path():
73
73
install_path = expandhome (install_path )
74
74
return install_path
75
75
76
-
77
76
def uninstall_it (pushed ):
78
77
if (pushed ):
79
78
selected = options .selected_text ()
@@ -82,23 +81,23 @@ def uninstall_it(pushed):
82
81
if selected == 'ota_update' :
83
82
return
84
83
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 )
101
84
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 )
102
101
103
102
populate_it ()
104
103
0 commit comments