Skip to content

Commit a5a4d4a

Browse files
committed
Keep advanced output box visible between steps
1 parent 9431b7e commit a5a4d4a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

openandroidinstaller/views/step_view.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def build(self):
8484

8585
# switch to enable advanced output - here it means show terminal input/output in tool
8686
def check_advanced_switch(e):
87+
logger.info(self.advanced_switch.value)
8788
"""Check the box to enable advanced output."""
8889
if self.advanced_switch.value:
8990
logger.info("Enable advanced output.")
@@ -93,14 +94,16 @@ def check_advanced_switch(e):
9394
logger.info("Disable advanced output.")
9495
self.state.advanced = False
9596
self.terminal_box.toggle_visibility()
97+
self.right_view.update()
9698

9799
self.advanced_switch = Switch(
98100
label="Advanced output",
99101
on_change=check_advanced_switch,
100102
disabled=False,
103+
value=self.state.advanced,
101104
)
102105
# text box for terminal output
103-
self.terminal_box = TerminalBox(expand=True)
106+
self.terminal_box = TerminalBox(expand=True, visible=self.state.advanced)
104107

105108
# container for progress indicators
106109
self.progress_indicator = ProgressIndicator(expand=True)
@@ -269,8 +272,9 @@ def call_to_phone(self, e, command: str):
269272

270273

271274
class TerminalBox(UserControl):
272-
def __init__(self, expand: bool = True):
275+
def __init__(self, expand: bool = True, visible: bool = False):
273276
super().__init__(expand=expand)
277+
self.visible = visible
274278

275279
def build(self):
276280
self._box = Container(
@@ -282,7 +286,7 @@ def build(self):
282286
height=300,
283287
border_radius=2,
284288
expand=True,
285-
visible=False,
289+
visible=self.visible,
286290
)
287291
return self._box
288292

@@ -299,6 +303,7 @@ def write_line(self, line: str):
299303
def toggle_visibility(self):
300304
"""Toggle the visibility of the terminal box."""
301305
self._box.visible = not self._box.visible
306+
self.visible = not self.visible
302307
self.update()
303308

304309
def clear(self):

0 commit comments

Comments
 (0)