[gnome-software] Handle clicking 'cancel' on the gnome-shell extension download dialog



commit 49035873ca11225b341b017b248797fa3aa92633
Author: Richard Hughes <richard hughsie com>
Date:   Wed Mar 2 15:20:48 2016 +0000

    Handle clicking 'cancel' on the gnome-shell extension download dialog

 src/plugins/gs-plugin-shell-extensions.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-shell-extensions.c b/src/plugins/gs-plugin-shell-extensions.c
index a57d85c..3becb1d 100644
--- a/src/plugins/gs-plugin-shell-extensions.c
+++ b/src/plugins/gs-plugin-shell-extensions.c
@@ -787,6 +787,16 @@ gs_plugin_app_install (GsPlugin *plugin,
        if (retval == NULL)
                return FALSE;
        g_variant_get (retval, "(&s)", &retstr);
+
+       /* user declined download */
+       if (g_strcmp0 (retstr, "cancelled") == 0) {
+               g_set_error (error,
+                            GS_PLUGIN_ERROR,
+                            GS_PLUGIN_ERROR_CANCELLED,
+                            "extension %s download was cancelled",
+                            gs_app_get_id (app));
+               return FALSE;
+       }
        g_debug ("shell returned: %s", retstr);
        return TRUE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]