[recipes] Show an error dialog for when sharing fails



commit cb70aca9e51c5ddd7616244e0f2ff47d3a472dec
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Feb 7 12:42:06 2017 -0500

    Show an error dialog for when sharing fails
    
    With this temporary implementation, there are a bunch of error
    conditions, such as nautilus-sendo not being installed.

 src/gr-recipe-exporter.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/gr-recipe-exporter.c b/src/gr-recipe-exporter.c
index af20aa9..946c225 100644
--- a/src/gr-recipe-exporter.c
+++ b/src/gr-recipe-exporter.c
@@ -204,7 +204,23 @@ completed_cb (AutoarCompressor *compressor,
                                      NULL,
                                      &error);
         if (result == NULL) {
+                GtkWidget *error_dialog;
+
                 g_message ("Sharing the exported recipe failed: %s", error->message);
+
+                error_dialog = gtk_message_dialog_new (GTK_WINDOW (exporter->window),
+                                                       GTK_DIALOG_MODAL |
+                                                       GTK_DIALOG_DESTROY_WITH_PARENT,
+                                                       GTK_MESSAGE_ERROR,
+                                                       GTK_BUTTONS_CLOSE,
+                                                       _("Could not share recipes"));
+                gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (error_dialog),
+                                                          _("There was an error sending the exported "
+                                                            "recipes by e-mail.\n"
+                                                            "The exported data can be found at ā€œ%sā€."),
+                                                          path);
+                g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+                gtk_widget_show (error_dialog);
         }
 
         cleanup_export (exporter);


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