Summary page
This commit is contained in:
@@ -10,6 +10,7 @@ from .pages.partitioning import PartitioningPage, calculate_auto_partitions
|
||||
from .pages.storage import StoragePage
|
||||
from .pages.user import UserPage
|
||||
from .pages.welcome import WelcomePage
|
||||
from .pages.summary import SummaryPage
|
||||
|
||||
|
||||
class InstallerWindow(Adw.ApplicationWindow):
|
||||
@@ -70,6 +71,7 @@ class InstallerWindow(Adw.ApplicationWindow):
|
||||
self.partitioning_page = PartitioningPage()
|
||||
self.modules_page = ModulesPage()
|
||||
self.user_page = UserPage()
|
||||
self.summary_page = SummaryPage()
|
||||
|
||||
# Add Pages
|
||||
self.add_page(self.welcome_page, "welcome")
|
||||
@@ -78,6 +80,7 @@ class InstallerWindow(Adw.ApplicationWindow):
|
||||
self.add_page(self.partitioning_page, "partitioning")
|
||||
self.add_page(self.modules_page, "modules")
|
||||
self.add_page(self.user_page, "user")
|
||||
self.add_page(self.summary_page, "summary")
|
||||
|
||||
# Initialize view
|
||||
if self.page_ids:
|
||||
@@ -105,7 +108,7 @@ class InstallerWindow(Adw.ApplicationWindow):
|
||||
|
||||
self.next_button.set_sensitive(forced_selection)
|
||||
|
||||
if self.current_page_index == len(self.page_ids) - 1:
|
||||
if current_page_name == "summary":
|
||||
self.next_button.set_label("Install")
|
||||
self.next_button.add_css_class("destructive-action")
|
||||
self.next_button.remove_css_class("suggested-action")
|
||||
@@ -151,6 +154,31 @@ class InstallerWindow(Adw.ApplicationWindow):
|
||||
next_index = self.page_ids.index("partitioning")
|
||||
|
||||
if current_page_name == "user":
|
||||
# Prepare summary instead of installing immediately
|
||||
disk = self.storage_page.get_selected_disk()
|
||||
mode = self.install_mode_page.get_mode()
|
||||
modules = self.modules_page.get_modules()
|
||||
user_info = self.user_page.get_user_info()
|
||||
|
||||
partitions_config = {}
|
||||
if mode == "manual":
|
||||
partitions_config = self.partitioning_page.get_config()
|
||||
elif mode == "automatic":
|
||||
partitions = calculate_auto_partitions(disk)
|
||||
partitions_config = {"partitions": partitions}
|
||||
|
||||
# Update summary page
|
||||
self.summary_page.update_summary(
|
||||
disk_info=disk,
|
||||
mode=mode,
|
||||
partitions=partitions_config,
|
||||
user_info=user_info,
|
||||
modules=modules
|
||||
)
|
||||
# Proceed to summary page (which is next_index after user)
|
||||
|
||||
if current_page_name == "summary":
|
||||
# THIS IS THE REAL INSTALL TRIGGER
|
||||
print("Install process triggered!")
|
||||
disk = self.storage_page.get_selected_disk()
|
||||
print(f"Disk: {disk}")
|
||||
@@ -160,14 +188,14 @@ class InstallerWindow(Adw.ApplicationWindow):
|
||||
print(f"Modules: {modules}")
|
||||
user_info = self.user_page.get_user_info()
|
||||
print(f"User: {user_info}")
|
||||
|
||||
|
||||
# Recalculate or retrieve partitions just to be safe/consistent
|
||||
partitions_config = {}
|
||||
if mode == "manual":
|
||||
partitions_config = self.partitioning_page.get_config()
|
||||
elif mode == "automatic":
|
||||
partitions = calculate_auto_partitions(disk)
|
||||
partitions_config = {"partitions": partitions}
|
||||
|
||||
print(f"Partitioning: {partitions_config}")
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user