Blob Blame History Raw
From 4e5d2fccdd2432ffc8ef4d56d4490cccca5306c9 Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Mon, 4 Jul 2016 10:37:46 +0200
Subject: [PATCH 1/3] Add a dialog to confirm upgrade removals

https://bugzilla.redhat.com/show_bug.cgi?id=1336530
---
 po/POTFILES.in                   |   1 +
 src/Makefile.am                  |   3 +
 src/gnome-software.gresource.xml |   1 +
 src/gs-removal-dialog.c          | 182 +++++++++++++++++++++++++++++++++++++++
 src/gs-removal-dialog.h          |  43 +++++++++
 src/gs-removal-dialog.ui         |  51 +++++++++++
 src/gs-shell-updates.c           |  82 ++++++++++++++++--
 7 files changed, 354 insertions(+), 9 deletions(-)
 create mode 100644 src/gs-removal-dialog.c
 create mode 100644 src/gs-removal-dialog.h
 create mode 100644 src/gs-removal-dialog.ui

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 643ab04..48f4037 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -26,6 +26,7 @@ src/gs-main.c
 src/gs-page.c
 src/gs-plugin-loader.c
 src/gs-popular-tile.c
+[type: gettext/glade]src/gs-removal-dialog.ui
 src/gs-review-dialog.c
 [type: gettext/glade]src/gs-review-dialog.ui
 [type: gettext/glade]src/gs-review-histogram.ui
diff --git a/src/Makefile.am b/src/Makefile.am
index e8919b1..36dba36 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -41,6 +41,7 @@ UI_FILES =						\
 	gs-history-dialog.ui				\
 	gs-menus.ui					\
 	gs-popular-tile.ui				\
+	gs-removal-dialog.ui				\
 	gs-review-dialog.ui				\
 	gs-review-histogram.ui				\
 	gs-review-row.ui				\
@@ -157,6 +158,8 @@ gnome_software_SOURCES =				\
 	gs-plugin.h					\
 	gs-progress-button.c				\
 	gs-progress-button.h				\
+	gs-removal-dialog.c				\
+	gs-removal-dialog.h				\
 	gs-review.c					\
 	gs-review.h					\
 	gs-review-bar.c					\
diff --git a/src/gnome-software.gresource.xml b/src/gnome-software.gresource.xml
index 73600ae..c41ac35 100644
--- a/src/gnome-software.gresource.xml
+++ b/src/gnome-software.gresource.xml
@@ -13,6 +13,7 @@
   <file preprocess="xml-stripblanks">gs-first-run-dialog.ui</file>
   <file preprocess="xml-stripblanks">gs-history-dialog.ui</file>
   <file preprocess="xml-stripblanks">gs-popular-tile.ui</file>
+  <file preprocess="xml-stripblanks">gs-removal-dialog.ui</file>
   <file preprocess="xml-stripblanks">gs-review-dialog.ui</file>
   <file preprocess="xml-stripblanks">gs-review-histogram.ui</file>
   <file preprocess="xml-stripblanks">gs-review-row.ui</file>
