[gnome-software] Show an error message when we fail to load details about a local file
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Show an error message when we fail to load details about a local file
- Date: Fri, 12 Dec 2014 16:54:36 +0000 (UTC)
commit c09169032a2de46e8d8fc0bd5c6a21e7bfd8ee61
Author: Kalev Lember <kalevlember gmail com>
Date: Fri Dec 12 17:47:14 2014 +0100
Show an error message when we fail to load details about a local file
Let the user know what went wrong, instead of leaving the GUI in a
broken state with an endlessly spinning spinner and no feedback.
This reuses an existing string and doesn't break the translation freeze
for 3.14.x.
src/gs-shell-details.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 4dcd421..2d02b43 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -917,7 +917,24 @@ gs_shell_details_filename_to_app_cb (GObject *source,
res,
&error);
if (priv->app == NULL) {
+ GtkWidget *dialog;
+
+ dialog = gtk_message_dialog_new (gs_shell_get_window (priv->shell),
+ GTK_DIALOG_MODAL |
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ _("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 (gtk_widget_destroy), NULL);
+ gtk_window_present (GTK_WINDOW (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 (priv->shell, GS_SHELL_MODE_OVERVIEW);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]