From f42b01a0732dc8f9b6c73e44e43fc1badb9b0565 Mon Sep 17 00:00:00 2001 From: Monsta Date: Tue, 16 Dec 2014 18:18:14 +0300 Subject: mate-screenshot: show the actual error message when UI load fails Closes https://github.com/mate-desktop/mate-utils/pull/81 --- mate-screenshot/screenshot-dialog.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'mate-screenshot') diff --git a/mate-screenshot/screenshot-dialog.c b/mate-screenshot/screenshot-dialog.c index c5105be7..7c5fae6d 100644 --- a/mate-screenshot/screenshot-dialog.c +++ b/mate-screenshot/screenshot-dialog.c @@ -220,6 +220,7 @@ screenshot_dialog_new (GdkPixbuf *screenshot, gint pos; GFile *tmp_file; GFile *parent_file; + GError *error = NULL; guint res; tmp_file = g_file_new_for_uri (initial_uri); @@ -232,8 +233,8 @@ screenshot_dialog_new (GdkPixbuf *screenshot, dialog = g_new0 (ScreenshotDialog, 1); - dialog-> ui = gtk_builder_new (); - res = gtk_builder_add_from_file (dialog->ui, UIDIR "/mate-screenshot.ui", NULL); + dialog->ui = gtk_builder_new (); + res = gtk_builder_add_from_file (dialog->ui, UIDIR "/mate-screenshot.ui", &error); dialog->screenshot = screenshot; if (res == 0) @@ -242,10 +243,12 @@ screenshot_dialog_new (GdkPixbuf *screenshot, dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - _("UI definition file for the screenshot program is missing.\n" - "Please check your installation of mate-utils")); + _("Error loading UI definition file for the screenshot program: \n%s\n\n" + "Please check your installation of mate-utils."), error->message); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); + + g_error_free (error); exit (1); } -- cgit v1.2.1