Update window.py

This commit is contained in:
2026-02-05 14:00:49 +01:00
parent 8bac02357c
commit 7bfab2ac5b

View File

@@ -233,19 +233,31 @@ class InstallerWindow(Adw.ApplicationWindow):
finish_page = Adw.StatusPage()
finish_page.set_title(message)
btn = Gtk.Button()
btn.set_halign(Gtk.Align.CENTER)
if success:
finish_page.set_icon_name("emblem-ok-symbolic")
finish_page.set_description("You can now restart your computer.")
btn_label = "Restart"
btn.set_label("Restart System")
btn.add_css_class("suggested-action")
btn.add_css_class("pill")
def on_restart(b):
import subprocess
try:
subprocess.run(["systemctl", "reboot"])
except Exception as e:
print(f"Failed to reboot: {e}")
self.close()
btn.connect("clicked", on_restart)
else:
finish_page.set_icon_name("dialog-error-symbolic")
finish_page.set_description("An error occurred during installation.")
btn_label = "Close"
btn = Gtk.Button(label=btn_label)
btn.set_halign(Gtk.Align.CENTER)
btn.add_css_class("suggested-action")
btn.connect("clicked", lambda b: self.close())
btn.set_label("Close Installer")
btn.connect("clicked", lambda b: self.close())
finish_page.set_child(btn)