From d9cd02a4660532f0e4f3750dd5abf19c77b41a3c Mon Sep 17 00:00:00 2001 From: mirkobrombin Date: Tue, 6 Sep 2022 12:11:39 +0200 Subject: [PATCH] 0.0.3 - rebrand --- .github/workflows/build.yml | 2 +- .gitignore | 2 +- README.md | 6 +- VERSION | 2 +- data/icons/meson.build | 2 +- ...thub.vanilla-os.SugarCubes.appdata.xml.in} | 6 +- ...io.github.vanilla-os.SugarCubes.desktop.in | 8 ++ ...o.github.vanilla-os.SugarCubes.gschema.xml | 5 + data/meson.build | 10 +- data/pm.mirko.UbuntuSmoother.desktop.in | 8 -- data/pm.mirko.UbuntuSmoother.gschema.xml | 5 - debian/changelog | 2 +- debian/control | 10 +- debian/copyright | 4 +- debian/ubuntu-smoother.debhelper.log | 24 +++++ debian/ubuntu-smoother.substvars | 2 + debian/ubuntu-smoother/DEBIAN/control | 10 ++ debian/ubuntu-smoother/DEBIAN/md5sums | 24 +++++ .../ubuntu-smoother/usr/bin/ubuntu-smoother | 43 ++++++++ .../usr/bin/ubuntu-smoother-processor | 45 ++++++++ .../pm.mirko.UbuntuSmoother.appdata.xml | 30 ++++++ .../pm.mirko.UbuntuSmoother.desktop | 8 ++ .../share/doc/ubuntu-smoother/changelog.gz | Bin 0 -> 137 bytes .../usr/share/doc/ubuntu-smoother/copyright | 23 ++++ .../pm.mirko.UbuntuSmoother.gschema.xml | 5 + .../scalable/apps/pm.mirko.UbuntuSmoother.svg | 18 ++++ .../apps/pm.mirko.UbuntuSmoother-symbolic.svg | 18 ++++ .../ubuntu-smoother.gresource | Bin 0 -> 7536 bytes .../ubuntu_smoother/__init__.py | 0 .../ubuntu_smoother/main.py | 72 +++++++++++++ .../ubuntu_smoother/models/__init__.py | 0 .../ubuntu_smoother/models/config.py | 25 +++++ .../ubuntu_smoother/models/preset.py | 5 + .../ubuntu_smoother/utils/__init__.py | 0 .../ubuntu_smoother/utils/apt.py | 44 ++++++++ .../ubuntu_smoother/utils/checks.py | 13 +++ .../ubuntu_smoother/utils/configurator.py | 99 ++++++++++++++++++ .../ubuntu_smoother/utils/flatpak.py | 25 +++++ .../ubuntu_smoother/utils/processor.py | 18 ++++ .../ubuntu_smoother/utils/run_async.py | 70 +++++++++++++ .../ubuntu_smoother/utils/snap.py | 18 ++++ .../ubuntu_smoother/window.py | 94 +++++++++++++++++ meson.build | 6 +- po/meson.build | 2 +- ubuntu_smoother/gtk/window.ui | 6 +- ubuntu_smoother/main.py | 10 +- ubuntu_smoother/meson.build | 18 ++-- ubuntu_smoother/models/meson.build | 2 +- ubuntu_smoother/ubuntu-smoother-processor.in | 12 +-- ubuntu_smoother/ubuntu-smoother.gresource.xml | 2 +- ubuntu_smoother/ubuntu-smoother.in | 12 +-- ubuntu_smoother/utils/configurator.py | 12 +-- ubuntu_smoother/utils/meson.build | 2 +- ubuntu_smoother/utils/processor.py | 4 +- ubuntu_smoother/utils/run_async.py | 2 +- ubuntu_smoother/window.py | 14 +-- 56 files changed, 821 insertions(+), 88 deletions(-) rename data/{pm.mirko.UbuntuSmoother.appdata.xml.in => io.github.vanilla-os.SugarCubes.appdata.xml.in} (81%) create mode 100644 data/io.github.vanilla-os.SugarCubes.desktop.in create mode 100644 data/io.github.vanilla-os.SugarCubes.gschema.xml delete mode 100644 data/pm.mirko.UbuntuSmoother.desktop.in delete mode 100644 data/pm.mirko.UbuntuSmoother.gschema.xml create mode 100644 debian/ubuntu-smoother.debhelper.log create mode 100644 debian/ubuntu-smoother.substvars create mode 100644 debian/ubuntu-smoother/DEBIAN/control create mode 100644 debian/ubuntu-smoother/DEBIAN/md5sums create mode 100755 debian/ubuntu-smoother/usr/bin/ubuntu-smoother create mode 100755 debian/ubuntu-smoother/usr/bin/ubuntu-smoother-processor create mode 100644 debian/ubuntu-smoother/usr/share/appdata/pm.mirko.UbuntuSmoother.appdata.xml create mode 100644 debian/ubuntu-smoother/usr/share/applications/pm.mirko.UbuntuSmoother.desktop create mode 100644 debian/ubuntu-smoother/usr/share/doc/ubuntu-smoother/changelog.gz create mode 100644 debian/ubuntu-smoother/usr/share/doc/ubuntu-smoother/copyright create mode 100644 debian/ubuntu-smoother/usr/share/glib-2.0/schemas/pm.mirko.UbuntuSmoother.gschema.xml create mode 100644 debian/ubuntu-smoother/usr/share/icons/hicolor/scalable/apps/pm.mirko.UbuntuSmoother.svg create mode 100644 debian/ubuntu-smoother/usr/share/icons/hicolor/symbolic/apps/pm.mirko.UbuntuSmoother-symbolic.svg create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu-smoother.gresource create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/__init__.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/main.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/models/__init__.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/models/config.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/models/preset.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/__init__.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/apt.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/checks.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/configurator.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/flatpak.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/processor.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/run_async.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/snap.py create mode 100644 debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/window.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index afadd11..1815dfd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,4 +35,4 @@ jobs: prerelease: false automatic_release_tag: ${{ steps.get_version.outputs.VERSION }} title: ${{ steps.get_version.outputs.VERSION }} - files: ../ubuntu-smoother_*.deb \ No newline at end of file + files: ../sugar-cubes_*.deb \ No newline at end of file diff --git a/.gitignore b/.gitignore index ac8757d..040a084 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ mesonbuild/ build/ debian/files -debian/ubuntu-smoother* +debian/sugar-cubes* debian/.debhelper \ No newline at end of file diff --git a/README.md b/README.md index b480a9f..aed5426 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
-

