diff options
author | Monsta <[email protected]> | 2014-12-16 18:18:14 +0300 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2014-12-17 08:50:25 +0100 |
commit | f42b01a0732dc8f9b6c73e44e43fc1badb9b0565 (patch) | |
tree | e956488a5fda98830258c3d0352e92bf1e5cd1cb | |
parent | 61e65382f96b8fb1879bde306cd40756d7d33a56 (diff) | |
download | mate-utils-f42b01a0732dc8f9b6c73e44e43fc1badb9b0565.tar.bz2 mate-utils-f42b01a0732dc8f9b6c73e44e43fc1badb9b0565.tar.xz |
mate-screenshot: show the actual error message when UI load fails
Closes https://github.com/mate-desktop/mate-utils/pull/81
-rw-r--r-- | mate-screenshot/screenshot-dialog.c | 11 |
1 files changed, 7 insertions, 4 deletions
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); } |