diff --git a/src/gs-removal-dialog.c b/src/gs-removal-dialog.c
new file mode 100644
index 0000000..9afa6c0
--- /dev/null
+++ b/src/gs-removal-dialog.c
@@ -0,0 +1,182 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2016 Kalev Lember <klember@redhat.com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * 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 2 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+
+#include "gs-removal-dialog.h"
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
+struct _GsRemovalDialog
+{
+	GtkMessageDialog	 parent_instance;
+	GtkWidget		*listbox;
+	GtkWidget		*scrolledwindow;
+};
+
+G_DEFINE_TYPE (GsRemovalDialog, gs_removal_dialog, GTK_TYPE_MESSAGE_DIALOG)
+
+static void
+list_header_func (GtkListBoxRow *row,
+                  GtkListBoxRow *before,
+                  gpointer user_data)
+{
+	GtkWidget *header = NULL;
+	if (before != NULL)
+		header = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+	gtk_list_box_row_set_header (row, header);
+}
+
+static gint
+list_sort_func (GtkListBoxRow *a,
+                GtkListBoxRow *b,
+                gpointer user_data)
+{
+	GObject *o1 = G_OBJECT (gtk_bin_get_child (GTK_BIN (a)));
+	GObject *o2 = G_OBJECT (gtk_bin_get_child (GTK_BIN (b)));
+	const gchar *key1 = g_object_get_data (o1, "sort");
+	const gchar *key2 = g_object_get_data (o2, "sort");
+	return g_strcmp0 (key1, key2);
+}
+
+static void
+add_app (GtkListBox *listbox, GsApp *app)
+{
+	GtkWidget *box;
+	GtkWidget *widget;
+	GtkWidget *row;
+
+	box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+	gtk_widget_set_margin_top (box, 12);
+	gtk_widget_set_margin_start (box, 12);
+	gtk_widget_set_margin_bottom (box, 12);
+	gtk_widget_set_margin_end (box, 12);
+
+	widget = gtk_label_new (gs_app_get_name (app));
+	gtk_widget_set_halign (widget, GTK_ALIGN_START);
+	gtk_label_set_ellipsize (GTK_LABEL (widget), PANGO_ELLIPSIZE_END);
+	gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 0);
+
+	g_object_set_data_full (G_OBJECT (box),
+	                        "sort",
+	                        g_utf8_casefold (gs_app_get_name (app), -1),
+	                        g_free);
+
+	gtk_list_box_prepend (listbox, box);
+	gtk_widget_show (widget);
+	gtk_widget_show (box);
+
+	row = gtk_widget_get_parent (box);
+	gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (row), FALSE);
+}
+
+static void
+insert_details_widget (GtkMessageDialog *dialog, GtkWidget *widget)
+{
+	GList *children, *l;
+	GtkWidget *message_area;
+
+	message_area = gtk_message_dialog_get_message_area (dialog);
+	g_assert (GTK_IS_BOX (message_area));
+
+	/* find all label children and set the width chars properties */
+	children = gtk_container_get_children (GTK_CONTAINER (message_area));
+	for (l = children; l != NULL; l = l->next) {
+		if (!GTK_IS_LABEL (l->data))
+			continue;
+
+		gtk_label_set_width_chars (GTK_LABEL (l->data), 40);
+		gtk_label_set_max_width_chars (GTK_LABEL (l->data), 40);
+	}
+
+	gtk_container_add (GTK_CONTAINER (message_area), widget);
+}
+
+void
+gs_removal_dialog_show_upgrade_removals (GsRemovalDialog *self,
+                                         GsApp *upgrade)
+{
+	GPtrArray *removals;
+	guint i;
+	g_autofree gchar *name_version = NULL;
+
+	name_version = g_strdup_printf ("%s %s",
+	                                gs_app_get_name (upgrade),
+	                                gs_app_get_version (upgrade));
+	/* TRANSLATORS: This is a text displayed during a distro upgrade. %s
+	   will be replaced by the name and version of distro, e.g. 'Fedora 23'. */
+	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (self),
+	                                          _("Some of the currently installed software is not compatible with %s. "
+	                                            "If you continue, the following will be automatically removed during the upgrade:"),
+	                                          name_version);
+
+	removals = gs_app_get_related (upgrade);
+	for (i = 0; i < removals->len; i++) {
+		GsApp *app = g_ptr_array_index (removals, i);
+		g_autofree gchar *tmp = NULL;
+
+		if (gs_app_get_state (app) != AS_APP_STATE_UNAVAILABLE)
+			continue;
+		tmp = gs_app_to_string (app);
+		g_debug ("removal %d: %s", i, tmp);
+		add_app (GTK_LIST_BOX (self->listbox), app);
+	}
+}
+
+static void
+gs_removal_dialog_init (GsRemovalDialog *self)
+{
+	gtk_widget_init_template (GTK_WIDGET (self));
+
+	insert_details_widget (GTK_MESSAGE_DIALOG (self), self->scrolledwindow);
+
+	gtk_list_box_set_header_func (GTK_LIST_BOX (self->listbox),
+	                              list_header_func,
+	                              self,
+	                              NULL);
+	gtk_list_box_set_sort_func (GTK_LIST_BOX (self->listbox),
+	                            list_sort_func,
+	                            self, NULL);
+}
+
+static void
+gs_removal_dialog_class_init (GsRemovalDialogClass *klass)
+{
+	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+	gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-removal-dialog.ui");
+
+	gtk_widget_class_bind_template_child (widget_class, GsRemovalDialog, listbox);
+	gtk_widget_class_bind_template_child (widget_class, GsRemovalDialog, scrolledwindow);
+}
+
+GtkWidget *
+gs_removal_dialog_new (void)
+{
+	GsRemovalDialog *dialog;
+
+	dialog = g_object_new (GS_TYPE_REMOVAL_DIALOG,
+	                       NULL);
+	return GTK_WIDGET (dialog);
+}
+
+/* vim: set noexpandtab: */
diff --git a/src/gs-removal-dialog.h b/src/gs-removal-dialog.h
new file mode 100644
index 0000000..9c1d586
--- /dev/null
+++ b/src/gs-removal-dialog.h
@@ -0,0 +1,43 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2016 Kalev Lember <klember@redhat.com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * 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 2 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef GS_REMOVAL_DIALOG_H
+#define GS_REMOVAL_DIALOG_H
+
+#include <gtk/gtk.h>
+
+#include "gs-app.h"
+
+G_BEGIN_DECLS
+
+#define GS_TYPE_REMOVAL_DIALOG (gs_removal_dialog_get_type ())
+
+G_DECLARE_FINAL_TYPE (GsRemovalDialog, gs_removal_dialog, GS, REMOVAL_DIALOG, GtkMessageDialog)
+
+GtkWidget	*gs_removal_dialog_new				(void);
+void		 gs_removal_dialog_show_upgrade_removals	(GsRemovalDialog	 *self,
+								 GsApp			 *upgrade);
+
+G_END_DECLS
+
+#endif /* GS_REMOVAL_DIALOG_H */
+
+/* vim: set noexpandtab: */
diff --git a/src/gs-removal-dialog.ui b/src/gs-removal-dialog.ui
new file mode 100644
index 0000000..b6ba829
--- /dev/null
+++ b/src/gs-removal-dialog.ui
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkScrolledWindow" id="scrolledwindow">
+    <property name="visible">True</property>
+    <property name="can_focus">True</property>
+    <property name="min_content_height">160</property>
+    <property name="hscrollbar_policy">never</property>
+    <property name="vscrollbar_policy">automatic</property>
+    <property name="shadow_type">none</property>
+    <child>
+      <object class="GtkFrame" id="frame">
+        <property name="visible">True</property>
+        <property name="shadow_type">in</property>
+        <property name="halign">fill</property>
+        <property name="valign">start</property>
+        <child>
+          <object class="GtkListBox" id="listbox">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="selection_mode">none</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+  <template class="GsRemovalDialog" parent="GtkMessageDialog">
+    <property name="text" translatable="yes">Incompatible Software</property>
+    <property name="modal">True</property>
+    <property name="destroy_with_parent">True</property>
+    <child type="action">
+      <object class="GtkButton" id="button_cancel">
+        <property name="visible">True</property>
+        <property name="label" translatable="yes">_Cancel</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child type="action">
+      <object class="GtkButton" id="button_continue">
+        <property name="visible">True</property>
+        <property name="label" translatable="yes">_Continue</property>
+        <property name="use_underline">True</property>
+        <property name="can_default">True</property>
+        <property name="receives_default">True</property>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="accept" default="true">button_continue</action-widget>
+      <action-widget response="cancel">button_cancel</action-widget>
+    </action-widgets>
+  </template>
+</interface>
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index 6bfaa41..31e5617 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -29,6 +29,7 @@
 #include "gs-utils.h"
 #include "gs-app.h"
 #include "gs-app-row.h"