Ubuntu Smoother

-

This utility is meant to be used in Ubuntu Vanilla GNOME +

Sugar Cubes

+

This utility is meant to be used in Vanilla OS as a first-setup wizard. It's purpose is to help the user to configure the system to his needs, e.g. by configuring snap, flatpak, flathub, etc.

@@ -28,5 +28,5 @@ sudo ninja -C build install ## Run ```bash -ubuntu-smoother +sugar-cubes ``` \ No newline at end of file diff --git a/VERSION b/VERSION index 7bcd0e3..6812f81 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.2 \ No newline at end of file +0.0.3 \ No newline at end of file diff --git a/data/icons/meson.build b/data/icons/meson.build index d8f11c9..fa858ba 100644 --- a/data/icons/meson.build +++ b/data/icons/meson.build @@ -1,4 +1,4 @@ -application_id = 'pm.mirko.UbuntuSmoother' +application_id = 'io.github.vanilla-os.SugarCubes' scalable_dir = join_paths('hicolor', 'scalable', 'apps') install_data( diff --git a/data/pm.mirko.UbuntuSmoother.appdata.xml.in b/data/io.github.vanilla-os.SugarCubes.appdata.xml.in similarity index 81% rename from data/pm.mirko.UbuntuSmoother.appdata.xml.in rename to data/io.github.vanilla-os.SugarCubes.appdata.xml.in index 541d72c..a768d74 100644 --- a/data/pm.mirko.UbuntuSmoother.appdata.xml.in +++ b/data/io.github.vanilla-os.SugarCubes.appdata.xml.in @@ -1,16 +1,16 @@ - pm.mirko.UbuntuSmoother.desktop + io.github.vanilla-os.SugarCubes.desktop CC0-1.0 GPL-3.0-only - Ubuntu Smoother + Sugar Cubes Tweak your Ubuntu Vanilla GNOME installation. Mirko Brombin

No description

