[gnome-software] Actually show the error dialog for an invalid file



commit a9431070cf980a58aa2e0a5e0b6ca9fa52d09187
Author: Richard Hughes <richard hughsie com>
Date:   Wed Mar 16 09:18:47 2016 +0000

    Actually show the error dialog for an invalid file
    
    We have to use gs_shell_set_mode() after the response otherwise the modal error
    dialog gets closed automatically.

 src/gs-shell-details.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 895abe1..8f09798 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -1128,6 +1128,18 @@ gs_shell_details_app_refine_cb (GObject *source,
 }
 
 /**
+ * gs_shell_details_failed_response_cb:
+ **/
+static void
+gs_shell_details_failed_response_cb (GtkDialog *dialog,
+                                    gint response,
+                                    GsShellDetails *self)
+{
+       /* switch away from the details view that failed to load */
+       gs_shell_set_mode (self->shell, GS_SHELL_MODE_OVERVIEW);
+}
+
+/**
  * gs_shell_details_filename_to_app_cb:
  **/
 static void
@@ -1161,12 +1173,11 @@ gs_shell_details_filename_to_app_cb (GObject *source,
                                                 _("Sorry, this did not work"));
                gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
                                                          "%s", error->message);
+               g_signal_connect (dialog, "response",
+                                 G_CALLBACK (gs_shell_details_failed_response_cb), self);
                gs_shell_modal_dialog_present (self->shell, GTK_DIALOG (dialog));
 
                g_warning ("failed to convert to GsApp: %s", error->message);
-
-               /* Switch away from the details view that failed to load */
-               gs_shell_set_mode (self->shell, GS_SHELL_MODE_OVERVIEW);
                return;
        }
 


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