PackageKit/0001-systemd-updates-Show-some-text-progress-when-the-off.patch

71 lines
2.7 KiB
Diff

From c0fa2592d0d4f7ef26b579e5d0e76544dfb16ab7 Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Fri, 1 Nov 2013 13:08:27 +0000
Subject: [PATCH] systemd-updates: Show some text progress when the offline
update is going on
---
contrib/systemd-updates/pk-offline-update.c | 12 +++++++++++-
po/POTFILES.in | 1 +
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/contrib/systemd-updates/pk-offline-update.c b/contrib/systemd-updates/pk-offline-update.c
index f9de773..cf862a4 100644
--- a/contrib/systemd-updates/pk-offline-update.c
+++ b/contrib/systemd-updates/pk-offline-update.c
@@ -20,6 +20,7 @@
*/
#include <glib.h>
+#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include <gio/gio.h>
#include <packagekit-glib2/packagekit.h>
@@ -143,6 +144,12 @@ pk_offline_update_progress_cb (PkProgress *progress,
if (percentage < 0)
goto out;
+ /* TRANSLATORS: this is the message we send plymouth to
+ * advise of the new percentage completion */
+ msg = g_strdup_printf ("%s - %i%%", _("Installing Updates"), percentage);
+ if (percentage > 10)
+ pk_offline_update_set_plymouth_msg (msg);
+
/* print on terminal */
pk_progress_bar_set_percentage (progressbar, percentage);
@@ -176,7 +183,8 @@ pk_offline_update_reboot (void)
/* reboot using systemd */
pk_offline_update_set_plymouth_mode ("shutdown");
- pk_offline_update_set_plymouth_msg ("Rebooting after installing updates...");
+ /* TRANSLATORS: we've finished doing offline updates */
+ pk_offline_update_set_plymouth_msg (_("Rebooting after installing updates…"));
connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
if (connection == NULL) {
g_warning ("Failed to get system bus connection: %s",
@@ -481,6 +489,8 @@ main (int argc, char *argv[])
task = pk_task_new ();
pk_task_set_interactive (task, FALSE);
pk_offline_update_set_plymouth_mode ("updates");
+ /* TRANSLATORS: we've started doing offline updates */
+ pk_offline_update_set_plymouth_msg (_("Installing updates, this could take a while…"));
package_ids = g_strsplit (packages_data, "\n", -1);
pk_offline_update_write_dummy_results (package_ids);
results = pk_client_update_packages (PK_CLIENT (task),
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4a06d8b..7964c76 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -8,6 +8,7 @@ contrib/browser-plugin/pk-plugin-install.c
contrib/command-not-found/pk-command-not-found.c
contrib/debuginfo-install/pk-debuginfo-install.c
contrib/device-rebind/pk-device-rebind.c
+contrib/systemd-updates/pk-offline-update.c
data/packagekit-catalog.xml.in
data/packagekit-package-list.xml.in
data/packagekit-servicepack.xml.in
--
1.8.3.1