[gnome-software/603-gnome-software-reports-unknown-error-when-there-is-a-signing-issue: 47/48] gs-shell: Add a handler for the GsPluginLoader::ask-untrusted signal




commit 76991fe443f96cb9098b5b14a0048584f8b13fc6
Author: Milan Crha <mcrha redhat com>
Date:   Thu Oct 14 15:48:51 2021 +0200

    gs-shell: Add a handler for the GsPluginLoader::ask-untrusted signal
    
    Use the previously added function to handle the pre-previously
    added signal.

 src/gs-shell.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 9e2cde8c8..0d9cce652 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -415,6 +415,17 @@ gs_shell_basic_auth_start_cb (GsPluginLoader *plugin_loader,
                                  G_CALLBACK (gtk_window_destroy), dialog);
 }
 
+static gboolean
+gs_shell_ask_untrusted_cb (GsPluginLoader *plugin_loader,
+                          const gchar *title,
+                          const gchar *msg,
+                          const gchar *details,
+                          const gchar *accept_label,
+                          GsShell *shell)
+{
+       return gs_utils_ask_user_accepts (GTK_WINDOW (shell), title, msg, details, accept_label);
+}
+
 static void
 free_back_entry (BackEntry *entry)
 {
@@ -2194,6 +2205,9 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
        g_signal_connect_object (shell->plugin_loader, "basic-auth-start",
                                 G_CALLBACK (gs_shell_basic_auth_start_cb),
                                 shell, 0);
+       g_signal_connect_object (shell->plugin_loader, "ask-untrusted",
+                                G_CALLBACK (gs_shell_ask_untrusted_cb),
+                                shell, 0);
 
        g_object_bind_property (shell->plugin_loader, "allow-updates",
                                shell->pages[GS_SHELL_MODE_UPDATES], "visible",


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