From 39e71cd1e054b6ad10e6430a85949cd96a7e4cdd Mon Sep 17 00:00:00 2001 From: axtloss Date: Mon, 18 Jul 2022 22:56:46 +0200 Subject: [PATCH] Add installer page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ui is almost finished 🎉 --- al.getcryst.jadegui.yml | 17 ++++++++++++++++ src/functions/install_screen.py | 32 +++++++++++++++++++++++++++++ src/functions/meson.build | 1 + src/jade_gui.gresource.xml | 1 + src/meson.build | 1 + src/pages/install_screen.blp | 36 +++++++++++++++++++++++++++++++++ src/window.py | 5 ++++- 7 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 src/functions/install_screen.py create mode 100644 src/pages/install_screen.blp diff --git a/al.getcryst.jadegui.yml b/al.getcryst.jadegui.yml index 65c80de..0f491cf 100644 --- a/al.getcryst.jadegui.yml +++ b/al.getcryst.jadegui.yml @@ -54,6 +54,23 @@ modules: build-commands: - ls - pip3 install --prefix=/app . + # - name: vte + # buildsystem: meson + # config-opts: + # - -Ddocs = false + # - -Dvapi=false + # - -Dgtk4=true + # - -Dgtk3=false + # sources: + # - type: git + # url: https://gitlab.gnome.org/GNOME/vte.git + # commit: 3ed53bfaa7344ce5b7727a60a2d33315b15201e5 + - name: blueprint + buildsystem: meson + sources: + - type: git + url: "https://gitlab.gnome.org/jwestman/blueprint-compiler" + branch: "main" - name: jadegui buildsystem: meson build-options: diff --git a/src/functions/install_screen.py b/src/functions/install_screen.py new file mode 100644 index 0000000..9e34244 --- /dev/null +++ b/src/functions/install_screen.py @@ -0,0 +1,32 @@ +# installer_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/install_screen.ui') +class InstallScreen(Adw.Bin): + __gtype_name__="InstallScreen" + + log_text = Gtk.Template.Child() + + def __init__(self, window, main_carousel, next_page, application, **kwargs): + super().__init__(**kwargs) + self.log_text.set_text("tsarnitasnri\ntnaoietnioer\ntsarnitoarsn\ntisratnoisr") diff --git a/src/functions/meson.build b/src/functions/meson.build index c654207..6fda66e 100644 --- a/src/functions/meson.build +++ b/src/functions/meson.build @@ -10,5 +10,6 @@ jade_gui_sources = [ 'misc_screen.py', 'partition_screen.py', 'summary_screen.py', + 'install_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 9aa8cb0..309c81e 100644 --- a/src/jade_gui.gresource.xml +++ b/src/jade_gui.gresource.xml @@ -14,6 +14,7 @@ pages/misc_screen.ui pages/partition_screen.ui pages/summary_screen.ui + pages/install_screen.ui gtk/help-overlay.ui crystal-logo-minimal.png diff --git a/src/meson.build b/src/meson.build index 5afb7f9..fc86d7e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -18,6 +18,7 @@ blueprints = custom_target('blueprints', 'pages/misc_screen.blp', 'pages/partition_screen.blp', 'pages/summary_screen.blp', + 'pages/install_screen.blp', ), output: '.', command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], diff --git a/src/pages/install_screen.blp b/src/pages/install_screen.blp new file mode 100644 index 0000000..adaac3a --- /dev/null +++ b/src/pages/install_screen.blp @@ -0,0 +1,36 @@ +using Gtk 4.0; +using Adw 1; + +template InstallScreen : Adw.Bin { + hexpand: true; + vexpand: true; + Gtk.Box { + hexpand: true; + vexpand: true; + Adw.StatusPage { + hexpand: true; + vexpand: true; + title: "Installing Crystal"; + description: "This may take some time"; + Gtk.Box { + margin-end: 50; + margin-start: 50; + styles ["card"] + Gtk.ScrolledWindow { + margin-start: 12; + margin-end: 12; + min-content-height: 200; + overflow: hidden; + Gtk.Label log_text { + hexpand: true; + vexpand: true; + wrap: true; + selectable: true; + xalign: 0; + yalign: 0; + } + } + } + } + } +} \ No newline at end of file diff --git a/src/window.py b/src/window.py index 3b64df5..3caec64 100644 --- a/src/window.py +++ b/src/window.py @@ -31,6 +31,7 @@ from .functions.desktop_screen import DesktopScreen from .functions.misc_screen import MiscScreen from .functions.partition_screen import PartitionScreen from .functions.summary_screen import SummaryScreen +from .functions.install_screen import InstallScreen @Gtk.Template(resource_path='/al/getcryst/jadegui/window.ui') class JadeGuiWindow(Gtk.ApplicationWindow): @@ -48,7 +49,8 @@ class JadeGuiWindow(Gtk.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) - self.summary_screen = SummaryScreen(window=self, main_carousel=self.carousel, next_page=None, **kwargs) + self.installer_screen = InstallScreen(window=self, main_carousel=self.carousel, next_page=None, **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) self.desktop_screen = DesktopScreen(window=self, main_carousel=self.carousel, next_page=self.misc_screen, **kwargs) @@ -62,6 +64,7 @@ class JadeGuiWindow(Gtk.ApplicationWindow): self.carousel.append(self.misc_screen) self.carousel.append(self.partition_screen) self.carousel.append(self.summary_screen) + self.carousel.append(self.installer_screen) ### Widgets for first page (welcome screen) #self.quit_button.connect("clicked", self.confirmQuit) self.next_button.connect("clicked", self.nextPage)