[gnome-photos] base-item: Check for errors when running the print operation
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] base-item: Check for errors when running the print operation
- Date: Wed, 16 Mar 2016 00:44:22 +0000 (UTC)
commit 80e7d47d3b2f4c1af86659a3842e83b27139a098
Author: Rafael Fonseca <r4f4rfs gmail com>
Date: Tue Mar 15 17:16:32 2016 +0100
base-item: Check for errors when running the print operation
https://bugzilla.gnome.org/show_bug.cgi?id=763500
src/photos-base-item.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 00912ac..32c7bc3 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -1446,6 +1446,7 @@ static void
photos_base_item_print_load (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
PhotosBaseItem *self = PHOTOS_BASE_ITEM (source_object);
+ GError *error = NULL;
GtkWindow *toplevel = GTK_WINDOW (user_data);
GeglNode *node;
GtkPrintOperation *print_op = NULL;
@@ -1460,9 +1461,16 @@ photos_base_item_print_load (GObject *source_object, GAsyncResult *res, gpointer
/* It is self managing. */
photos_print_notification_new (print_op);
- print_res = gtk_print_operation_run (print_op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, toplevel, NULL);
+ print_res = gtk_print_operation_run (print_op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, toplevel, &error);
if (print_res == GTK_PRINT_OPERATION_RESULT_APPLY)
- photos_selection_controller_set_selection_mode (self->priv->sel_cntrlr, FALSE);
+ {
+ photos_selection_controller_set_selection_mode (self->priv->sel_cntrlr, FALSE);
+ }
+ else if (print_res == GTK_PRINT_OPERATION_RESULT_ERROR)
+ {
+ g_warning ("Unable to print file: %s", error->message);
+ g_error_free (error);
+ }
out:
g_clear_object (&node);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]