Skip to content

Commit 31341e2

Browse files
committed
Disable callbutton while command is running; clean error text at retry
1 parent b778487 commit 31341e2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

openandroidinstaller/views.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,8 @@ def call_to_phone(self, e, command: str):
538538
539539
Some parts of the command are changed by placeholders.
540540
"""
541+
# disable the call button while the command is running
542+
self.call_button.disabled = True
541543
# reset terminal output
542544
if self.state.advanced:
543545
self.terminal_box.content.controls = []
@@ -620,8 +622,13 @@ def call_to_phone(self, e, command: str):
620622

621623
# update the view accordingly
622624
if not success:
625+
# enable call button to retry
626+
self.call_button.disabled = False
623627
# pop the progress bar
624628
self.right_view.controls.pop()
629+
# also remove the last error text if it happened
630+
if isinstance(self.right_view.controls[-1], Text):
631+
self.right_view.controls.pop()
625632
self.right_view.controls.append(
626633
Text(
627634
f"Command {command} failed! Try again or make sure everything is setup correctly."
@@ -632,6 +639,7 @@ def call_to_phone(self, e, command: str):
632639
logger.success(f"Command {command} run successfully. Allow to continue.")
633640
# pop the progress bar
634641
self.right_view.controls.pop()
642+
# emable the confirm buton and disable the call button
635643
self.confirm_button.disabled = False
636644
self.call_button.disabled = True
637645
self.view.update()

0 commit comments

Comments
 (0)