From 79d9d8d904df4b56e6204a523541a952b750ffc5 Mon Sep 17 00:00:00 2001 From: axtloss Date: Tue, 19 Jul 2022 16:17:25 +0200 Subject: [PATCH] Add final page ui is now actually finished --- .../scalable/apps/al.getcryst.jadegui.svg | 189 ++++++------------ .../scalable/apps/al.getcyrst.jadegui.svg | 130 ------------ src/functions/finished_screen.py | 29 +++ src/functions/meson.build | 1 + src/jade_gui.gresource.xml | 1 + src/meson.build | 1 + src/pages/finished_screen.blp | 31 +++ src/window.py | 5 +- 8 files changed, 127 insertions(+), 260 deletions(-) delete mode 100644 data/icons/hicolor/scalable/apps/al.getcyrst.jadegui.svg create mode 100644 src/functions/finished_screen.py create mode 100644 src/pages/finished_screen.blp diff --git a/data/icons/hicolor/scalable/apps/al.getcryst.jadegui.svg b/data/icons/hicolor/scalable/apps/al.getcryst.jadegui.svg index a74c4df..c373ead 100644 --- a/data/icons/hicolor/scalable/apps/al.getcryst.jadegui.svg +++ b/data/icons/hicolor/scalable/apps/al.getcryst.jadegui.svg @@ -1,130 +1,61 @@ - - - - - - - - - - - - - - image/svg+xml - - - - - - - - application-x-executable - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/icons/hicolor/scalable/apps/al.getcyrst.jadegui.svg b/data/icons/hicolor/scalable/apps/al.getcyrst.jadegui.svg deleted file mode 100644 index a74c4df..0000000 --- a/data/icons/hicolor/scalable/apps/al.getcyrst.jadegui.svg +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - image/svg+xml - - - - - - - - application-x-executable - - - - - - - - - - - - - - - - diff --git a/src/functions/finished_screen.py b/src/functions/finished_screen.py new file mode 100644 index 0000000..bb12688 --- /dev/null +++ b/src/functions/finished_screen.py @@ -0,0 +1,29 @@ +# desktop_screen.py + +# +# Copyright 2022 user + +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +from gi.repository import Gtk, Adw +from gettext import gettext as _ + +@Gtk.Template(resource_path='/al/getcryst/jadegui/pages/finished_screen.ui') +class FinishedScreen(Adw.Bin): + __gtype_name__='FinishedScreen' + + def __init__(self, window, application, **kwargs): + super().__init__(**kwargs) diff --git a/src/functions/meson.build b/src/functions/meson.build index 6fda66e..8d5a230 100644 --- a/src/functions/meson.build +++ b/src/functions/meson.build @@ -11,5 +11,6 @@ jade_gui_sources = [ 'partition_screen.py', 'summary_screen.py', 'install_screen.py', + 'finished_screen.py', ] install_data(jade_gui_sources, install_dir: functionsdir) \ No newline at end of file diff --git a/src/jade_gui.gresource.xml b/src/jade_gui.gresource.xml index 309c81e..6962c6a 100644 --- a/src/jade_gui.gresource.xml +++ b/src/jade_gui.gresource.xml @@ -15,6 +15,7 @@ pages/partition_screen.ui pages/summary_screen.ui pages/install_screen.ui + pages/finished_screen.ui gtk/help-overlay.ui crystal-logo-minimal.png diff --git a/src/meson.build b/src/meson.build index fc86d7e..befcfd9 100644 --- a/src/meson.build +++ b/src/meson.build @@ -19,6 +19,7 @@ blueprints = custom_target('blueprints', 'pages/partition_screen.blp', 'pages/summary_screen.blp', 'pages/install_screen.blp', + 'pages/finished_screen.blp', ), output: '.', command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], diff --git a/src/pages/finished_screen.blp b/src/pages/finished_screen.blp new file mode 100644 index 0000000..0447bf2 --- /dev/null +++ b/src/pages/finished_screen.blp @@ -0,0 +1,31 @@ +using Gtk 4.0; +using Adw 1; + +template FinishedScreen : Adw.Bin { + hexpand: true; + vexpand: true; + Gtk.Box { + hexpand: true; + vexpand: true; + Adw.StatusPage { + hexpand: true; + vexpand: true; + title: "Installation finished!"; + description: "Reboot to finish the installation"; + icon-name: "al.getcryst.jadegui"; + Gtk.Box { + orientation: horizontal; + halign: center; + valign: center; + vexpand: true; + hexpand: true; + + Gtk.Button next_button { + margin-start: 12; + label: "Reboot"; + styles ["suggested-action", "pill"] + } + } + } + } +} \ No newline at end of file diff --git a/src/window.py b/src/window.py index 3caec64..70e6a4e 100644 --- a/src/window.py +++ b/src/window.py @@ -32,6 +32,7 @@ from .functions.misc_screen import MiscScreen from .functions.partition_screen import PartitionScreen from .functions.summary_screen import SummaryScreen from .functions.install_screen import InstallScreen +from .functions.finished_screen import FinishedScreen @Gtk.Template(resource_path='/al/getcryst/jadegui/window.ui') class JadeGuiWindow(Gtk.ApplicationWindow): @@ -49,7 +50,8 @@ class JadeGuiWindow(Gtk.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) - self.installer_screen = InstallScreen(window=self, main_carousel=self.carousel, next_page=None, **kwargs) + self.finished_screen = FinishedScreen(window=self, **kwargs) + self.installer_screen = InstallScreen(window=self, main_carousel=self.carousel, next_page=self.finished_screen, **kwargs) self.summary_screen = SummaryScreen(window=self, main_carousel=self.carousel, next_page=self.installer_screen, **kwargs) self.partition_screen = PartitionScreen(window=self, main_carousel=self.carousel, next_page=self.summary_screen, **kwargs) self.misc_screen = MiscScreen(window=self, main_carousel=self.carousel, next_page=self.partition_screen, **kwargs) @@ -65,6 +67,7 @@ class JadeGuiWindow(Gtk.ApplicationWindow): self.carousel.append(self.partition_screen) self.carousel.append(self.summary_screen) self.carousel.append(self.installer_screen) + self.carousel.append(self.finished_screen) ### Widgets for first page (welcome screen) #self.quit_button.connect("clicked", self.confirmQuit) self.next_button.connect("clicked", self.nextPage)