+#include "gs-removal-dialog.h"
 #include "gs-update-dialog.h"
 #include "gs-update-list.h"
 #include "gs-update-monitor.h"
@@ -588,6 +589,7 @@ gs_shell_updates_load (GsShellUpdates *self)
 
 	/* don't refresh every each time */
 	if ((self->result_flags & GS_SHELL_UPDATES_FLAG_HAS_UPGRADES) == 0) {
+		refine_flags |= GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPGRADE_REMOVED;
 		gs_plugin_loader_get_distro_upgrades_async (self->plugin_loader,
 							    refine_flags,
 							    self->cancellable,
@@ -1137,23 +1139,85 @@ upgrade_trigger_finished_cb (GObject *source,
 }
 
 static void
+trigger_upgrade (GsShellUpdates *self)
+{
+	GsApp *upgrade;
+
+	upgrade = gs_upgrade_banner_get_app (GS_UPGRADE_BANNER (self->upgrade_banner));
+	if (upgrade == NULL) {
+		g_warning ("no upgrade available to install");
+		return;
+	}
+
+	gs_plugin_loader_app_action_async (self->plugin_loader,
+	                                   upgrade,
+	                                   GS_PLUGIN_LOADER_ACTION_UPGRADE_TRIGGER,
+	                                   self->cancellable,
+	                                   upgrade_trigger_finished_cb,
+	                                   self);
+}
+
+static void
+gs_shell_updates_upgrade_confirm_cb (GtkDialog *dialog,
+                                     GtkResponseType response_type,
+                                     GsShellUpdates *self)
+{
+	/* unmap the dialog */
+	gtk_widget_destroy (GTK_WIDGET (dialog));
+
+	switch (response_type) {
+	case GTK_RESPONSE_ACCEPT:
+		g_debug ("agreed to upgrade removing apps");
+		trigger_upgrade (self);
+		break;
+	case GTK_RESPONSE_CANCEL:
+		g_debug ("cancelled removal dialog");
+		break;
+	case GTK_RESPONSE_DELETE_EVENT:
+		break;
+	default:
+		g_assert_not_reached ();
+	}
+}
+
+static void
 gs_shell_updates_upgrade_install_cb (GsUpgradeBanner *upgrade_banner,
                                      GsShellUpdates *self)
 {
-	GsApp *app;
+	GPtrArray *removals;
+	GsApp *upgrade;
+	GtkWidget *dialog;
+	guint cnt = 0;
+	guint i;
 
-	app = gs_upgrade_banner_get_app (upgrade_banner);
-	if (app == NULL) {
+	upgrade = gs_upgrade_banner_get_app (GS_UPGRADE_BANNER (self->upgrade_banner));
+	if (upgrade == NULL) {
 		g_warning ("no upgrade available to install");
 		return;
 	}
 
-	gs_plugin_loader_app_action_async (self->plugin_loader,
-					   app,
-					   GS_PLUGIN_LOADER_ACTION_UPGRADE_TRIGGER,
-					   self->cancellable,
-					   upgrade_trigger_finished_cb,
-					   self);
+	/* count the removals */
+	removals = gs_app_get_related (upgrade);
+	for (i = 0; i < removals->len; i++) {
+		GsApp *app = g_ptr_array_index (removals, i);
+		if (gs_app_get_state (app) != AS_APP_STATE_UNAVAILABLE)
+			continue;
+		cnt++;
+	}
+
+	if (cnt == 0) {
+		/* no need for a removal confirmation dialog */
+		trigger_upgrade (self);
+		return;
+	}
+
+	dialog = gs_removal_dialog_new ();
+	g_signal_connect (dialog, "response",
+	                  G_CALLBACK (gs_shell_updates_upgrade_confirm_cb),
+	                  self);
+	gs_removal_dialog_show_upgrade_removals (GS_REMOVAL_DIALOG (dialog),
+	                                         upgrade);
+	gs_shell_modal_dialog_present (self->shell, GTK_DIALOG (dialog));
 }
 
 static void
-- 
2.9.3


From c3872cae686a63f17f5ec9c035dae3c139cfae2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Dr=C4=85g?= <piotrdrag@gmail.com>
Date: Tue, 12 Jul 2016 15:32:53 +0200
Subject: [PATCH 2/3] Updated POTFILES.in

---
 po/POTFILES.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 48f4037..a948457 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -26,6 +26,7 @@ src/gs-main.c
 src/gs-page.c
 src/gs-plugin-loader.c
 src/gs-popular-tile.c
+src/gs-removal-dialog.c
 [type: gettext/glade]src/gs-removal-dialog.ui
 src/gs-review-dialog.c
 [type: gettext/glade]src/gs-review-dialog.ui
-- 
2.9.3


From 98d5a670425c30f4ce9a76842f7ab7884531668a Mon Sep 17 00:00:00 2001
From: Kalev Lember <klember@redhat.com>
Date: Tue, 12 Jul 2016 19:13:50 +0200
Subject: [PATCH 3/3] Show a better error message when downloading a distro
 upgrade fails

This is a backport of commits e07c324 and 0c271ef together with
translation updates.
---
 po/ar.po       |  6 ++++++
 po/ca.po       |  6 ++++++
 po/cs.po       |  6 ++++++
 po/da.po       |  6 ++++++
 po/de.po       |  6 ++++++
 po/en_GB.po    |  6 ++++++
 po/eo.po       |  7 +++++++
 po/es.po       |  6 ++++++
 po/eu.po       |  6 ++++++
 po/fi.po       |  6 ++++++
 po/fr.po       |  6 ++++++
 po/fur.po      |  6 ++++++
 po/gd.po       |  6 ++++++
 po/gl.po       |  6 ++++++
 po/he.po       |  6 ++++++
 po/hu.po       |  6 ++++++
 po/it.po       |  7 +++++++
 po/kk.po       |  6 ++++++
 po/ko.po       |  6 ++++++
 po/lt.po       |  6 ++++++
 po/lv.po       |  7 +++++++
 po/nb.po       |  6 ++++++
 po/nl.po       |  6 ++++++
 po/pa.po       |  7 +++++++
 po/pt.po       |  6 ++++++
 po/pt_BR.po    |  6 ++++++
 po/sk.po       |  6 ++++++
 po/sr.po       |  6 ++++++
 po/sr@latin.po |  6 ++++++
 po/sv.po       |  6 ++++++
 po/tr.po       |  6 ++++++
 po/uk.po       |  7 +++++++
 po/zh_TW.po    |  6 ++++++
 src/gs-utils.c | 10 +++++++++-
 34 files changed, 212 insertions(+), 1 deletion(-)

diff --git a/po/ar.po b/po/ar.po
index d5ac8a8..31c6dcc 100644
--- a/po/ar.po
+++ b/po/ar.po
@@ -2060,3 +2060,9 @@ msgstr "_عنْ"
 #: ../src/menus.ui.h:3
 msgid "_Quit"
 msgstr "أ_نهِ"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "فشلت ترقية %s."
diff --git a/po/ca.po b/po/ca.po
index 227e7b7..be847a3 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -2923,3 +2923,9 @@ msgstr "Extensions del Shell"
 #~ msgid_plural "%i applications and %i add-ons installed"
 #~ msgstr[0] "S'ha instal·lat %i aplicació i %i connector"
 #~ msgstr[1] "S'ha instal·lat %i aplicacions i %i connectors"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Ha fallat l'actualització de %s."
diff --git a/po/cs.po b/po/cs.po
index 0bbdc3b..28b3163 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -2882,3 +2882,9 @@ msgstr "Rozšíření Shellu"
 msgctxt "Menu subcategory of Add-ons"
 msgid "Localization"
 msgstr "Lokalizace"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Povýšení na %s selhalo."
diff --git a/po/da.po b/po/da.po
index 1b03a4c..8c2a7bc 100644
--- a/po/da.po
+++ b/po/da.po
@@ -3002,3 +3002,9 @@ msgstr "Lokalisering"
 
 #~ msgid "Requires restart"
 #~ msgstr "Kræver genstart"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Opgradering til %s mislykkedes."
diff --git a/po/de.po b/po/de.po
index c529837..bb0e227 100644
--- a/po/de.po
+++ b/po/de.po
@@ -3042,3 +3042,9 @@ msgstr "Lokalisierung"
 
 #~ msgid "Getting software details…"
 #~ msgstr "Software-Details werden ermittelt …"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Aktualisierung auf %s ist fehlgeschlagen."
diff --git a/po/en_GB.po b/po/en_GB.po
index 12b4066..cc7cc34 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -899,3 +899,9 @@ msgstr "Language Packs"
 #: ../src/plugins/gs-plugin-packagekit-refine.c:347
 msgid "No update details were provided"
 msgstr "No update details were provided"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Upgrade to %s failed."
diff --git a/po/eo.po b/po/eo.po
index 7aca50e..e828c95 100644
--- a/po/eo.po
+++ b/po/eo.po
@@ -2375,3 +2375,10 @@ msgstr "Ĉ_esi"
 
 #~ msgid "Proprietary"
 #~ msgstr "Mallibere"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, fuzzy, c-format
+#| msgid "Removal of %s failed."
+msgid "Upgrade to %s failed."
+msgstr "Forigo de %s malsukcesis."
diff --git a/po/es.po b/po/es.po
index 05833a6..4325e76 100644
--- a/po/es.po
+++ b/po/es.po
@@ -3241,3 +3241,9 @@ msgstr "PIN"
 #: ../src/gs-auth-dialog.ui.h:9
 msgid "Continue"
 msgstr "Continuar"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Falló la actualización a %s."
diff --git a/po/eu.po b/po/eu.po
index fc1c320..7a9a148 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -2969,3 +2969,9 @@ msgstr "Lokalizazioa"
 #~ msgctxt "Menu subcategory of Addons"
 #~ msgid "Language Packs"
 #~ msgstr "Hizkuntza-paketeak"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Huts egin du '%s' bertsio-berritzean."
diff --git a/po/fi.po b/po/fi.po
index 2b0594f..59a8081 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -2938,3 +2938,9 @@ msgstr "Lokalisointi"
 
 #~ msgid "Picks"
 #~ msgstr "Valikoidut"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Päivitys versioon %s epäonnistui."
diff --git a/po/fr.po b/po/fr.po
index fb47704..eab561b 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -2898,3 +2898,9 @@ msgstr "Extensions Shell"
 msgctxt "Menu subcategory of Add-ons"
 msgid "Localization"
 msgstr "Régionalisation"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "La mise à niveau de %s a échoué."
diff --git a/po/fur.po b/po/fur.po
index a644d92..de372c7 100644
--- a/po/fur.po
+++ b/po/fur.po
@@ -2884,3 +2884,9 @@ msgstr "Estensions di Shell"
 msgctxt "Menu subcategory of Add-ons"
 msgid "Localization"
 msgstr "Localizazion"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Avanzament a %s falît."
diff --git a/po/gd.po b/po/gd.po
index aa5d39a..60598cc 100644
--- a/po/gd.po
+++ b/po/gd.po
@@ -3030,3 +3030,9 @@ msgstr "Ionadaileadh"
 
 #~ msgid "Ubuntu Snappy Store"
 #~ msgstr "Bùth Ubuntu Snappy"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:185
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Cha deach leinn ùrachadh gu %s."
diff --git a/po/gl.po b/po/gl.po
index 4b5dc9b..66e0ddc 100644
--- a/po/gl.po
+++ b/po/gl.po
@@ -3150,3 +3150,9 @@ msgstr "Localización"
 #~ "desktop file..."
 #~ msgstr ""
 #~ "O autor deste software non incluíu unha «Descrición» no ficheiro desktop…"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Fallou a actualización a %s."
diff --git a/po/he.po b/po/he.po
index 76cc4c1..e59f8c2 100644
--- a/po/he.po
+++ b/po/he.po
@@ -2460,3 +2460,9 @@ msgstr "י_ציאה"
 
 #~ msgid "Printing"
 #~ msgstr "הדפסה"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "שדרוג ל־%s נכשל."
diff --git a/po/hu.po b/po/hu.po
index 2592211..85bf69b 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -3104,3 +3104,9 @@ msgstr "Lokalizáció"
 
 #~ msgid "Requires restart"
 #~ msgstr "Újraindítást igényel"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Frissítés erre: %s sikertelen."
diff --git a/po/it.po b/po/it.po
index 4d59239..7cdb5b4 100644
--- a/po/it.po
+++ b/po/it.po
@@ -2848,3 +2848,10 @@ msgstr "Estensioni Shell"
 msgctxt "Menu subcategory of Add-ons"
 msgid "Localization"
 msgstr "Localizzazione"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+#| msgid "Unable to upgrade to %s as download failed"
+msgid "Upgrade to %s failed."
+msgstr "Avanzamento a %s non riuscito."
diff --git a/po/kk.po b/po/kk.po
index bb07bdf..1ad809e 100644
--- a/po/kk.po
+++ b/po/kk.po
@@ -2843,3 +2843,9 @@ msgstr "Локализация"
 #~ msgid "%i application and %i add-ons installed"
 #~ msgid_plural "%i applications and %i add-ons installed"
 #~ msgstr[0] "%i қолданба және %i қосымша орнатылды"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "%s дейін жаңартылу сәтсіз аяқталды."
diff --git a/po/ko.po b/po/ko.po
index 7e3bc5f..1f63655 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -2788,3 +2788,9 @@ msgstr "쉘 확장 기능"
 msgctxt "Menu subcategory of Add-ons"
 msgid "Localization"
 msgstr "지역화"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "%s 업그레이드에 실패했습니다."
diff --git a/po/lt.po b/po/lt.po
index 9dff5c4..84a7a52 100644
--- a/po/lt.po
+++ b/po/lt.po
@@ -2934,3 +2934,9 @@ msgstr "Lokalizacija"
 #~ msgstr[0] "Įdiegta %i programa(-os) ir %i priedas(-ai)"
 #~ msgstr[1] "Įdiegta %i programa(-os) ir %i priedas(-ai)"
 #~ msgstr[2] "Įdiegta %i programa(-os) ir %i priedas(-ai)"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Nepavyko atnaujinti %s."
diff --git a/po/lv.po b/po/lv.po
index b878d62..36be777 100644
--- a/po/lv.po
+++ b/po/lv.po
@@ -2831,3 +2831,10 @@ msgstr "Lokalizācija"
 
 #~ msgid "No AppStream data found"
 #~ msgstr "Nav atrastu AppStream datu"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+#| msgid "Removal of %s failed."
+msgid "Upgrade to %s failed."
+msgstr "Neizdevās %s uzlabošana."
diff --git a/po/nb.po b/po/nb.po
index 2ff42f8..d20f48a 100644
--- a/po/nb.po
+++ b/po/nb.po
@@ -2806,3 +2806,9 @@ msgstr "Utvidelser for skallet"
 msgctxt "Menu subcategory of Add-ons"
 msgid "Localization"
 msgstr "Lokalisering"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Oppgradering til %s feilet."
diff --git a/po/nl.po b/po/nl.po
index 22fbbb1..5f5c392 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -2846,3 +2846,9 @@ msgctxt "Menu subcategory of Add-ons"
 msgid "Localization"
 msgstr "Lokalisatie"
 
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Opwaarderen naar %s is mislukt."
diff --git a/po/pa.po b/po/pa.po
index 2b411da..d46bb02 100644
--- a/po/pa.po
+++ b/po/pa.po
@@ -2246,3 +2246,10 @@ msgstr "ਬੰਦ ਕਰੋ(_Q)"
 
 #~ msgid "Requires restart"
 #~ msgstr "ਮੁੜ-ਚਾਲੂ ਕਰਨ ਦੀ ਲੋੜ"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, fuzzy, c-format
+#| msgid "Removal of %s failed."
+msgid "Upgrade to %s failed."
+msgstr "%s ਹਟਾਉਣ ਲਈ ਫੇਲ੍ਹ ਹੈ।"
diff --git a/po/pt.po b/po/pt.po
index fd0532d..2433bbc 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -2879,3 +2879,9 @@ msgstr "Extensões da interface do GNOME"
 msgctxt "Menu subcategory of Add-ons"
 msgid "Localization"
 msgstr "Localização"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Falha ao atualizar %s."
diff --git a/po/pt_BR.po b/po/pt_BR.po
index f3244d1..3454abc 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -3142,3 +3142,9 @@ msgstr "Localização"
 
 #~ msgid "Printing"
 #~ msgstr "Impressão"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "A atualização para %s falhou."
diff --git a/po/sk.po b/po/sk.po
index 5980222..8bce116 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -3036,3 +3036,9 @@ msgstr "Lokalizácia"
 
 #~ msgid "Enable"
 #~ msgstr "Povoliť"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Aktualizácia na %s zlyhala."
diff --git a/po/sr.po b/po/sr.po
index 0a38656..a36cbc4 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -3053,3 +3053,9 @@ msgstr "Превод"
 
 #~ msgid "_Updates (%d)"
 #~ msgstr "_Освежења (%d)"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Надоградња на „%s“ није успела."
diff --git a/po/sr@latin.po b/po/sr@latin.po
index 0791272..3e3a401 100644
--- a/po/sr@latin.po
+++ b/po/sr@latin.po
@@ -3053,3 +3053,9 @@ msgstr "Prevod"
 
 #~ msgid "_Updates (%d)"
 #~ msgstr "_Osveženja (%d)"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Nadogradnja na „%s“ nije uspela."
diff --git a/po/sv.po b/po/sv.po
index bb5e478..60bfb62 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -2958,3 +2958,9 @@ msgstr "Lokalisering"
 
 #~ msgid "Enable"
 #~ msgstr "Aktivera"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "Uppgradering till %s misslyckades."
diff --git a/po/tr.po b/po/tr.po
index 38dfe7e..8bebe8b 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -2961,3 +2961,9 @@ msgstr "Yerelleştirme"
 
 #~ msgid "Enable"
 #~ msgstr "Etkinleştir"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "%s'e yükseltme başarısız oldu."
diff --git a/po/uk.po b/po/uk.po
index ae766c0..53f6b2e 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -2969,3 +2969,10 @@ msgstr "Локалізація"
 
 #~ msgid "Last"
 #~ msgstr "Востаннє"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+#| msgid "Removal of %s failed."
+msgid "Upgrade to %s failed."
+msgstr "Не вдалось оновити до %s."
diff --git a/po/zh_TW.po b/po/zh_TW.po
index f6220ad..1c19351 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -2979,3 +2979,9 @@ msgstr "在地化"
 
 #~ msgid "_Updates (%d)"
 #~ msgstr "更新 (%d)(_U)"
+
+#. TRANSLATORS: this is when the upgrade download fails
+#: ../src/gs-common.c:182
+#, c-format
+msgid "Upgrade to %s failed."
+msgstr "%s 的升級失敗。"
diff --git a/src/gs-utils.c b/src/gs-utils.c
index 15702f6..a806ce8 100644
--- a/src/gs-utils.c
+++ b/src/gs-utils.c
@@ -169,7 +169,6 @@ gs_app_notify_failed_modal (GsApp *app,
 	msg = g_string_new ("");
 	switch (action) {
 	case GS_PLUGIN_LOADER_ACTION_INSTALL:
-	case GS_PLUGIN_LOADER_ACTION_UPGRADE_DOWNLOAD:
 		/* TRANSLATORS: this is when the install fails */
 		g_string_append_printf (msg, _("Installation of %s failed."),
 					gs_app_get_name (app));
@@ -179,6 +178,15 @@ gs_app_notify_failed_modal (GsApp *app,
 		g_string_append_printf (msg, _("Removal of %s failed."),
 					gs_app_get_name (app));
 		break;
+	case GS_PLUGIN_LOADER_ACTION_UPGRADE_DOWNLOAD:
+	{
+		g_autofree gchar *name_version = g_strdup_printf ("%s %s",
+		                                                  gs_app_get_name (app),
+		                                                  gs_app_get_version (app));
+		/* TRANSLATORS: this is when the upgrade download fails */
+		g_string_append_printf (msg, _("Upgrade to %s failed."), name_version);
+		break;
+	}
 	default:
 		g_assert_not_reached ();
 		break;
-- 
2.9.3