- pm.mirko.UbuntuSmoother + io.github.vanilla-os.SugarCubes pointing diff --git a/data/io.github.vanilla-os.SugarCubes.desktop.in b/data/io.github.vanilla-os.SugarCubes.desktop.in new file mode 100644 index 0000000..914fcf6 --- /dev/null +++ b/data/io.github.vanilla-os.SugarCubes.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Sugar Cubes +Exec=sugar-cubes +Icon=io.github.vanilla-os.SugarCubes +Terminal=false +Type=Application +Categories=GTK; +StartupNotify=true \ No newline at end of file diff --git a/data/io.github.vanilla-os.SugarCubes.gschema.xml b/data/io.github.vanilla-os.SugarCubes.gschema.xml new file mode 100644 index 0000000..3d78c47 --- /dev/null +++ b/data/io.github.vanilla-os.SugarCubes.gschema.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/data/meson.build b/data/meson.build index fe7b42a..c33eaac 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,6 +1,6 @@ desktop_file = i18n.merge_file( - input: 'pm.mirko.UbuntuSmoother.desktop.in', - output: 'pm.mirko.UbuntuSmoother.desktop', + input: 'io.github.vanilla-os.SugarCubes.desktop.in', + output: 'io.github.vanilla-os.SugarCubes.desktop', type: 'desktop', po_dir: '../po', install: true, @@ -15,8 +15,8 @@ if desktop_utils.found() endif appstream_file = i18n.merge_file( - input: 'pm.mirko.UbuntuSmoother.appdata.xml.in', - output: 'pm.mirko.UbuntuSmoother.appdata.xml', + input: 'io.github.vanilla-os.SugarCubes.appdata.xml.in', + output: 'io.github.vanilla-os.SugarCubes.appdata.xml', po_dir: '../po', install: true, install_dir: join_paths(get_option('datadir'), 'appdata') @@ -29,7 +29,7 @@ if appstream_util.found() ) endif -install_data('pm.mirko.UbuntuSmoother.gschema.xml', +install_data('io.github.vanilla-os.SugarCubes.gschema.xml', install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') ) diff --git a/data/pm.mirko.UbuntuSmoother.desktop.in b/data/pm.mirko.UbuntuSmoother.desktop.in deleted file mode 100644 index ebb52b2..0000000 --- a/data/pm.mirko.UbuntuSmoother.desktop.in +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=Ubuntu Smoother -Exec=ubuntu-smoother -Icon=pm.mirko.UbuntuSmoother -Terminal=false -Type=Application -Categories=GTK; -StartupNotify=true \ No newline at end of file diff --git a/data/pm.mirko.UbuntuSmoother.gschema.xml b/data/pm.mirko.UbuntuSmoother.gschema.xml deleted file mode 100644 index 35bbc28..0000000 --- a/data/pm.mirko.UbuntuSmoother.gschema.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index 8689a67..fd95024 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ubuntu-smoother (0.0.2) jammy; urgency=low +sugar-cubes (0.0.3) jammy; urgency=low * First release diff --git a/debian/control b/debian/control index cf2b425..af42350 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: ubuntu-smoother +Source: sugar-cubes Section: utils Priority: optional Maintainer: Mirko Brombin @@ -11,12 +11,12 @@ Build-Depends: gettext, desktop-file-utils, make -Homepage: https://github.com/mirkobrombin/ubuntu-smoother/ -Vcs-Browser: hhttps://github.com/mirkobrombin/ubuntu-smoother -Vcs-Git: https://github.com/mirkobrombin/ubuntu-smoother.git +Homepage: https://github.com/mirkobrombin/sugar-cubes/ +Vcs-Browser: hhttps://github.com/mirkobrombin/sugar-cubes +Vcs-Git: https://github.com/mirkobrombin/sugar-cubes.git Rules-Requires-Root: no -Package: ubuntu-smoother +Package: sugar-cubes Architecture: any Depends: python3, python3-gi, diff --git a/debian/copyright b/debian/copyright index df57302..a2f8f8d 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,6 +1,6 @@ Format: http://dep.debian.net/deps/dep5 -Upstream-Name: Ubuntu Smoother -Source: https://github.com/mirko-brombin/ubuntu-smoother +Upstream-Name: Sugar Cubes +Source: https://github.com/mirko-brombin/sugar-cubes Files: * Copyright: 2022 Mirko Brombin diff --git a/debian/ubuntu-smoother.debhelper.log b/debian/ubuntu-smoother.debhelper.log new file mode 100644 index 0000000..e2034b0 --- /dev/null +++ b/debian/ubuntu-smoother.debhelper.log @@ -0,0 +1,24 @@ +dh_update_autotools_config +dh_auto_configure +dh_auto_build +dh_auto_test +dh_prep +dh_auto_install +dh_installdocs +dh_installchangelogs +dh_installinit +dh_installgsettings +dh_icons +dh_perl +dh_link +dh_strip_nondeterminism +dh_compress +dh_fixperms +dh_missing +dh_strip +dh_makeshlibs +dh_shlibdeps +dh_installdeb +dh_gencontrol +dh_md5sums +dh_builddeb diff --git a/debian/ubuntu-smoother.substvars b/debian/ubuntu-smoother.substvars new file mode 100644 index 0000000..e6b63de --- /dev/null +++ b/debian/ubuntu-smoother.substvars @@ -0,0 +1,2 @@ +misc:Depends=dconf-gsettings-backend | gsettings-backend +misc:Pre-Depends= diff --git a/debian/ubuntu-smoother/DEBIAN/control b/debian/ubuntu-smoother/DEBIAN/control new file mode 100644 index 0000000..3c3168c --- /dev/null +++ b/debian/ubuntu-smoother/DEBIAN/control @@ -0,0 +1,10 @@ +Package: sugar-cubes +Version: 0.0.1 +Architecture: amd64 +Maintainer: Mirko Brombin +Installed-Size: 65 +Depends: dconf-gsettings-backend | gsettings-backend, python3, python3-gi, libadwaita-1, gir1.2-gtk-4.0, gir1.2-adw-1 +Section: utils +Priority: optional +Homepage: https://github.com/mirkobrombin/sugar-cubes/ +Description: This utility is meant to be used in Ubuntu Vanilla GNOME as a first-setup wizard. diff --git a/debian/ubuntu-smoother/DEBIAN/md5sums b/debian/ubuntu-smoother/DEBIAN/md5sums new file mode 100644 index 0000000..51411fa --- /dev/null +++ b/debian/ubuntu-smoother/DEBIAN/md5sums @@ -0,0 +1,24 @@ +3f84a85bd8dcb22475ca07a2d69063ac usr/bin/sugar-cubes +e53214a91cfee2c537138e64d0d2357e usr/bin/sugar-cubes-processor +f62ae2de8dd39b794fa94951db288612 usr/share/appdata/pm.mirko.SugarCubes.appdata.xml +572c7ac7342d5e999af8cf5fc99fc7ba usr/share/applications/pm.mirko.SugarCubes.desktop +632c1335ca45192e9b887308023c156c usr/share/doc/sugar-cubes/changelog.gz +62ed186d7529beecf72bcf7c48b53a76 usr/share/doc/sugar-cubes/copyright +3ff815595db45e9dcd137d06f9d8718c usr/share/glib-2.0/schemas/pm.mirko.SugarCubes.gschema.xml +a3cd0585c74138a988a7225dd57fc171 usr/share/icons/hicolor/scalable/apps/pm.mirko.SugarCubes.svg +a3cd0585c74138a988a7225dd57fc171 usr/share/icons/hicolor/symbolic/apps/pm.mirko.SugarCubes-symbolic.svg +75fdbd9173045311c140056e34292035 usr/share/pm.mirko.SugarCubes/sugar-cubes.gresource +d41d8cd98f00b204e9800998ecf8427e usr/share/pm.mirko.SugarCubes/sugar_cubes/__init__.py +cacabd792fe13148f625e90b1d63e343 usr/share/pm.mirko.SugarCubes/sugar_cubes/main.py +d41d8cd98f00b204e9800998ecf8427e usr/share/pm.mirko.SugarCubes/sugar_cubes/models/__init__.py +655cc3575fd9547bcc28605a40adecb4 usr/share/pm.mirko.SugarCubes/sugar_cubes/models/config.py +19a9c8ef77a0b94b9bd9da204bf619be usr/share/pm.mirko.SugarCubes/sugar_cubes/models/preset.py +d41d8cd98f00b204e9800998ecf8427e usr/share/pm.mirko.SugarCubes/sugar_cubes/utils/__init__.py +24bb5bd4e6d6262c1b454b3656ab24e0 usr/share/pm.mirko.SugarCubes/sugar_cubes/utils/apt.py +4d805e042731d213eb5139530d8aa638 usr/share/pm.mirko.SugarCubes/sugar_cubes/utils/checks.py +7823cbc7898533c975d6a44bc5805480 usr/share/pm.mirko.SugarCubes/sugar_cubes/utils/configurator.py +d757da1b73916417336840cc67295681 usr/share/pm.mirko.SugarCubes/sugar_cubes/utils/flatpak.py +f2595187532f527875795277675234a5 usr/share/pm.mirko.SugarCubes/sugar_cubes/utils/processor.py +0ebff648510796f3d38e84739469f97e usr/share/pm.mirko.SugarCubes/sugar_cubes/utils/run_async.py +ebbd22d7a8847f604900387b8c9d86a2 usr/share/pm.mirko.SugarCubes/sugar_cubes/utils/snap.py +f07c8b3e157f197d2cefd0a89862b3c1 usr/share/pm.mirko.SugarCubes/sugar_cubes/window.py diff --git a/debian/ubuntu-smoother/usr/bin/ubuntu-smoother b/debian/ubuntu-smoother/usr/bin/ubuntu-smoother new file mode 100755 index 0000000..189f607 --- /dev/null +++ b/debian/ubuntu-smoother/usr/bin/ubuntu-smoother @@ -0,0 +1,43 @@ +#!/usr/bin/python3 + +# sugar-cubes.in +# +# Copyright 2022 mirkobrombin +# +# 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 Foundationat version 3 of the License. +# +# 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 . + +import os +import sys +import signal +import locale +import gettext + +VERSION = '0.0.1' +pkgdatadir = '/usr/share/pm.mirko.SugarCubes' +localedir = '/usr/share/locale' + +sys.path.insert(1, pkgdatadir) +signal.signal(signal.SIGINT, signal.SIG_DFL) +locale.bindtextdomain('sugar_cubes', localedir) +locale.textdomain('sugar_cubes') +gettext.install('sugar_cubes', localedir) + +if __name__ == '__main__': + import gi + + from gi.repository import Gio + resource = Gio.Resource.load(os.path.join(pkgdatadir, 'sugar-cubes.gresource')) + resource._register() + + from sugar_cubes import main + sys.exit(main.main(VERSION)) \ No newline at end of file diff --git a/debian/ubuntu-smoother/usr/bin/ubuntu-smoother-processor b/debian/ubuntu-smoother/usr/bin/ubuntu-smoother-processor new file mode 100755 index 0000000..4cf47a9 --- /dev/null +++ b/debian/ubuntu-smoother/usr/bin/ubuntu-smoother-processor @@ -0,0 +1,45 @@ +#!/usr/bin/python3 + +# sugar-cubes-processor.in +# +# Copyright 2022 mirkobrombin +# +# 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 Foundationat version 3 of the License. +# +# 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 . + +import os +import sys +import signal +import locale +import gettext +import argparse + +VERSION = '0.0.1' +pkgdatadir = '/usr/share/pm.mirko.SugarCubes' +localedir = '/usr/share/locale' + +sys.path.insert(1, pkgdatadir) +signal.signal(signal.SIGINT, signal.SIG_DFL) +locale.bindtextdomain('sugar_cubes', localedir) +locale.textdomain('sugar_cubes') +gettext.install('sugar_cubes', localedir) + +if __name__ == '__main__': + from sugar_cubes.utils.configurator import Configurator + from sugar_cubes.models.config import Config + + parser = argparse.ArgumentParser() + parser.add_argument('config', help='The configuration string (e.g. snap::True|flatpak::False|apport::True)') + args = parser.parse_args() + + config = Config.from_str(args.config) + Configurator(config).apply() diff --git a/debian/ubuntu-smoother/usr/share/appdata/pm.mirko.UbuntuSmoother.appdata.xml b/debian/ubuntu-smoother/usr/share/appdata/pm.mirko.UbuntuSmoother.appdata.xml new file mode 100644 index 0000000..cf9f014 --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/appdata/pm.mirko.UbuntuSmoother.appdata.xml @@ -0,0 +1,30 @@ + + + pm.mirko.SugarCubes.desktop + CC0-1.0 + GPL-3.0-only + Sugar Cubes + Tweak your Ubuntu Vanilla GNOME installation. + Mirko Brombin + +

No description

+
+ + pm.mirko.SugarCubes + + + pointing + keyboard + touch + + + 768 + + + + +

First release

+
+
+
+
diff --git a/debian/ubuntu-smoother/usr/share/applications/pm.mirko.UbuntuSmoother.desktop b/debian/ubuntu-smoother/usr/share/applications/pm.mirko.UbuntuSmoother.desktop new file mode 100644 index 0000000..d8c8508 --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/applications/pm.mirko.UbuntuSmoother.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Sugar Cubes +Exec=sugar-cubes +Icon=pm.mirko.SugarCubes +Terminal=false +Type=Application +Categories=GTK; +StartupNotify=true diff --git a/debian/ubuntu-smoother/usr/share/doc/ubuntu-smoother/changelog.gz b/debian/ubuntu-smoother/usr/share/doc/ubuntu-smoother/changelog.gz new file mode 100644 index 0000000000000000000000000000000000000000..b65f44af927c6085bdb1401329e43646497fa806 GIT binary patch literal 137 zcmV;40CxW$iwFP!000020~N?S4#F@HMbSR1cqKnug9T0a2vN|bVg(6|AR+cdV_PV@ z$K2u;CwDodY@!!QZ&obGlHD#bwBFALWPNdX%%@SlRRyeY>oq1QkK9HsWDJ^KKZ2`@ r@A`ma +License: GPL-3.0 + +License: GPL-3.0 + 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. + . + This package 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 . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". \ No newline at end of file diff --git a/debian/ubuntu-smoother/usr/share/glib-2.0/schemas/pm.mirko.UbuntuSmoother.gschema.xml b/debian/ubuntu-smoother/usr/share/glib-2.0/schemas/pm.mirko.UbuntuSmoother.gschema.xml new file mode 100644 index 0000000..b52cd1a --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/glib-2.0/schemas/pm.mirko.UbuntuSmoother.gschema.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/debian/ubuntu-smoother/usr/share/icons/hicolor/scalable/apps/pm.mirko.UbuntuSmoother.svg b/debian/ubuntu-smoother/usr/share/icons/hicolor/scalable/apps/pm.mirko.UbuntuSmoother.svg new file mode 100644 index 0000000..76381fb --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/icons/hicolor/scalable/apps/pm.mirko.UbuntuSmoother.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/debian/ubuntu-smoother/usr/share/icons/hicolor/symbolic/apps/pm.mirko.UbuntuSmoother-symbolic.svg b/debian/ubuntu-smoother/usr/share/icons/hicolor/symbolic/apps/pm.mirko.UbuntuSmoother-symbolic.svg new file mode 100644 index 0000000..76381fb --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/icons/hicolor/symbolic/apps/pm.mirko.UbuntuSmoother-symbolic.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu-smoother.gresource b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu-smoother.gresource new file mode 100644 index 0000000000000000000000000000000000000000..c8f322b84e1c029a3c70b2461112452ccc186564 GIT binary patch literal 7536 zcmeHMPmkL~6nFnniAo3#95{e9^#O`RHbp|Hhis~L+iokhWocSgoT7>SVox)fG2`)i zQ*q$RC*T7hf%pK3D@Q&62M!!6#DN1xBsd_!o3WjZ|HRp(2!ytgyyLa!&HFRI_j@zr z-4Cc@RA?vvy@Ks`+5N?H`Lk2ln(K6aox%3yZ(e_5TGRJM=Z^COwm;(a{nw|Rzwl@7 zPvP??*#3-{^X=isW(;$G2A}_e?XP&fuYUi^jBD=C;q%|H{R6L0Kf7mbGWTck`JdPt zBc@-z@cG&N{(0xXc?q9IuQ|@cQ6h9Qm`bTbP+gR9oGxBw>}c9WohZxHM4E^A3-qM> z9JVPFzD&0gW}iCF-mBS7@5|W`g?=hi4 zjj0Fy^Mv#ie3UQ+G2v{q?V=9%Xoz=kh;BnK>`MKVGEEmcTYXt?4bzBI4aDO#j!}2X z(|v2dOCqX3=xz6^pI(h3&OEBo@cgaOiq=I+MxgYJ2s(vr*M~7pxbCFP*P+|LeCblJ zTXboc2!REmcKh$H7ST*|aQm6jq?n(YA}?gz&y=E}a`Xs1T{yg}C)ebmTfD71A{9g5 zt;22~r%a>wysE-Rprpn=DXYTh-2&=^x<=K4!lvk1$A%cY05B3Zz@}UFt9XFJ?ocI@ z82D}Bo4Jwdy3}z^uI`(c%enpHuF0{v-eUgpDK14O#Qz>k3{+!ma>Kh>K*|m+Q`w94 zj9cUv2AH;Iftp(|M(Dc4BKfFKuUixB)fD%-mD%c5{;vULA)f0Od~*jlpzrUptwU(sMAaV|wLj8hf? zBCw{u1m)g^PKWFR_v92vr&EDNZ9?qy*HUVLxtYX!G(aLKjc&VF;>tWJI)( zl)Y7^yk#@gG+ItSxd#{45%mG*iA9D+-TqxV0Wy<`B3>w&2k~1(hb$&3drXy&4d+Cg zJ_tD=a!deuXog)xu(giTka8BFzA+BCj@-e9a&r{x7Ugh-w8o&>6dY+W zj5Sqtjx@4$zTk4q$?E%@n_ukzbbH|bDbx4dF65}ck2pikLNWo{g z2=^vf<;au@Y*Z`r8w-lxa>x`tOj}u0Vzv#?7%$9-7VA0Q4`Z}!Md<8UmGB)O-isC) zCR)Z(i~W}HRk_QmfmRN(I*OGDn!VD~!R;olZX-JRhY*JgK}m4=V|f@Xtc-#%85uCj zm?7Y1{{^VbA|Bm5k+^C{cq=H|0a*v*LN(Zsw{IM3MUR8VcGE0F)XK_J<_aE5$knU4 zf)lEHv?Fr9E^Spx@z9EBNhSc1O_gg&K<;CjC|vcCL^ICx>{w;WdfQrJ=SG!d(#*ir z`uQwZilEKgmRwn$WJ`sXBe;@SO&bz=(6kk`K&TYPd_OWk39=JXfvfse`BjDPvkggk z*FT@q`X*#g$pDW}|wgXxIFv{M}L$Fu23;wOQ1pq=N2F@N(@vk!6i=utrgZYM!J zlC$gxO+ZTW4+40I3g-0QgOisb)nhV`%XrPQv|~itrnRZ0t&<>_A}8^Hte)oc6mQ~z Zg_pf<@x2Z|4t9^e4m!@oB%!l6{|3;UvBUrX literal 0 HcmV?d00001 diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/__init__.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/main.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/main.py new file mode 100644 index 0000000..171e703 --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/main.py @@ -0,0 +1,72 @@ +# main.py +# +# Copyright 2022 mirkobrombin +# +# 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 Foundationat version 3 of the License. +# +# 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 sugar_cubes.window import SugarCubesWindow +from gi.repository import Gtk, Gio, Adw +import sys +import gi +import logging + +gi.require_version('Gtk', '4.0') +gi.require_version('Adw', '1') + + +logging.basicConfig(level=logging.INFO) + + +class SugarCubesApplication(Adw.Application): + """The main application singleton class.""" + + def __init__(self): + super().__init__(application_id='pm.mirko.SugarCubes', + flags=Gio.ApplicationFlags.FLAGS_NONE) + self.create_action('quit', self.close, ['q']) + + def do_activate(self): + """Called when the application is activated. + + We raise the application's main window, creating it if + necessary. + """ + win = self.props.active_window + if not win: + win = SugarCubesWindow(application=self) + win.present() + + def create_action(self, name, callback, shortcuts=None): + """Add an application action. + + Args: + name: the name of the action + callback: the function to be called when the action is + activated + shortcuts: an optional list of accelerators + """ + action = Gio.SimpleAction.new(name, None) + action.connect("activate", callback) + self.add_action(action) + if shortcuts: + self.set_accels_for_action(f"app.{name}", shortcuts) + + def close(self, *args): + """Close the application.""" + self.quit() + + +def main(version): + """The application's entry point.""" + app = SugarCubesApplication() + return app.run(sys.argv) diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/models/__init__.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/models/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/models/config.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/models/config.py new file mode 100644 index 0000000..40ae2f0 --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/models/config.py @@ -0,0 +1,25 @@ +class Config: + + def __init__(self, snap: bool, flatpak: bool, apport: bool): + self.snap = snap + self.flatpak = flatpak + self.apport = apport + + def get_str(self) -> str: + return "snap::{0}|flatpak::{1}|apport::{2}".format( + self.snap, self.flatpak, self.apport + ) + + @classmethod + def from_str(cls, config_str: str) -> 'Config': + items = config_str.split('|') + + snap = items[0].split('::')[1] + flatpak = items[1].split('::')[1] + apport = items[2].split('::')[1] + + return cls( + snap=bool(snap), + flatpak=bool(flatpak), + apport=bool(apport) + ) diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/models/preset.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/models/preset.py new file mode 100644 index 0000000..9fb1d42 --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/models/preset.py @@ -0,0 +1,5 @@ +class Preset: + + snap: bool = True + flatpak: bool = True + apport: bool = True diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/__init__.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/apt.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/apt.py new file mode 100644 index 0000000..0d9e19c --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/apt.py @@ -0,0 +1,44 @@ +import subprocess + + +class Apt: + + @staticmethod + def install(packages: list): + subprocess.run( + ['sudo', 'apt', 'install'] + packages, + env={'DEBIAN_FRONTEND': 'noninteractive'}, + check=True + ) + + @staticmethod + def remove(packages: list): + subprocess.run( + ['sudo', 'apt', 'remove'] + packages, + env={'DEBIAN_FRONTEND': 'noninteractive'}, + check=True + ) + + @staticmethod + def purge(packages: list): + subprocess.run( + ['sudo', 'apt', 'purge'] + packages, + env={'DEBIAN_FRONTEND': 'noninteractive'}, + check=True + ) + + @staticmethod + def update(): + subprocess.run( + ['sudo', 'apt', 'update'], + env={'DEBIAN_FRONTEND': 'noninteractive'}, + check=True + ) + + @staticmethod + def upgrade(): + subprocess.run( + ['sudo', 'apt', 'upgrade'], + env={'DEBIAN_FRONTEND': 'noninteractive'}, + check=True + ) diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/checks.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/checks.py new file mode 100644 index 0000000..d3c8425 --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/checks.py @@ -0,0 +1,13 @@ +import shutil + + +def is_snap_installed(): + return shutil.which('snap') is not None + + +def is_flatpak_installed(): + return shutil.which('flatpak') is not None + + +def is_apport_installed(): + return shutil.which('apport') is not None diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/configurator.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/configurator.py new file mode 100644 index 0000000..8a88a10 --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/configurator.py @@ -0,0 +1,99 @@ +import os +import time +import logging + +from sugar_cubes.utils import checks +from sugar_cubes.utils.apt import Apt +from sugar_cubes.utils.flatpak import Flatpak +from sugar_cubes.utils.snap import Snap + + +logger = logging.getLogger("SugarCubes::Configurator") + + +class Configurator: + + def __init__(self, config: 'Config', fake: bool = False): + self.config = config + self.fake = fake + + def apply(self): + self.__enable_snap() if self.config.snap else self.__disable_snap() + self.__enable_flatpak() if self.config.flatpak else self.__disable_flatpak() + self.__enable_apport() if self.config.apport else self.__disable_apport() + + def __fake(self, msg: str): + time.sleep(1) + logger.info(f"Fake: {msg}") + + def __enable_snap(self): + if self.fake: + return self.__fake("Fake: Snap enabled") + + if not checks.is_snap_installed(): + Apt.install(['snapd', 'gnome-software-plugin-snap']) + Apt.update() + + if not self.config.flatpak: + Snap.install(['snap-store']) + + def __disable_snap(self): + if self.fake: + return self.__fake("Fake: Snap disabled") + + if checks.is_snap_installed(): + Apt.purge(['snapd']) + + def __enable_flatpak(self): + if self.fake: + return self.__fake("Fake: Flatpak enabled") + + if not checks.is_flatpak_installed(): + Apt.install(['flatpak']) + Apt.update() + Flatpak.add_repo("https://flathub.org/repo/flathub.flatpakrepo") + + def __disable_flatpak(self): + if self.fake: + return self.__fake("Fake: Flatpak disabled") + + if checks.is_flatpak_installed(): + Apt.purge(['flatpak']) + + def __enable_apport(self): + if self.fake: + return self.__fake("Fake: Apport enabled") + + if not checks.is_apport_installed(): + Apt.install(['apport']) + Apt.update() + + def __disable_apport(self): + if self.fake: + return self.__fake("Fake: Apport disabled") + + if checks.is_apport_installed(): + Apt.purge(['apport']) + + def __disable_on_startup(self): + if self.fake: + return self.__fake("Fake: Disable on startup") + + autostart_file = os.path.expanduser("~/.config/autostart/sugar-cubes.desktop") + if os.path.exists(autostart_file): + os.remove(autostart_file) + + def __enable_on_startup(self): + if self.fake: + return self.__fake("Fake: Enable on startup") + + autostart_file = os.path.expanduser("~/.config/autostart/sugar-cubes.desktop") + if not os.path.exists(autostart_file): + with open(autostart_file, "w") as f: + f.write("[Desktop Entry]") + f.write("Type=Application") + f.write("Name=Sugar Cubes") + f.write("Exec=sugar-cubes") + f.write("Terminal=false") + f.write("X-GNOME-Autostart-enabled=true") + \ No newline at end of file diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/flatpak.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/flatpak.py new file mode 100644 index 0000000..7c45833 --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/flatpak.py @@ -0,0 +1,25 @@ +import subprocess + + +class Flatpak: + + @staticmethod + def install(packages: list): + subprocess.run( + ['flatpak', 'install', '--user'] + packages, + check=True + ) + + @staticmethod + def remove(packages: list): + subprocess.run( + ['flatpak', 'remove', '--user'] + packages, + check=True + ) + + @staticmethod + def add_repo(repo: str): + subprocess.run( + ['flatpak', 'remote-add', '--user', '--if-not-exists', repo], + check=True + ) diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/processor.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/processor.py new file mode 100644 index 0000000..e048f88 --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/processor.py @@ -0,0 +1,18 @@ +import subprocess + + +class Processor: + + def __init__(self, config: 'Config'): + self.__config = config + + def run(self): + proc = subprocess.run( + ["pkexec", "sugar-cubes-processor", self.__config.get_str()], + check=True + ) + + if proc.returncode != 0: + return False, "Error executing the Sugar Cubes Processor" + + return True \ No newline at end of file diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/run_async.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/run_async.py new file mode 100644 index 0000000..ad13516 --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/run_async.py @@ -0,0 +1,70 @@ +# run_async.py +# +# Copyright 2022 brombinmirko +# +# 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, in version 3 of the License. +# +# 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 . +# + +import os +import sys +import threading +import traceback +import logging + +from gi.repository import GLib + +logger = logging.getLogger("SugarCubes::Async") + + +class RunAsync(threading.Thread): + """ + This class is used to execute a function asynchronously. + It takes a function, a callback and a list of arguments as input. + """ + + def __init__(self, task_func, callback=None, *args, **kwargs): + if "DEBUG_MODE" in os.environ: + import faulthandler + faulthandler.enable() + + self.source_id = None + assert threading.current_thread() is threading.main_thread() + + super(RunAsync, self).__init__(target=self.__target, args=args, kwargs=kwargs) + + self.task_func = task_func + + self.callback = callback if callback else lambda r, e: None + self.daemon = kwargs.pop("daemon", True) + + self.start() + + def __target(self, *args, **kwargs): + result = None + error = None + + logger.debug(f"Running async job [{self.task_func}].") + + try: + result = self.task_func(*args, **kwargs) + except Exception as exception: + logger.error("Error while running async job: " + f"{self.task_func}\nException: {exception}") + + error = exception + _ex_type, _ex_value, trace = sys.exc_info() + traceback.print_tb(trace) + traceback_info = '\n'.join(traceback.format_tb(trace)) + + self.source_id = GLib.idle_add(self.callback, result, error) + return self.source_id diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/snap.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/snap.py new file mode 100644 index 0000000..ae76ae6 --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/utils/snap.py @@ -0,0 +1,18 @@ +import subprocess + + +class Snap: + + @staticmethod + def install(packages: list): + subprocess.run( + ['snap', 'install'] + packages, + check=True + ) + + @staticmethod + def remove(packages: list): + subprocess.run( + ['snap', 'remove'] + packages, + check=True + ) diff --git a/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/window.py b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/window.py new file mode 100644 index 0000000..415dc3d --- /dev/null +++ b/debian/ubuntu-smoother/usr/share/pm.mirko.UbuntuSmoother/ubuntu_smoother/window.py @@ -0,0 +1,94 @@ +# window.py +# +# Copyright 2022 mirkobrombin +# +# 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 Foundationat version 3 of the License. +# +# 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, Gio, Adw + +from sugar_cubes.models.preset import Preset +from sugar_cubes.models.config import Config +from sugar_cubes.utils.processor import Processor +from sugar_cubes.utils.run_async import RunAsync + + +@Gtk.Template(resource_path='/pm/mirko/SugarCubes/gtk/window.ui') +class SugarCubesWindow(Adw.ApplicationWindow): + __gtype_name__ = 'SugarCubesWindow' + + carousel = Gtk.Template.Child() + btn_start = Gtk.Template.Child() + btn_save = Gtk.Template.Child() + btn_close = Gtk.Template.Child() + switch_snap = Gtk.Template.Child() + switch_flatpak = Gtk.Template.Child() + switch_apport = Gtk.Template.Child() + page_welcome = -1 + page_configuration = 0 + page_progress = 1 + page_done = 2 + spinner = Gtk.Template.Child() + + def __init__(self, **kwargs): + super().__init__(**kwargs) + self.__config = Config( + snap=Preset.snap, + flatpak=Preset.flatpak, + apport=Preset.apport + ) + self.__buiild_ui() + self.__connect_signals() + + def __buiild_ui(self): + self.switch_snap.set_active(Preset.snap) + self.switch_flatpak.set_active(Preset.flatpak) + self.switch_apport.set_active(Preset.apport) + + def __connect_signals(self): + self.btn_start.connect('clicked', self.__on_btn_start_clicked) + self.btn_save.connect('clicked', self.on_btn_save_clicked) + self.btn_close.connect('clicked', self.on_btn_close_clicked) + self.switch_snap.connect('state-set', self.__on_switch_snap_state_set) + self.switch_flatpak.connect( + 'state-set', self.__on_switch_flatpak_state_set) + self.switch_apport.connect( + 'state-set', self.__on_switch_apport_state_set) + + def __show_page(self, page: int): + _page = self.carousel.get_nth_page(page + 1) + self.carousel.scroll_to(_page, True) + + def __on_btn_start_clicked(self, widget): + self.__show_page(self.page_configuration) + + def on_btn_save_clicked(self, widget): + def on_done(result, error=None): + self.spinner.stop() + self.__show_page(self.page_done) + + self.__show_page(self.page_progress) + self.spinner.start() + + RunAsync(Processor(self.__config).run, on_done) + + def __on_switch_snap_state_set(self, widget, state): + self.__config.snap = state + + def __on_switch_flatpak_state_set(self, widget, state): + self.__config.flatpak = state + + def __on_switch_apport_state_set(self, widget, state): + self.__config.apport = state + + def on_btn_close_clicked(self, widget): + self.get_application().quit() diff --git a/meson.build b/meson.build index 191d9cd..e750c8e 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ -project('pm.mirko.UbuntuSmoother', - version: '0.0.2', +project('io.github.vanilla-os.SugarCubes', + version: '0.0.3', meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', 'werror=false', @@ -11,7 +11,7 @@ i18n = import('i18n') gnome = import('gnome') subdir('data') -subdir('ubuntu_smoother') +subdir('sugar_cubes') subdir('po') gnome.post_install( diff --git a/po/meson.build b/po/meson.build index 7342ab1..88689b4 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1 +1 @@ -i18n.gettext('ubuntu-smoother', preset: 'glib') \ No newline at end of file +i18n.gettext('sugar-cubes', preset: 'glib') \ No newline at end of file diff --git a/ubuntu_smoother/gtk/window.ui b/ubuntu_smoother/gtk/window.ui index 1cfa040..c61d7ea 100644 --- a/ubuntu_smoother/gtk/window.ui +++ b/ubuntu_smoother/gtk/window.ui @@ -2,10 +2,10 @@ -