Compare commits

..

2 Commits

Author SHA1 Message Date
f691be219d Summary page 2026-02-02 20:05:11 +01:00
281f7488af Update README.md 2026-02-02 20:03:40 +01:00
3 changed files with 126 additions and 4 deletions

View File

@@ -1,4 +1,13 @@
# Iridium OS Installer # Iridium OS Installer
> [!WARNING] > [!WARNING]
> For now this is only a mockup and not actually functional > For now this is only a mockup and not actually functional.
## What is Iridium Installer?
Iridium Installer is a modern, GTK4/Libadwaita based installer designed for Iridium OS. It aims to provide a simple and elegant installation experience.
## Features
- Modern UI using **GTK4** and **Libadwaita**
- Automatic and Manual partitioning modes
- User configuration
- Module selection

View File

@@ -0,0 +1,85 @@
import gi
gi.require_version("Gtk", "4.0")
gi.require_version("Adw", "1")
from gi.repository import Adw, Gtk
class SummaryPage(Adw.Bin):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.status_page = Adw.StatusPage()
self.status_page.set_title("Summary")
self.status_page.set_description("Review your choices before installing")
self.status_page.set_icon_name("document-save-symbolic")
self.set_child(self.status_page)
# Main content box
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.set_spacing(24)
clamp = Adw.Clamp()
clamp.set_maximum_size(600)
self.status_page.set_child(clamp)
content_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
content_box.set_spacing(24)
clamp.set_child(content_box)
# Storage and partitioning
self.storage_group = Adw.PreferencesGroup()
self.storage_group.set_title("Storage & Partitioning")
content_box.append(self.storage_group)
self.disk_row = Adw.ActionRow()
self.disk_row.set_title("Target Disk")
self.storage_group.add(self.disk_row)
self.mode_row = Adw.ActionRow()
self.mode_row.set_title("Partitioning Mode")
self.storage_group.add(self.mode_row)
# User configuration
self.user_group = Adw.PreferencesGroup()
self.user_group.set_title("User Configuration")
content_box.append(self.user_group)
self.fullname_row = Adw.ActionRow()
self.fullname_row.set_title("Full Name")
self.user_group.add(self.fullname_row)
self.username_row = Adw.ActionRow()
self.username_row.set_title("Username")
self.user_group.add(self.username_row)
self.hostname_row = Adw.ActionRow()
self.hostname_row.set_title("Hostname")
self.user_group.add(self.hostname_row)
# Software
self.software_group = Adw.PreferencesGroup()
self.software_group.set_title("Software")
content_box.append(self.software_group)
self.modules_row = Adw.ActionRow()
self.modules_row.set_title("Additional Modules")
self.software_group.add(self.modules_row)
def update_summary(self, disk_info, mode, partitions, user_info, modules):
# Update Disk
self.disk_row.set_subtitle(str(disk_info))
# Update Mode
self.mode_row.set_subtitle(mode.capitalize())
# Update User Info
self.fullname_row.set_subtitle(user_info.get("fullname", ""))
self.username_row.set_subtitle(user_info.get("username", ""))
self.hostname_row.set_subtitle(user_info.get("hostname", ""))
# Update Modules
if modules:
self.modules_row.set_subtitle(", ".join(modules))
else:
self.modules_row.set_subtitle("None")

View File

@@ -10,6 +10,7 @@ from .pages.partitioning import PartitioningPage, calculate_auto_partitions
from .pages.storage import StoragePage from .pages.storage import StoragePage
from .pages.user import UserPage from .pages.user import UserPage
from .pages.welcome import WelcomePage from .pages.welcome import WelcomePage
from .pages.summary import SummaryPage
class InstallerWindow(Adw.ApplicationWindow): class InstallerWindow(Adw.ApplicationWindow):
@@ -70,6 +71,7 @@ class InstallerWindow(Adw.ApplicationWindow):
self.partitioning_page = PartitioningPage() self.partitioning_page = PartitioningPage()
self.modules_page = ModulesPage() self.modules_page = ModulesPage()
self.user_page = UserPage() self.user_page = UserPage()
self.summary_page = SummaryPage()
# Add Pages # Add Pages
self.add_page(self.welcome_page, "welcome") 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.partitioning_page, "partitioning")
self.add_page(self.modules_page, "modules") self.add_page(self.modules_page, "modules")
self.add_page(self.user_page, "user") self.add_page(self.user_page, "user")
self.add_page(self.summary_page, "summary")
# Initialize view # Initialize view
if self.page_ids: if self.page_ids:
@@ -105,7 +108,7 @@ class InstallerWindow(Adw.ApplicationWindow):
self.next_button.set_sensitive(forced_selection) 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.set_label("Install")
self.next_button.add_css_class("destructive-action") self.next_button.add_css_class("destructive-action")
self.next_button.remove_css_class("suggested-action") self.next_button.remove_css_class("suggested-action")
@@ -151,6 +154,31 @@ class InstallerWindow(Adw.ApplicationWindow):
next_index = self.page_ids.index("partitioning") next_index = self.page_ids.index("partitioning")
if current_page_name == "user": 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!") print("Install process triggered!")
disk = self.storage_page.get_selected_disk() disk = self.storage_page.get_selected_disk()
print(f"Disk: {disk}") print(f"Disk: {disk}")
@@ -160,14 +188,14 @@ class InstallerWindow(Adw.ApplicationWindow):
print(f"Modules: {modules}") print(f"Modules: {modules}")
user_info = self.user_page.get_user_info() user_info = self.user_page.get_user_info()
print(f"User: {user_info}") print(f"User: {user_info}")
# Recalculate or retrieve partitions just to be safe/consistent
partitions_config = {} partitions_config = {}
if mode == "manual": if mode == "manual":
partitions_config = self.partitioning_page.get_config() partitions_config = self.partitioning_page.get_config()
elif mode == "automatic": elif mode == "automatic":
partitions = calculate_auto_partitions(disk) partitions = calculate_auto_partitions(disk)
partitions_config = {"partitions": partitions} partitions_config = {"partitions": partitions}
print(f"Partitioning: {partitions_config}") print(f"Partitioning: {partitions_config}")
return return