summaryrefslogtreecommitdiff
path: root/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'print.c')
-rw-r--r--print.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/print.c b/print.c
index 20cdeea..2826ac2 100644
--- a/print.c
+++ b/print.c
@@ -111,6 +111,8 @@ PageSetupCB(Widget widget, XtPointer client_data, XtPointer call_data)
void FinishPrinting(AppPrintData *p)
{
+ char *scr;
+
if (p->printtofile_handle) {
if (XpuWaitForPrintFileChild(p->printtofile_handle) != XPGetDocFinished) {
fprintf(stderr, "%s: Error while printing to file.\n", ProgramName);
@@ -118,6 +120,27 @@ void FinishPrinting(AppPrintData *p)
p->printtofile_handle = NULL;
}
+ /* Job completed, check if there are any messages from the spooler command */
+ scr = XpGetOneAttribute(p->pdpy, p->pcontext, XPJobAttr, "xp-spooler-command-results");
+ if( scr )
+ {
+ if( strlen(scr) > 0 )
+ {
+ const char *msg = XpuCompoundTextToXmb(p->pdpy, scr);
+ if( msg )
+ {
+ Msg(("Spooler command returned '%s'.\n", msg));
+ XpuFreeXmbString(msg);
+ }
+ else
+ {
+ Msg(("Spooler command returned '%s' (unconverted).\n", scr));
+ }
+ }
+
+ XFree((void *)scr);
+ }
+
if (p->printshell) {
XtDestroyWidget(p->printshell);
p->printshell = NULL;