Mockup
This commit is contained in:
0
iridium_installer/ui/pages/__init__.py
Normal file
0
iridium_installer/ui/pages/__init__.py
Normal file
83
iridium_installer/ui/pages/storage.py
Normal file
83
iridium_installer/ui/pages/storage.py
Normal file
@@ -0,0 +1,83 @@
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "4.0")
|
||||
gi.require_version("Adw", "1")
|
||||
from gi.repository import Adw, Gtk
|
||||
|
||||
|
||||
class StoragePage(Adw.Bin):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
# 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_margin_top(24)
|
||||
box.set_margin_bottom(24)
|
||||
clamp.set_child(box)
|
||||
|
||||
# Title
|
||||
title = Gtk.Label(label="Installation Destination")
|
||||
title.add_css_class("title-1")
|
||||
box.append(title)
|
||||
|
||||
descr = Gtk.Label(
|
||||
label="Select the storage device where you want to install Iridium OS."
|
||||
)
|
||||
descr.set_wrap(True)
|
||||
box.append(descr)
|
||||
|
||||
# Disk List
|
||||
group = Adw.PreferencesGroup()
|
||||
group.set_title("Available Disks")
|
||||
box.append(group)
|
||||
|
||||
# Mock Disks
|
||||
disks = [
|
||||
(
|
||||
"NVMe Samsung 970 EVO (500GB)",
|
||||
"nvme0n1",
|
||||
"icon-drive-harddisk-solidstate-symbolic",
|
||||
),
|
||||
("SATA Seagate Barracuda (1TB)", "sda", "icon-drive-harddisk-symbolic"),
|
||||
]
|
||||
|
||||
self.disk_rows = []
|
||||
for name, dev, icon in disks:
|
||||
row = Adw.ActionRow()
|
||||
row.set_title(name)
|
||||
row.set_subtitle(f"/dev/{dev}")
|
||||
row.set_icon_name(icon)
|
||||
|
||||
# Radio button for selection
|
||||
if not self.disk_rows:
|
||||
radio = Gtk.CheckButton()
|
||||
self.first_radio = radio
|
||||
else:
|
||||
radio = Gtk.CheckButton()
|
||||
radio.set_group(self.first_radio)
|
||||
|
||||
radio.set_valign(Gtk.Align.CENTER)
|
||||
row.add_suffix(radio)
|
||||
row.set_activatable_widget(radio)
|
||||
|
||||
group.add(row)
|
||||
self.disk_rows.append(row)
|
||||
|
||||
# Partitioning Options
|
||||
part_group = Adw.PreferencesGroup()
|
||||
part_group.set_title("Configuration")
|
||||
box.append(part_group)
|
||||
|
||||
auto_row = Adw.ActionRow()
|
||||
auto_row.set_title("Automatic Partitioning")
|
||||
auto_row.set_subtitle("Erase disk and install Iridium")
|
||||
part_switch = Gtk.Switch()
|
||||
part_switch.set_active(True)
|
||||
part_switch.set_valign(Gtk.Align.CENTER)
|
||||
auto_row.add_suffix(part_switch)
|
||||
part_group.add(auto_row)
|
||||
65
iridium_installer/ui/pages/user.py
Normal file
65
iridium_installer/ui/pages/user.py
Normal file
@@ -0,0 +1,65 @@
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "4.0")
|
||||
gi.require_version("Adw", "1")
|
||||
from gi.repository import Adw, Gtk
|
||||
|
||||
|
||||
class UserPage(Adw.Bin):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
clamp = Adw.Clamp()
|
||||
clamp.set_maximum_size(500)
|
||||
self.set_child(clamp)
|
||||
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
box.set_spacing(24)
|
||||
box.set_margin_top(24)
|
||||
box.set_margin_bottom(24)
|
||||
clamp.set_child(box)
|
||||
|
||||
title = Gtk.Label(label="Create User Account")
|
||||
title.add_css_class("title-1")
|
||||
box.append(title)
|
||||
|
||||
# Form Group
|
||||
group = Adw.PreferencesGroup()
|
||||
box.append(group)
|
||||
|
||||
self.fullname_row = Adw.EntryRow()
|
||||
self.fullname_row.set_title("Full Name")
|
||||
group.add(self.fullname_row)
|
||||
|
||||
self.username_row = Adw.EntryRow()
|
||||
self.username_row.set_title("Username")
|
||||
group.add(self.username_row)
|
||||
|
||||
self.password_row = Adw.PasswordEntryRow()
|
||||
self.password_row.set_title("Password")
|
||||
group.add(self.password_row)
|
||||
|
||||
self.confirm_row = Adw.PasswordEntryRow()
|
||||
self.confirm_row.set_title("Confirm Password")
|
||||
group.add(self.confirm_row)
|
||||
|
||||
# Hostname
|
||||
host_group = Adw.PreferencesGroup()
|
||||
host_group.set_margin_top(12)
|
||||
box.append(host_group)
|
||||
|
||||
self.hostname_row = Adw.EntryRow()
|
||||
self.hostname_row.set_title("Hostname")
|
||||
self.hostname_row.set_text("iridium-pc")
|
||||
host_group.add(self.hostname_row)
|
||||
|
||||
# Administrator
|
||||
admin_group = Adw.PreferencesGroup()
|
||||
admin_group.set_margin_top(12)
|
||||
box.append(admin_group)
|
||||
|
||||
admin_row = Adw.SwitchRow()
|
||||
admin_row.set_title("Make this user administrator")
|
||||
admin_row.set_subtitle("Add to sudoers group")
|
||||
admin_row.set_active(True)
|
||||
admin_group.add(admin_row)
|
||||
41
iridium_installer/ui/pages/welcome.py
Normal file
41
iridium_installer/ui/pages/welcome.py
Normal file
@@ -0,0 +1,41 @@
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "4.0")
|
||||
gi.require_version("Adw", "1")
|
||||
from gi.repository import Adw, Gtk
|
||||
|
||||
|
||||
class WelcomePage(Adw.Bin):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
page = Adw.StatusPage()
|
||||
page.set_title("Welcome to Iridium OS")
|
||||
page.set_description("The future of computing is here. Let's get you set up.")
|
||||
page.set_icon_name("system-software-install-symbolic")
|
||||
|
||||
# Content Box
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
box.set_spacing(12)
|
||||
box.set_halign(Gtk.Align.CENTER)
|
||||
|
||||
lbl = Gtk.Label(label="Select your language:")
|
||||
lbl.add_css_class("heading")
|
||||
box.append(lbl)
|
||||
|
||||
# Language Dropdown
|
||||
languages = [
|
||||
"English (US)",
|
||||
"Spanish",
|
||||
"French",
|
||||
"German",
|
||||
"Japanese",
|
||||
"Chinese (Simplified)",
|
||||
]
|
||||
dropdown = Gtk.DropDown.new_from_strings(languages)
|
||||
dropdown.set_margin_bottom(20)
|
||||
box.append(dropdown)
|
||||
|
||||
page.set_child(box)
|
||||
|
||||
self.set_child(page)
|
||||
Reference in New Issue
Block a user