[gnome-software] shell: Tweak which errors messages are shown for the DOWNLOAD action
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] shell: Tweak which errors messages are shown for the DOWNLOAD action
- Date: Wed, 24 Oct 2018 09:59:11 +0000 (UTC)
commit 02a77b7b885b14e33ad9599fa213887a767ba4b8
Author: Kalev Lember <klember redhat com>
Date: Tue Oct 23 17:37:41 2018 +0200
shell: Tweak which errors messages are shown for the DOWNLOAD action
We have nicely translated strings that all start with 'Unable to
download', which are a perfect match. Switch to using those for
GS_PLUGIN_ACTION_DOWNLOAD errors, and tweak the fallback error to show a
different error message depending on if it was a REFRESH or DOWNLOAD
failure.
This reuses existing strings and doesn't break 3.30 string freeze.
src/gs-shell.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 1ce69fd7..0d8383e9 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -977,6 +977,7 @@ gs_shell_show_event_refresh (GsShell *shell, GsPluginEvent *event)
GsShellEventButtons buttons = GS_SHELL_EVENT_BUTTON_NONE;
GsShellPrivate *priv = gs_shell_get_instance_private (shell);
const GError *error = gs_plugin_event_get_error (event);
+ GsPluginAction action = gs_plugin_event_get_action (event);
g_autofree gchar *str_origin = NULL;
g_autoptr(GString) str = g_string_new (NULL);
@@ -1046,8 +1047,13 @@ gs_shell_show_event_refresh (GsShell *shell, GsPluginEvent *event)
/* non-interactive generic */
if (!gs_plugin_event_has_flag (event, GS_PLUGIN_EVENT_FLAG_INTERACTIVE))
return FALSE;
- /* TRANSLATORS: failure text for the in-app notification */
- g_string_append (str, _("Unable to get list of updates"));
+ if (action == GS_PLUGIN_ACTION_DOWNLOAD) {
+ /* TRANSLATORS: failure text for the in-app notification */
+ g_string_append (str, _("Unable to download updates"));
+ } else {
+ /* TRANSLATORS: failure text for the in-app notification */
+ g_string_append (str, _("Unable to get list of updates"));
+ }
break;
}
if (str->len == 0)
@@ -1822,11 +1828,11 @@ gs_shell_show_event (GsShell *shell, GsPluginEvent *event)
action = gs_plugin_event_get_action (event);
switch (action) {
case GS_PLUGIN_ACTION_REFRESH:
+ case GS_PLUGIN_ACTION_DOWNLOAD:
return gs_shell_show_event_refresh (shell, event);
case GS_PLUGIN_ACTION_PURCHASE:
return gs_shell_show_event_purchase (shell, event);
case GS_PLUGIN_ACTION_INSTALL:
- case GS_PLUGIN_ACTION_DOWNLOAD:
return gs_shell_show_event_install (shell, event);
case GS_PLUGIN_ACTION_UPDATE:
return gs_shell_show_event_update (shell, event);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]