From 0260a1f17e731e99c07db974df11be172f382876 Mon Sep 17 00:00:00 2001 From: Danielle Fore Date: Thu, 25 Jan 2024 14:39:20 -0800 Subject: [PATCH 1/5] OperatingSystemView: use urgent icon if updates contain security --- src/DBus/SystemUpdate.vala | 1 + src/Views/OperatingSystemView.vala | 6 ++++++ src/meson.build | 1 + 3 files changed, 8 insertions(+) diff --git a/src/DBus/SystemUpdate.vala b/src/DBus/SystemUpdate.vala index 4929a5c2..5e9a16ca 100644 --- a/src/DBus/SystemUpdate.vala +++ b/src/DBus/SystemUpdate.vala @@ -17,6 +17,7 @@ public interface SystemUpdate : Object { public struct UpdateDetails { string[] packages; int size; + Pk.Info[] info; } public signal void state_changed (); diff --git a/src/Views/OperatingSystemView.vala b/src/Views/OperatingSystemView.vala index a8951c6b..352e929c 100644 --- a/src/Views/OperatingSystemView.vala +++ b/src/Views/OperatingSystemView.vala @@ -370,6 +370,12 @@ public class About.OperatingSystemView : Gtk.Box { details.packages.length ).printf (details.packages.length); + foreach (unowned var info in details.info) { + if (info == SECURITY) { + updates_image.icon_name = "software-update-urgent"; + } + } + packages.splice (0, packages.get_n_items (), details.packages); } catch (Error e) { updates_description.label = _("Unable to determine number of updates"); diff --git a/src/meson.build b/src/meson.build index 5c4edf49..bc8da285 100644 --- a/src/meson.build +++ b/src/meson.build @@ -38,6 +38,7 @@ shared_module( dependency('gtk4'), dependency('libadwaita-1'), dependency('libgtop-2.0'), + dependency('packagekit-glib2'), dependency('gudev-1.0'), dependency('udisks2'), appstream_dep, From 032b7c68bd796852d64594eb734fe912b13f3f84 Mon Sep 17 00:00:00 2001 From: Danielle Fore Date: Thu, 25 Jan 2024 14:44:55 -0800 Subject: [PATCH 2/5] Add PK to CI and README --- .github/workflows/main.yml | 2 +- README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de240b91..b0c55166 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: - name: Install Dependencies run: | apt update - apt install -y meson libadwaita-1-dev libfwupd-dev libgranite-7-dev libgtk-4-dev libgtop2-dev libgudev-1.0-dev libudisks2-dev libswitchboard-3-dev libappstream-dev valac + apt install -y meson libadwaita-1-dev libfwupd-dev libgranite-7-dev libgtk-4-dev libgtop2-dev libgudev-1.0-dev libudisks2-dev libswitchboard-3-dev libappstream-dev libpackagekit-glib2-deb valac - name: Build env: DESTDIR: out diff --git a/README.md b/README.md index 7e124621..1d9e3a9a 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ You'll need the following dependencies: * libudisks2-dev * libadwaita-1-dev * libappstream-dev +* libpackagekit-glib2-deb * meson * valac * switcheroo-control (at runtime) From 98a128d0c4ad5c7e490f02f2a3da97920a832bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 25 Jan 2024 14:50:07 -0800 Subject: [PATCH 3/5] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b0c55166..8bcc9b19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: - name: Install Dependencies run: | apt update - apt install -y meson libadwaita-1-dev libfwupd-dev libgranite-7-dev libgtk-4-dev libgtop2-dev libgudev-1.0-dev libudisks2-dev libswitchboard-3-dev libappstream-dev libpackagekit-glib2-deb valac + apt install -y meson libadwaita-1-dev libfwupd-dev libgranite-7-dev libgtk-4-dev libgtop2-dev libgudev-1.0-dev libudisks2-dev libswitchboard-3-dev libappstream-dev libpackagekit-glib2-dev valac - name: Build env: DESTDIR: out From b4e51c71cf42dee6a1b699cd7aae30adddf09d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Thu, 25 Jan 2024 14:50:19 -0800 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d9e3a9a..30c0432a 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ You'll need the following dependencies: * libudisks2-dev * libadwaita-1-dev * libappstream-dev -* libpackagekit-glib2-deb +* libpackagekit-glib2-dev * meson * valac * switcheroo-control (at runtime) From 96b901775f1826dce83592f9318f8dacbf36c144 Mon Sep 17 00:00:00 2001 From: Danielle Fore Date: Mon, 29 Jan 2024 08:53:16 -0800 Subject: [PATCH 5/5] Be smart --- src/Views/OperatingSystemView.vala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Views/OperatingSystemView.vala b/src/Views/OperatingSystemView.vala index e42abd0d..ebfd28eb 100644 --- a/src/Views/OperatingSystemView.vala +++ b/src/Views/OperatingSystemView.vala @@ -373,10 +373,8 @@ public class About.OperatingSystemView : Gtk.Box { details.packages.length ).printf (details.packages.length); - foreach (unowned var info in details.info) { - if (info == SECURITY) { - updates_image.icon_name = "software-update-urgent"; - } + if (Pk.Info.SECURITY in details.info) { + updates_image.icon_name = "software-update-urgent"; } packages.splice (0, packages.get_n_items (), details.packages);