Skip to content

Commit 2bf3390

Browse files
committed
fix: partition selection now enables next button in existing mode
1 parent f1bc1fe commit 2bf3390

2 files changed

Lines changed: 50 additions & 12 deletions

File tree

‎archiso-mochios/airootfs/usr/lib/mochiinstall/mochiinstall_app.py‎

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,26 @@ def on_selection_list_selection_toggled(self, event: SelectionList.SelectionTogg
215215
hint.update("")
216216
self._nav(can_next=has_disk, next_label="next")
217217
elif self.step == 2:
218-
sel = self.query_one("#disk_mode", SelectionList)
219-
if sel.selected:
220-
self.config["disk_mode"] = sel.selected[0]
221-
self.render_step()
218+
try:
219+
mode_sel = self.query_one("#disk_mode", SelectionList)
220+
if mode_sel.selected:
221+
old_mode = self.config.get("disk_mode", "wipe")
222+
new_mode = mode_sel.selected[0]
223+
self.config["disk_mode"] = new_mode
224+
if old_mode != new_mode:
225+
self.render_step()
226+
return
227+
except Exception:
228+
pass
229+
try:
230+
root_sel = self.query_one("#existing_root", SelectionList)
231+
if root_sel.selected:
232+
self.config["existing_root"] = root_sel.selected[0]
233+
hint = self.query_one("#part_hint", Label)
234+
if hint: hint.update("")
235+
self._nav(can_next=True, next_label="next")
236+
except Exception:
237+
pass
222238

223239
def on_input_submitted(self, event: Input.Submitted) -> None:
224240
if self.step == 0:
@@ -335,10 +351,13 @@ def step_partition(self) -> None:
335351
kids.append(Static(""))
336352
kids.append(Static("[bold]select root partition for mochios:[/]"))
337353
kids.append(SelectionList(*linux_parts, id="existing_root"))
354+
has_root = bool(self.config.get("existing_root"))
355+
self._nav(can_next=has_root, next_label="next")
338356
else:
339357
kids.append(Static("[yellow]no suitable partitions found — create one first or choose wipe[/]"))
340-
341-
self._nav()
358+
self._nav(can_next=False, next_label="next")
359+
else:
360+
self._nav()
342361
self.body.mount(self._wrap(*kids))
343362

344363
def step_fs(self) -> None:

‎mochiinstall_app.py‎

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,26 @@ def on_selection_list_selection_toggled(self, event: SelectionList.SelectionTogg
215215
hint.update("")
216216
self._nav(can_next=has_disk, next_label="next")
217217
elif self.step == 2:
218-
sel = self.query_one("#disk_mode", SelectionList)
219-
if sel.selected:
220-
self.config["disk_mode"] = sel.selected[0]
221-
self.render_step()
218+
try:
219+
mode_sel = self.query_one("#disk_mode", SelectionList)
220+
if mode_sel.selected:
221+
old_mode = self.config.get("disk_mode", "wipe")
222+
new_mode = mode_sel.selected[0]
223+
self.config["disk_mode"] = new_mode
224+
if old_mode != new_mode:
225+
self.render_step()
226+
return
227+
except Exception:
228+
pass
229+
try:
230+
root_sel = self.query_one("#existing_root", SelectionList)
231+
if root_sel.selected:
232+
self.config["existing_root"] = root_sel.selected[0]
233+
hint = self.query_one("#part_hint", Label)
234+
if hint: hint.update("")
235+
self._nav(can_next=True, next_label="next")
236+
except Exception:
237+
pass
222238

223239
def on_input_submitted(self, event: Input.Submitted) -> None:
224240
if self.step == 0:
@@ -335,10 +351,13 @@ def step_partition(self) -> None:
335351
kids.append(Static(""))
336352
kids.append(Static("[bold]select root partition for mochios:[/]"))
337353
kids.append(SelectionList(*linux_parts, id="existing_root"))
354+
has_root = bool(self.config.get("existing_root"))
355+
self._nav(can_next=has_root, next_label="next")
338356
else:
339357
kids.append(Static("[yellow]no suitable partitions found — create one first or choose wipe[/]"))
340-
341-
self._nav()
358+
self._nav(can_next=False, next_label="next")
359+
else:
360+
self._nav()
342361
self.body.mount(self._wrap(*kids))
343362

344363
def step_fs(self) -> None:

0 commit comments

Comments
 (0)