From 3bff26928a014fbc8e39780501ec33e7d530d0b8 Mon Sep 17 00:00:00 2001 From: N0VA Date: Mon, 2 Feb 2026 14:59:20 +0100 Subject: [PATCH] Create additional_modules.py --- .../ui/pages/additional_modules.py | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 iridium_installer/ui/pages/additional_modules.py diff --git a/iridium_installer/ui/pages/additional_modules.py b/iridium_installer/ui/pages/additional_modules.py new file mode 100644 index 0000000..196ab80 --- /dev/null +++ b/iridium_installer/ui/pages/additional_modules.py @@ -0,0 +1,92 @@ +import gi + +gi.require_version("Gtk", "4.0") +gi.require_version("Adw", "1") +from gi.repository import Adw, Gtk + + +class ModulesPage(Adw.Bin): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + self.nvidia_drivers = False + self.chromebook_audio = False + self.android_apps = False + + # Main Layout + clamp = Adw.Clamp() + clamp.set_maximum_size(600) + self.set_child(clamp) + + box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) + box.set_spacing(24) + box.set_valign(Gtk.Align.CENTER) + box.set_margin_top(24) + box.set_margin_bottom(24) + clamp.set_child(box) + + # Title + title = Gtk.Label(label="Additional Modules") + title.add_css_class("title-1") + box.append(title) + + descr = Gtk.Label( + label="Select additional components you would like to install. (Internet connection required)" + ) + descr.set_wrap(True) + box.append(descr) + dont_worry = Gtk.Label(label="Don't worry, you can always install them later.") + dont_worry.set_wrap(True) + box.append(dont_worry) + + # Preferences Group + self.modules_group = Adw.PreferencesGroup() + self.modules_group.set_title("Optional Features") + box.append(self.modules_group) + + # NVIDIA Drivers + self.add_module_row( + "NVIDIA Proprietary Drivers", + "Install proprietary drivers for NVIDIA graphics cards for better performance.", + "nvidia_drivers", + ) + + # Chromebook Audio + self.add_module_row( + "Chromebook Audio Fixes", + "Install additional audio drivers for Chromebook devices.", + "chromebook_audio", + ) + + # Android Apps + self.add_module_row( + "Android Apps Support", + "Install Waydroid to run Android applications on Iridium OS.", + "android_apps", + ) + + def add_module_row(self, title, subtitle, attr_name): + row = Adw.ActionRow() + row.set_title(title) + row.set_subtitle(subtitle) + + switch = Gtk.Switch() + switch.set_valign(Gtk.Align.CENTER) + # Set initial state + switch.set_active(getattr(self, attr_name)) + + # Connect signal + switch.connect("notify::active", self.on_switch_toggled, attr_name) + + row.add_suffix(switch) + self.modules_group.add(row) + + def on_switch_toggled(self, switch, gparam, attr_name): + setattr(self, attr_name, switch.get_active()) + + def get_modules(self): + return { + "nvidia_drivers": self.nvidia_drivers, + "chromebook_audio": self.chromebook_audio, + "android_apps": self.android_apps, + }