3333
3434from views import BaseView
3535from app_state import AppState
36- from tooling import adb_twrp_install_addons
36+ from tooling import adb_twrp_install_addons , adb_reboot
3737from widgets import (
3838 confirm_button ,
3939 get_title ,
@@ -158,16 +158,22 @@ def run_install_addons(self, e):
158158 self .right_view .update ()
159159
160160 # run the install script
161- for line in adb_twrp_install_addons (
162- addons = self .state .addon_paths ,
163- bin_path = self .state .bin_path ,
164- is_ab = self .state .config .is_ab ,
165- ):
166- # write the line to advanced output terminal
167- self .terminal_box .write_line (line )
168- # in case the install command is run, we want to update the progress bar
169- self .progress_indicator .display_progress_bar (line )
170- self .progress_indicator .update ()
161+ if self .state .addon_paths :
162+ for line in adb_twrp_install_addons (
163+ addons = self .state .addon_paths ,
164+ bin_path = self .state .bin_path ,
165+ is_ab = self .state .config .is_ab ,
166+ ):
167+ # write the line to advanced output terminal
168+ self .terminal_box .write_line (line )
169+ # in case the install command is run, we want to update the progress bar
170+ self .progress_indicator .display_progress_bar (line )
171+ self .progress_indicator .update ()
172+ else :
173+ logger .info ("No addons selected. Rebooting to OS." )
174+ for line in adb_reboot (bin_path = self .state .bin_path ):
175+ # write the line to advanced output terminal
176+ self .terminal_box .write_line (line )
171177 success = line # the last element of the iterable is a boolean encoding success/failure
172178
173179 # update the view accordingly
@@ -177,7 +183,7 @@ def run_install_addons(self, e):
177183 # also remove the last error text if it happened
178184 self .error_text .value = "Installation failed! Try again or make sure everything is setup correctly."
179185 else :
180- sleep (5 ) # wait to make sure everything is fine
186+ sleep (4 ) # wait to make sure everything is fine
181187 logger .success ("Installation process was successful. Allow to continue." )
182188 # enable the confirm button and disable the call button
183189 self .confirm_button .disabled = False
0 commit comments