From 7c899b8e86c9b768cb9cf8dccf22014c386b4d07 Mon Sep 17 00:00:00 2001 From: N0VA Date: Mon, 2 Feb 2026 15:03:30 +0100 Subject: [PATCH] Can't continue without selecting disk --- iridium_installer/ui/pages/storage.py | 3 +- iridium_installer/ui/window.py | 41 ++++++++++++++++++--------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/iridium_installer/ui/pages/storage.py b/iridium_installer/ui/pages/storage.py index be1cb60..65ef59c 100644 --- a/iridium_installer/ui/pages/storage.py +++ b/iridium_installer/ui/pages/storage.py @@ -68,8 +68,7 @@ class StoragePage(Adw.Bin): if not self.first_radio: radio = Gtk.CheckButton() self.first_radio = radio - # Default selection - self.selected_disk = dev + # No default selection to force user interaction, for safety reasons else: radio = Gtk.CheckButton() radio.set_group(self.first_radio) diff --git a/iridium_installer/ui/window.py b/iridium_installer/ui/window.py index ba5e59f..dc23e6d 100644 --- a/iridium_installer/ui/window.py +++ b/iridium_installer/ui/window.py @@ -4,6 +4,7 @@ gi.require_version("Gtk", "4.0") gi.require_version("Adw", "1") from gi.repository import Adw, Gtk +from .pages.additional_modules import ModulesPage from .pages.install_mode import InstallModePage from .pages.partitioning import PartitioningPage, calculate_auto_partitions from .pages.storage import StoragePage @@ -66,6 +67,7 @@ class InstallerWindow(Adw.ApplicationWindow): self.storage_page = StoragePage() self.install_mode_page = InstallModePage() self.partitioning_page = PartitioningPage() + self.modules_page = ModulesPage() self.user_page = UserPage() # Add Pages @@ -73,6 +75,7 @@ class InstallerWindow(Adw.ApplicationWindow): self.add_page(self.storage_page, "storage") self.add_page(self.install_mode_page, "install_mode") self.add_page(self.partitioning_page, "partitioning") + self.add_page(self.modules_page, "modules") self.add_page(self.user_page, "user") # Initialize view @@ -99,21 +102,20 @@ class InstallerWindow(Adw.ApplicationWindow): def on_back_clicked(self, button): current_page = self.page_ids[self.current_page_index] - prev_page = self.page_ids[self.current_page_index - 1] + + # Default: go back one page + next_prev_index = self.current_page_index - 1 - if current_page == "user": + if current_page == "modules": mode = self.install_mode_page.get_mode() if mode == "automatic": - # Skip partitioning - self.current_page_index = self.page_ids.index("install_mode") - else: - self.current_page_index -= 1 - else: - if self.current_page_index > 0: - self.current_page_index -= 1 + # Skip partitioning (which is immediately before modules) + next_prev_index = self.page_ids.index("install_mode") - self.stack.set_visible_child_name(self.page_ids[self.current_page_index]) - self.update_buttons() + if next_prev_index >= 0: + self.current_page_index = next_prev_index + self.stack.set_visible_child_name(self.page_ids[self.current_page_index]) + self.update_buttons() def on_next_clicked(self, button): # Logic before transition @@ -121,8 +123,17 @@ class InstallerWindow(Adw.ApplicationWindow): if current_page_name == "storage": selected_disk = self.storage_page.get_selected_disk() - if selected_disk: - self.partitioning_page.load_partitions(selected_disk) + if not selected_disk: + dialog = Adw.MessageDialog( + transient_for=self, + heading="No Disk Selected", + body="Please select a storage device to proceed." + ) + dialog.add_response("ok", "OK") + dialog.present() + return + + self.partitioning_page.load_partitions(selected_disk) next_index = self.current_page_index + 1 @@ -130,7 +141,7 @@ class InstallerWindow(Adw.ApplicationWindow): mode = self.install_mode_page.get_mode() if mode == "automatic": # Skip partitioning page - next_index = self.page_ids.index("user") + next_index = self.page_ids.index("modules") else: # Go to partitioning page next_index = self.page_ids.index("partitioning") @@ -141,6 +152,8 @@ class InstallerWindow(Adw.ApplicationWindow): print(f"Disk: {disk}") mode = self.install_mode_page.get_mode() print(f"Mode: {mode}") + modules = self.modules_page.get_modules() + print(f"Modules: {modules}") partitions_config = {} if mode == "manual":