From a1d89f41da254fea07dc50c698ef07569c2fcbce Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 25 Jul 2007 21:26:36 +0000 Subject: [PATCH] only show an error dialog if being called interactively. 2007-07-25 Sven Neumann * plug-ins/print/print.c: only show an error dialog if being called interactively. svn path=/trunk/; revision=23007 --- ChangeLog | 5 +++++ plug-ins/print/print.c | 25 ++++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e290221d34..bcc1446fee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-07-25 Sven Neumann + + * plug-ins/print/print.c: only show an error dialog if being + called interactively. + 2007-07-25 Sven Neumann * plug-ins/print/print.c: removed drawable parameter which was diff --git a/plug-ins/print/print.c b/plug-ins/print/print.c index 1f9260d571..3b42d2fe78 100644 --- a/plug-ins/print/print.c +++ b/plug-ins/print/print.c @@ -45,6 +45,8 @@ static void run (const gchar *name, static gboolean print_image (gint32 image_ID, gboolean interactive); +static void print_show_error (const gchar *message, + gboolean interactive); static void print_operation_set_name (GtkPrintOperation *operation, gint image_ID); @@ -224,6 +226,19 @@ print_image (gint32 image_ID, gimp_image_delete (image_ID); if (error) + { + print_show_error (error->message, interactive); + g_error_free (error); + } + + return TRUE; +} + +static void +print_show_error (const gchar *message, + gboolean interactive) +{ + if (interactive) { GtkWidget *dialog; @@ -234,16 +249,16 @@ print_image (gint32 image_ID, "while trying to print:")); gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), - error->message); - g_error_free (error); - + message); gimp_window_set_transient (GTK_WINDOW (dialog)); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } - - return TRUE; + else + { + g_printerr ("Print: %s\n", message); + } } static void