Commit a9431070 authored by Richard Hughes's avatar Richard Hughes
Browse files

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.
parent 08ca40fc
......@@ -1127,6 +1127,18 @@ gs_shell_details_app_refine_cb (GObject *source,
gs_shell_details_set_state (self, GS_SHELL_DETAILS_STATE_READY);
}
/**
* 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:
**/
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment