From e78d49944e820698b24c613d6c3541ff4fff9cee Mon Sep 17 00:00:00 2001 From: Dexter Reed Date: Sun, 28 Jul 2024 16:57:57 +0100 Subject: [PATCH] feat: Use AdwDialog + other newer widgets --- vanilla_installer/defaults/disk.py | 9 ++++----- vanilla_installer/defaults/welcome.py | 4 ++-- vanilla_installer/gtk/dialog-disk-confirm.ui | 20 ++++++++++---------- vanilla_installer/gtk/dialog-disk.ui | 20 ++++++++++---------- vanilla_installer/gtk/dialog-output.ui | 7 +++---- vanilla_installer/gtk/dialog-poweroff.ui | 20 +++++++------------- vanilla_installer/gtk/dialog-recovery.ui | 20 +++++++------------- vanilla_installer/gtk/dialog.ui | 20 +++++++------------- vanilla_installer/layouts/preferences.py | 3 +-- vanilla_installer/layouts/yes_no.py | 3 +-- vanilla_installer/views/done.py | 4 ++-- vanilla_installer/windows/dialog.py | 5 ++--- vanilla_installer/windows/dialog_output.py | 5 ++--- vanilla_installer/windows/dialog_poweroff.py | 7 +++---- vanilla_installer/windows/dialog_recovery.py | 5 ++--- 15 files changed, 63 insertions(+), 89 deletions(-) diff --git a/vanilla_installer/defaults/disk.py b/vanilla_installer/defaults/disk.py index 7d0e0fb0..4389981f 100644 --- a/vanilla_installer/defaults/disk.py +++ b/vanilla_installer/defaults/disk.py @@ -512,12 +512,12 @@ def __on_window_active(self, widget, value): def __on_btn_cancel_clicked(self, widget): self.__partition_selector.cleanup() - self.destroy() + self.force_close() def __on_btn_apply_clicked(self, widget): self.__parent.set_partition_recipe(self.partition_recipe) self.emit("partitioning-set", "") - self.destroy() + self.force_close() def set_btn_apply_sensitive(self, val): self.btn_apply.set_sensitive(val) @@ -553,7 +553,7 @@ def partition_recipe(self): @Gtk.Template(resource_path="/org/vanillaos/Installer/gtk/dialog-disk-confirm.ui") -class VanillaDefaultDiskConfirmModal(Adw.Window): +class VanillaDefaultDiskConfirmModal(Adw.Dialog): __gtype_name__ = "VanillaDefaultDiskConfirmModal" btn_cancel = Gtk.Template.Child() @@ -563,7 +563,6 @@ class VanillaDefaultDiskConfirmModal(Adw.Window): def __init__(self, window, partition_recipe, **kwargs): super().__init__(**kwargs) self.__window = window - self.set_transient_for(self.__window) self.default_width, self.default_height = self.get_default_size() # signals @@ -631,7 +630,7 @@ def __on_btn_cancel_clicked(self, widget): def __on_btn_apply_clicked(self, widget): self.__window.next() - self.destroy() + self.force_close() @Gtk.Template(resource_path="/org/vanillaos/Installer/gtk/default-disk.ui") diff --git a/vanilla_installer/defaults/welcome.py b/vanilla_installer/defaults/welcome.py index 2b9f6305..e17fd1f2 100644 --- a/vanilla_installer/defaults/welcome.py +++ b/vanilla_installer/defaults/welcome.py @@ -51,7 +51,7 @@ def get_finals(self): return {} def __on_recovery_clicked(self, row): - VanillaRecoveryDialog(self.__window).show() + VanillaRecoveryDialog().present(self.__window) def __on_poweroff_clicked(self, row): - VanillaPoweroffDialog(self.__window).show() + VanillaPoweroffDialog().present(self.__window) diff --git a/vanilla_installer/gtk/dialog-disk-confirm.ui b/vanilla_installer/gtk/dialog-disk-confirm.ui index 2bd4c73d..3483f15a 100644 --- a/vanilla_installer/gtk/dialog-disk-confirm.ui +++ b/vanilla_installer/gtk/dialog-disk-confirm.ui @@ -2,17 +2,17 @@ -